This is on hold, and has been for quite a while. Work may continue on this once I've learned more and worked out some bugs
This thread contains both the script progress of the mission I'm working on as well as requests for codes. All scripts I finish testing will be posted in here for anyone to read and use.
Of course credits will be given to all parties from which I've managed to solve, optimize or get complete strips of code from.
Any help with suggestive alternative methods for codes, optimizations or curious ideas or questions will be appreciated.
* Map/Mission description : Chasers are 1 to 2 players (initially during testing and developing), they get helicopters that they use to track down and kill the runners with. The runners get a choice between a few weapons besides what they spawn with and a couple of vehicles that they may use to defend themselves with and make their way. Tweaks are made to units using scripts rather than mods, to balance health for a fair "feel". This was initially a simple map for fun that me, my brother and a friend of his played to pass time. I ended up trying to make something simple way too advanced.
- Clean and index thread properly.
- LOTS OF CODE!
- Share it..
Currently working on
- Merger of the healing scripts to create a healing platform that heals depending on unit entering, how many they are and how hurt they are.
WIP Code in spoiler(complete ammo recharge for vehicle is not included atm, neither does it work of the bat. Progress is halted for today): Spoiler:
Problems that have been solved
- Spawning and respawning with items of choice. Solved with addWeapon-script, Thank you Celery!
A lot remain.
- Creating a platform which heals units. my script thread for this strip. (will update when the platform can recharge ammo)
- Healing platform progress script addition 3 script:Spoiler:
- Healing platform progress script addition 2 script:Spoiler:
The main thread
Hello there, I've searched and searched for script help on my issue but for the most part I find uncompleted or "cloggy" code which people keep posting how they disagree with each other on. I've tried myself but not gotten very far.
At the moment I've got respawning vehicles, some ammo boxes with desired weapons, "ALICE 2" running and am planing to add some changes to my vehicles to make them a tiny bit faster as well as more durable.
I thought that if I used a unit respawn script that set the variable playable to true on the unit, it would allow the player to respawn on this unit. That wasn't so. It appears I have to spawn as a default character type and when I do I do not get the full inventory of the originally placed unit.
I've searched for a respawn script, or alternative respawn script but I've not found anything claiming clearly to be just that.
Player respawner- Modded for players (WIP,Not functioning as intended) . Original code by norris (//Scripting by norrin Oct 2008 )
Useage Put the code bellow Init on a named unit along with a marker for which within it can respawn.
MARKER - Respawn within this marker. Random location within marker not working.Code:nul = [this,"MARKER",EQUIPMENT,RESPAWNS,DELAY] execVM "scripts\respawner2.sqf";
EQUIPMENT - 1 will leave equipment on the respawned unit, 0 will remove all equipment including backpack.
RESPAWNS - Any number under 900 will result in the ability of the unit to respawn that amount of times, but any number over 900 will result in the unit having infinite respawns.
DELAY - Delay before the unit respawns after death.
There are more features but I only list the ones I use, for more options read the scrip or readme that comes with the original release. Sorry, do not have time to source atm.
File "respawner2.sqf" - Should be saved in a scripts\ folder within your mission.
What I wanted this to do is;
* [strike]Clear the entire inventory of the respawned unit and then give them a map and a compass. Possibly with an option to exec a .sqf or array to equip it with instead. Alternative to this would be having the default spawn unit have custom selected gear.[/strike]
* [strike]Disable AI completely, including radio chat and conversation. Would prefer the unit being completely hidden until a player inhabits it.[/strike]
* Random spawning location within a marker.
* Possibly an option to random pick model.
* [strike]Ability to edit the default respawn script to determine what unit spawns and what he weapons and items it has. All scripts I've found has suggested the this removeAllWeapons, etc. But that only applies once, if you die and respawn you become a new unit which I don't know how to poke.[/strike]
* [strike]Maybe using a pitch black room underground or so where the players would spawn in would work. Depending on which side they are the players then get teleported to their respective bases. This is to remove the need for none-ai units. However it would still require radio silence as hearing "where are you?" constantly, is quite annoying. It seems the "no ai units" problem is solved already.. here is the description.ext[/strike]
Vehicle respawner - I was using this one, but it proved to not work the way I wanted it and respawned vehicles too fast and too easy. It contains some features that I would enjoy adding to the other respawner.
What I want this to do;
* If an unmanned vehicles that are not drivable or/and are _X meters from any players they should respawn in base after _Y seconds. Optionally if vehicle is unmanned for _Y seconds it will respawn, do not agree with this function as it can always result in disappointment.
* Possibly a chat message respawning all vehicles which are unmanned.
* Possibly all vehicles on spawn position made invulnerable.
* Possibly optionally setting vehicle max speed to or adding _X as well as general endurance of all parts.
* Possibly clear the ground under the spawning unit from clutter such as after an helicopter exploding.
* Possibly, Spawn units out in an array within a marker anywhere it has enough room for it to.
* [strike]Create marker in front of vehicle when map is loaded, use this marker to determine which direction to face the vehicle from then on. (can probably implement this myself) Saves a lot of work with marker placement.[/strike]
Other script wishes:
* Road detection script, I've got none and only found very small portions of the code for anything using it. But I'm looking to make random vehicles spawn along the road at a certain chance as you drive along.
The vehicles should be picked from an array and spawn on the side of the road where there is room. Not crossing or standing on the road. The script should not be executed all the time and only within a certain rate of any player within the array of "runners".
I've read about nearRoad or such script executions, but found no examples which I could understand clearly. Most arma code is confusing to me, and what I see as being logical usually ends up being wrong. ;p Curse my logic.
* Building loot script. I've looked through some scripts for this, however the link posted for the script that had most of what I required was a dead link. I'm looking for a script which places loot boxes in buildings at a chance when player is within range.
Not completely random loot, random from an array and chance list.
I found some old post about a script that scanned the floors of houses and determined spawning locations useable for the house and putting them in an array, not sure how much I would be able to use that for but I can think of a few things.
- Alternative would be spawning barracks/field hospitals/tents containing items of various types.
- Method of creating tents could be using markers selecting a custom made layout of positions, items and buildings where all containing items would be saved into variables for use for other spawns. When map starts these builings would be removed and then spawned by chance as player gets close to either markers or towns. Spawning them where there is room for them and player can enter them. Using this method all "items" within the structure can be a spawn point for any other item(s), having these locations listed in an array. If this is possible it should make it easier, from my understanding.
* Random vehicle spawn in town, in marker, next to road. Pretty much explains another thing I've had in thoughts, but as progress on all other functions have been pretty much halted due to lack of script knowledge and available explanations as to how to use them.
* Dynamic spawn location - Spawn at nearest town from where player died, spawn a gear box near or in a building where the player would spawn within and a car or two outside. (This is probably not simple and sort of a mix of the above.)
* If item x is in vehicle inventory add y to vehicle stat.
* Ammo respawns for currently equiped weapon by chance in buildings as player passes through town/village/city. Erased when player(s) are out of range again. Doesn't reinit for the same town unless the same player(s) enters another first.
* Platform that refills Health/Armor/Ammo if landed on top of. (nearly done, not tested on helicopters.. even though I use an helipad!)
* Platform that heals injuries and replenishes ammo+health. (nearly done, not gotten trigger creation to work as I want yet though. May no longer need it in either case due to a versatile script I created. It is listed above)
* I have pretty much started to understand the biki. Took some time :| Once I am done here I'll post all code in a list with as clear descriptions as I can come up with along with search words for future purposes.