Jump to content
Sign in to follow this  
igneous01

RUFS - Random Unit Fortification Script (WIP)

Recommended Posts

The idea was to have some sort of smart script, that would spawn static weapons in not only random areas, but areas that made sense strategically. And to also spawn fortifications along roads and empty spaces, with men inside the forts so that they look like they are properly defended. I figured how cool would it be to just load up the script, and face a different fortification and fight each time.

Well, this idea has partially come true, but alas - lack of interest with the script, and some things I could not work out, have made me post it as is. I am hoping someone will take on the task of finishing the script, as it has alot of potential imho.

so without further delay, the script:

Random Unit Fortification Script:

What it does do as of right now:

- Spawns static weapons in random and also sensible locations

- Spawns not only static weapons, but they also come with sandbags around them to make them look legit

- Spawns static weapons on Roof tops WITHOUT looking bugged or floating (for the most part)

- Spawns fortifications (this part needs some tweaking, especially deciding on flat surface large enough, i think i have an unfinished function to find such positions)

- Spawns Road fortifications (essentially forts that look like a checker station, there exist 2 types at the moment - a light, and a medium, with the medium looking more fancy with the bunker and extra stuff. These forts also space evenly out across a road with a spacing of 200m (you can tweak it in the functions init as you please)

- Spawns roadblocks and debree along roads (barb wire, junk, some sand bag pieces, tank traps, etc)

- Spawns units and assigns them static weapons to man (it usually occupies all statics, but ive seen it not do so for some reason)

- Spawns groups of units, checks for buildings near the area, look for ones that are enterable, and moves units into individual spots, without returning to formation (however, they still try to engage you by leaving them :( )

- I have added already some support for this to work with UPSMON in tandem, You can write, and store INIT strings for UPSMON in a variable, and these can be randomly selected and applied to the group leader of a spawned unit. that means that units that are supposed to spawn in fortifications have some ability to patrol and what not, as not to look static

- Static weapons will generally spawn in the appropriate direction of the logic, so as not to have goofy looking defenses where an attack is to be expected

- Different fortification level types, light, medium, and heavy

- statics and forts are spawned using a small density function, to decide how many to put in per space

- Script is designed to check for all possible environments, if roads are found, forts will spawn there, if none are found it will skip it, same with detecting cities, enterable buildings, etc) its automatic in some sense

not done yet:

- Minefields (to which i was hoping to have in smart locations)

- Heavy Fortifications

- All factions (currently only have Russians)

Play testing this script was pretty fun for the most part, I was surprised and suppressed by an unknown static everytime i was play testing this, sometimes I had no idea where it was until after I died - My ai squad most got mowed down very fast as well. Enemies in buildings also kept my blood pressure up.

Now somethings I havnt mentioned:

There are options in the script to turn of certain things, as not all fortifications are intended to be on roads or in cities. There are some parameters you can use to turn off things like roadblocks, debree, roadforts, forts in general, how many AI groups to spawn, etc - its all documented pretty well in the RUFS.sqf

UPSMON can work with this, if you create the marker inside the init string, and in the position of where the unit spawns, hell, you can do alot of things with the init strings, but the original intention was to have random behaviours for patrols with UPSMON, some in a fortify mode, others normally patrolling etc.

All the fortifications were done using the createcomposition.sqf script, and all forts were made in the direction facing north, to make it easier to spawn them with the right direction in game. You can make your own forts and stuff if you want to be creative, then just add them to the library and theres a chance they will spawn.

Now, how to run the script:

you need these files:

- compositions folder, which contains all the forts and bagged up statics

- Createcomposition.sqf

- RUFS.sqf

- RUFS_Fnc_Init.sqf

first, in init.sqf, add this line:

call compile preprocessFilelineNumbers "RUFS_Fnc_Init.sqf";

and thats it for the hard part, now to run it in game, create a gamelogic as a center for the area to fortify, name it, and use:

nul = [[logic, 450], [EAST, "RU"], [1, "default"], [10, []], ["noRoadFort", true] ] execVM "RUFS.sqf"

this is an example, most of these parameters are optional, The full documentation is clearly explained (for the most part) in the RUFS.sqf about all parameters

now some proof with missions, using only the script (wont be humongous fights, but you'd be surprised how fast a hidden mg can gun you down), i have also incorporated UPSMON into these missions for some variety on patrols (however some patrols are not spawning properly inside fortifications, which is a shame right now)

http://www.4shared.com/file/zLtrVSl_/Random_Unit_Fortification_Scri.html

contains two missions, one on chernarus, and another on takistan, the takistan one plays out better because its a better city (with enterable buildings)

I have documented as much of my work here as possible, both the functions init and the script are documented to tell you exactly what they do, so hopefully people will understand and can work with it if they want to (do whatever you like)

enjoy, and leave any feedback and bugs that might not be mentioned here, for future reference.

Edited by Igneous01

Share this post


Link to post
Share on other sites

How did I not see this before?? Looks very interesting will try it out.

edit: the link is dead.. any chance of a repost?

Share this post


Link to post
Share on other sites

^ hey boffin been following with interest your Insurgency Simulator progress on your blog... Insurgency definitely needs more ACE/ACRE :)

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×