Loot spawn script |
Basically what my initiation system does is this...
It gathers ALL buildings on any given map within a radius from a center point (currently set for 6000m on the map Stratis). It then damages buildings and opens doors on buildings based on probability, so each and every game is random. You will no longer be able to know if someone is or has been in the area based on doors being closed! That's right... not every door opens.
It then reevaluates the buildings and gathers all possible available building positions (green circle markers), as well as calculates a number of random building positions outside of the building model (red circle markers), as well as gathers manually placed building positions (set by myself in another config file, yellow circle markers). This structure is static and dynamic at the same time, which makes for a more random outcome for possible loot positions.
The colored building markers are to show which buildings have default loot positions available (green), and those that don't (red). The other building colors of khaki green (with default loot positions) and black (without default loot positions) tell me that those are damaged buildings.
Possible loot spawn positions (red = random outside, green = default inside, yellow = custom inside) |
Loot spawn positions vs actual spawned loot |
Look Ma, no floating loot! |
I am in the process of also adding custom buildings/towns to the map Stratis, so that loot spawn points are not concentrated on the air field, marinas or camps. There will be town(s) in the south of the map, north of the map and east of the map... to keep things more in balance (similar to what the wasteland mission has), as well as "beefing up" the existing places.
I will post a proper video demonstration of the debug markers and actual in-game "loot mongering" to show everything in action.
I have tested this script over and over again, rid all the scripting errors, optimized the code structure, and am quite pleased with the outcome.
I am also able to easily swap the loot spawn system to any map I decide to throw at it with very little manual configuration... (map size and probability) and it will run flawlessly. I've tested the script on the maps, Stratis, Wake Island, Gorgona and a few others... every time... flawless.
I hope that gives some insight on the loot spawn system in which I have been working on for the last few weeks.
Dynamic coding/scripting FTW!
-soul.