Jump to content
Sign in to follow this  
I34dKarma

I34dKarma's Roadblock Site Script

Recommended Posts

roadblockpic.jpg

Summery:

This script allows you to easily configure and place roadblocks into your mission. The roadblock consists of two small bunkers with a bargate that is animated if you are on the same side as the units manning the gate. Bargate will not animate if units manning the roadblock are KIA. Simply Put down a map marker in the editor, set the config options in your init.sqf file and that is all that is needed.

Video Example

sttosin made a few videos testing out the script if you would like to take a look

Current Version 1.1 Download

Script 1.2 Download Link

Known Bugs

-Using the Insta Base Site with auto direction may cause errors.

- Using Insta Base on hilly terrain is not recommended.

ChangeLog

Version 1.2

- Fixed Hovering Bunkers

- Minor Script Improvements

- Fixed Manned Machine Guns To Face More Natural Direction.

- Updated Demo Mission.

Version 1.1

- Added Autoplacement Direction that grabs the road direction

Usage And Install Directions:

1. Extract the karma_roadblock folder and then copy the karma_roadblock folder into your mission folder i.e \MyDocuments\Arma 3-Other Profiles\YourProfileName\missions\YourMissionName.

2. Add the following lines of code to your mission init.sqf file. The location of these two lines is not to critical so you can try it at the end of your init.sqf or the beginning and see what works best for you.

karma_roadblock_list = [["roadblock_1",0,"NATO",1,0,1,0,10],["roadblock_2",0,"AAF",1,1,1,0,10]];
#include "karma_roadblock\karma_roadblock_start.sqf"

Example Breakdown

This is a description of the karma_roadblock_list array example

karma_roadblock_list = [["your_marker_name_here",direction the roadblock would face (0-360),"side of units you want manning the gate",bargate destruction option (1 or 0),site type option (0,1,2,3),auto road direction (0,1),auto direction flip (0,1),roadscan distance (10)]];

The karma_roadblock_list array I used as an example will produce the following:

Site 1 - Basic roadblock site with 3 NATO units and a bargate that is indestrutable

Site 2 - Same basic site but is armed with static HMGs manned by AAF units and a bargate that can fall over.

Site 3 - Large Sandbag Bunkers

Site 4 - Spawns base around roadblock (Instabase).

3. Place markers on the map in the editor.

Following the example code above you would place to markers on your map called roadblock_1 and roadblock_2. The names can be anything you would like to use as long as you edit the karma_roadblock_list array to reflect the maker names you would like to use. Any kind of marker listed in the editor will work I use the invisible marker type so it will not show up on the map while in game. You can also add additional roadblock as long as you follow the format shown in the example karma_roadblock_list that was shown above.

4. Set the direction in degrees you want the roadblocks to face in the array.

The example listed uses 180 degrees and 90 degrees. This might require a little tweaking in the editor to get the roadblock placed how you like it.

Hint on the smaller sites the marker on the map seems to correspond with one of the legs of the bargate.

5. Set the desired side in the array. Accepted values are "NATO", "CSAT", "FIA", "AAF", "CUSTOM".

"CUSTOM" is designed to get the script to work with custom units made by the Arma Community. This option will require some additional configuration in the karma_roadblock_list array. Below for an example.

6. Set Option for bargate destruction.

Use 1 for an indestructible bargate that will damage vehicles. Use 0 for a bar gate that will just fall over when hit. Handy If you want to crash through roadblocks.

7. Set Site Type. Currently I made 3 different sites (List will get bigger in time)

Use 0 for simple site with 3 units (Same As Version .01)

Use 1 gives a site that appears the same as 0 but with 2 Static HMGs in bunkers.

Use 2 to give you a basic site with Large Sandbag Bunkers instead of small ones (Handy in large open areas)

Use 3 to creates a base around a site identical to site number 1, or "Instabase" as I call it.

8. Set Auto Road Direction Mode.

Use 1 to enable auto direction mode. This will get the direction of the road the roadblock is placed on.

Use 0 for standard placement method.

9. Set Auto Road Direction Flip

Use 1 to rotate the direction of the roadblock 180 degrees when auto direction mode is on.

Use 0 for standard placement or to keep the default direction of the road direction.

10. Set Road Scan Distance

Use any number to find road segments within the given distance. (5 to 10 seems to work well)

11. Preview and enjoy.

Note: Side of the AAF will change depending on the side selected in the Mission Editor Intel Area for Independents.

Custom Unit Usage.

To use with Mod units you will need the class names of the mod units you would like to use. Then add them to the the karma_roadblock_list. The side of the custom units will also be required.

karma_roadblock_list = [["roadblock_1",0,"CUSTOM",1,0,1,0,10,WEST,["B_Soldier_F", "B_soldier_AR_F", "B_soldier_LAT_F", "B_Soldier_GL_F"]],
["roadblock_2",0,"CUSTOM",1,1,1,0,10,WEST,["B_Soldier_F", "B_soldier_AR_F", "B_soldier_LAT_F", "B_Soldier_GL_F"]],
["roadblock_3",0,"CUSTOM",1,2,1,0,10,WEST,["B_Soldier_F", "B_soldier_AR_F", "B_soldier_LAT_F", "B_Soldier_GL_F"]],
["roadblock_4",0,"CUSTOM",1,3,1,0,10,WEST,["B_Soldier_F", "B_soldier_AR_F", "B_soldier_LAT_F", "B_Soldier_GL_F"]]];

Add the side of the units after the site type value. Then add an array of the class names that you would like to use. This list can contain as many different units classes you want to use and the three units will be selected at random in the script.

Optional Script Parameters

-Debug Mode

I added this to aid with install and a quick way to check if the script was installed correctly. Add this line of code in your init.sqf file somewhere above the karma_roadblock_list

karma_roadblock_debug = 1;

If this variable is set to 1 you will get a hint telling you the script is running. The hint will also tell you how many sites should be spawned.There is also a side chat that will trigger for each time the site is spawned.

Set karma_roadblock_debug to 0 if you want to leave the variable but disable Debug Mode.

- Gate Timing And Control Options

Add these two lines to your init to customize the gate checking timing and distance.

karma_roadblock_distance = 15;
karma_roadblock_check_sleep = 2;

Distance is the distance to check for new units in area of bargates. Similar to area of a trigger. Check sleep will allow you to time how fast the gate will check for new units. The higer the value the longer you will have to wait at a bargate, as well as increase the time it will remain open. Lower sleep values may affect script performance.

Future Plans For Script

-Different Site Layouts For The Roadblock I.E. Different Bunkers And Other Objects

-Different Ways To Get Gate Open If Troops Manning It Are Alive I.E. Present Credentials,Bribe,Talk

If you have any bugs or feature requests feel free to let me know.

Credits

Thanks to the entire Arma Community and BI Forums for any help that you provided

sickboy - Giving a great example of dynamically naming objects and for SixConfigBrowser.

Kylania - His website with all the great script examples. Great guide when I started scripting.

subminuentisch - For his help with development and PBOing of the Mod version of the script.

ARJay - For his function for finding direction of road segments.

License Agreement

- You may not reverse-engineer this addon unless its for the express use of improving your scripting knowledge.

- You may NOT distribute altered versions of this addon without my written permission.

- You may NOT use this addon or any derivatives thereof in any way for monetary gain. Exception granted for Youtube videos (Note See BI's license agreement on monitized video distribution of their game content)

- You may NOT use this addon or derivatives thereof as part of any submission to any contest or any kind (especially not for the "Make Arma Not War" contest by BIS) without my consent and per agreement on compensation coming from any prize.

- I am not liable in any way for damage to any computer system, component, or software by using this addon.

Complete ChangeLog

Version 1.1

- Add Auto Direction Option for the roadblock to automaticly get the direction of the road the roadblock was placed on.

Version 1.0

- Add option for custom (mod) units

- Add Timing and Distance as customizable values

- Minor script improvements.

Version 0.5 Alpha

-Added debug mode to easily test proper installation of script

-Changed file name of the init.sqf file in the karma_roadblock folder to prevent confusion of 2 init.sqf files

-Changed bunker spacing to make it look more realistic on two lane roads.

-Now Three different types of sites that can be spawned.

-Set bargate damage mode added as an option for each site. (Indestructible Or Destructible Bar Gates)

-Tested in multiplayer game.

-Some Basic Code Improvement.

Edited by I34dKarma
Version 1.2

Share this post


Link to post
Share on other sites
Guest

Release frontpaged on the Armaholic homepage.

==================================================

We have also "connected" these pages to your account on Armaholic.

This means in the future you will be able to maintain these pages yourself if you wish to do so. Once this new feature is ready we will contact you about it and explain how things work and what options you have.

When you have any questions already feel free to PM or email me!

Share this post


Link to post
Share on other sites

Where do I add the code in my mission file? My code is long and not sure where to put it. (no pun intended)

Share this post


Link to post
Share on other sites

Hi

Great addition and something I've missed :)

BUT..... Do you mean the MISSION file or the init file in the missionfolder? Because I can not figure out how to actual place them down on the ground, looked through all the categories in the editor and there is no gate there far as I can see.

Share this post


Link to post
Share on other sites

Put the code in your init.sqf then create markers called roadblock_1, roadblock_2 etc.

The marker will magically turn into a roadblock :D

Share this post


Link to post
Share on other sites

duh, thanks

Tried looking for the code where I only could have the gate opened, but got lost :(

Edited by Pro
gate

Share this post


Link to post
Share on other sites
Where do I add the code in my mission file? My code is long and not sure where to put it. (no pun intended)

lavbo you really dont need to modify your code at all you need to do is add two lines to your init.sqf file

karma_roadblock_list = [["roadblock_1",180,"NATO"],["roadblock_2",90,"NATO"]];

#include "karma_roadblock\init.sqf"

Just copy the entire karma_roadblock folder into the mission folder you are currently editing and that's it. Place the map markers set your parameters in karma_roadblock_list array and your done.

Guess if you are having problems a little better description could benefit everyone.

duh, thanks

Tried looking for the code where I only could have the gate opened, but got lost :(

Pro hope you got it working if you have more questions I will try and answer them.

Share this post


Link to post
Share on other sites
lavbo you really dont need to modify your code at all you need to do is add two lines to your init.sqf file

karma_roadblock_list = [["roadblock_1",180,"NATO"],["roadblock_2",90,"NATO"]];

#include "karma_roadblock\init.sqf"

Just copy the entire karma_roadblock folder into the mission folder you are currently editing and that's it. Place the map markers set your parameters in karma_roadblock_list array and your done.

Guess if you are having problems a little better description could benefit everyone.

Pro hope you got it working if you have more questions I will try and answer them.

Ye, got it working and it's sweet, it adds the little extra ;)

Great work!

Share this post


Link to post
Share on other sites

I probably overlook something....

Do I have to place two markers (doesn't matter what kind?) on the map and give one the name roadblock_1 and the other one roadblock_2?

With other words i don't get this yet;

Place the map markers set your parameters in karma_roadblock_list array and your done.

Share this post


Link to post
Share on other sites
I probably overlook something....

Do I have to place two markers (doesn't matter what kind?) on the map and give one the name roadblock_1 and the other one roadblock_2?

With other words i don't get this yet;

Place the map markers set your parameters in karma_roadblock_list array and your done.

No. If you only want one roadblock then you can delete ,["roadblock_2",90,"NATO"]

If you want more then you can add to that as well;

karma_roadblock_list = [["roadblock_1",180,"NATO"],["roadblock_2",90,"NATO"],["roadblock_3",45,"NATO"]];

#include "karma_roadblock\init.sqf"

You can actually name the marker anything you want, as long as the marker matches what you have in the string...

karma_roadblock_list = [["noob",180,"NATO"],["dweeb",90,"NATO"],["nerd",45,"NATO"]];

For that you'd have to have markers named noob, dweeb and nerd.

karma_roadblock_list = ["AnyMarkerName",degrees of rotation,"faction"];

Someone please correct me if I'm wrong.

Edited by BadHabitz

Share this post


Link to post
Share on other sites

okay i'm sorry i explained my 'problem' a bit wrong.

I know how the array works with the roadblock_1, nerd_2 and imstupid_3 :-) and your explanation is correct in my opinion

What I did/do;

- I placed the map in my missionmap in arma3 directory(Documents\Arma 3\missions\test.Altis).

- I created a init.sqf in the missions\test.Altis map with this;

karma_roadblock_list = [["roadblock_1",180,"NATO"],["roadblock_2",90,"NATO"]];

#include "karma_roadblock\init.sqf"

I placed with F6 Markers(in the editor) a marker in the map..just the first markersymbol that pops up in the window..put in the name field roadblock_1, a second one roadblock_2

I click preview and the road is empty??

I haven't played the first releases of arma so i'm trying to get a finger on how all the nice stuff works. I was creating an roadblock in the editor and the only thing i saw where two soldiers on each side of the road doing nothing...

I thought this can't be right..i google it up and found this topic...GREAT!

Share this post


Link to post
Share on other sites

Can't Find road block icons or marker in mission editor

After install and put your script in my int.sqf and i place any icon or marker and name it roadblock_1 and will it change automatically founctionalbe roadblock?

Share this post


Link to post
Share on other sites
okay i'm sorry i explained my 'problem' a bit wrong.

I know how the array works with the roadblock_1, nerd_2 and imstupid_3 :-) and your explanation is correct in my opinion

What I did/do;

- I placed the map in my missionmap in arma3 directory(Documents\Arma 3\missions\test.Altis).

- I created a init.sqf in the missions\test.Altis map with this;

karma_roadblock_list = [["roadblock_1",180,"NATO"],["roadblock_2",90,"NATO"]];

#include "karma_roadblock\init.sqf"

I placed with F6 Markers(in the editor) a marker in the map..just the first markersymbol that pops up in the window..put in the name field roadblock_1, a second one roadblock_2

I click preview and the road is empty??

I haven't played the first releases of arma so i'm trying to get a finger on how all the nice stuff works. I was creating an roadblock in the editor and the only thing i saw where two soldiers on each side of the road doing nothing...

I thought this can't be right..i google it up and found this topic...GREAT!

When I place a marker on the map I use a marker and then make sure its the invisible maker so it will not show on the map, but any map marker would work. BadHabitz was correct you can name your makers anything you want as long as use the same name in the array. You can have any number of roadblocks you want as long as you follow the format of the array in the example. Make sure you moved the karma_roadblock folder into your Documents\Arma 3\missions\test.Altis folder because that is where all the code is.

One thing you could do is add a command into your startup paramters for Arma 3. Its called show script errors what it will do is pop up a little error message and tell you whats wrong. Go into steam, right click on Arma 3 go to properties and then set launch options, add this to the box -showScriptErrors and hit okay. The next time you play or preview the mission you will see if any errors pop up. This can help work through any problems you have. You can do a search for Arma Start Up Paramters to take a look at the list and get a description on what that does as well as any other start up commands that might help out.

There was a site module in the editor for a traffic control site and when I tried it the module just spawned two units on the road which is one reason I wrote this script.

Post back with any errors and I can try and help further.

Can't Find road block icons or marker in mission editor

After install and put your script in my int.sqf and i place any icon or marker and name it roadblock_1 and will it change automatically founctionalbe roadblock?

You will not find a roadblock marker in the mission editor. You can use any type of marker you like I prefer the invisible marker type because it will not show on the map. You can give the marker any name you like or just use roadblock_1 and roadblock_2 like I did in my example. If the file is installed correctly and the two lines of code added into your init.sqf file you should see a functioning roadblock site appear at the marker locations. The site will look like the sample picture I provided with a bargate that will open when you get close to it. Take a look through the thread it might answer some questions or if you have more problems post back. I might suggest adding the -showScriptErrors options I recommended to Syncie above it can help find issues when dealing with scripts.

Share this post


Link to post
Share on other sites

Thanks for the input Karma. I have add the parameter -showscripterrors but did not recieve any errors.

I took a look at the steps again,

1. Extract the karma_roadblock folder and then copy the karma_roadblock folder into your mission folder i.e \MyDocuments\Arma 3-Other Profiles\YourProfileName\missions\YourMissionName.

The folder i placed the karma_roadblock in = C:\Users\Syncie\Documents\Arma 3\missions\test.Altis so i got C:\Users\Marcus\Documents\Arma 3\missions\test.Altis\karma_roadblock with the 5 sqf files and the readme.

in the test.altis map is the init.sqf in with the 2 lines of code.

I placed two markers (roadbloack_1 & roadblock_2) on the road and preview...empty road..no errors.

confused :-(

Share this post


Link to post
Share on other sites
Thanks for the input Karma. I have add the parameter -showscripterrors but did not recieve any errors.

I took a look at the steps again,

1. Extract the karma_roadblock folder and then copy the karma_roadblock folder into your mission folder i.e \MyDocuments\Arma 3-Other Profiles\YourProfileName\missions\YourMissionName.

The folder i placed the karma_roadblock in = C:\Users\Syncie\Documents\Arma 3\missions\test.Altis so i got C:\Users\Marcus\Documents\Arma 3\missions\test.Altis\karma_roadblock with the 5 sqf files and the readme.

in the test.altis map is the init.sqf in with the 2 lines of code.

I placed two markers (roadbloack_1 & roadblock_2) on the road and preview...empty road..no errors.

confused :-(

Sounds like you did everything correctly and the lack of script errors is unusual.

You gave me an idea on something that I can add to the script pack for my next release. A simple debug mode to show hints that the scripts are loading and running.

Sorry to hear your still having problems. I will try and see what other ideas I can come up with.

Share this post


Link to post
Share on other sites

can someone make a example mission

and sand me?

im not good on the editor with example mission i understand much more

Share this post


Link to post
Share on other sites

can someone make a example mission

and sand me?

im not good on the editor with example mission i understand much more

Share this post


Link to post
Share on other sites
can someone make a example mission

and sand me?

im not good on the editor with example mission i understand much more

I can include a simple example mission in the next release, it will not have much content but just a couple of roadblocks or one of each type of site for the user to look at. Next release should be out shortly.

Share this post


Link to post
Share on other sites

Version updated to .5. Added features include new sites, option for indestructable bargates and a demo mission. Keep an eye on the thread for more updates.

Share this post


Link to post
Share on other sites
Guest

Release frontpaged on the Armaholic homepage.

==================================================

We have also "connected" these pages to your account on Armaholic.

This means in the future you will be able to maintain these pages yourself if you wish to do so. Once this new feature is ready we will contact you about it and explain how things work and what options you have.

When you have any questions already feel free to PM or email me!

Share this post


Link to post
Share on other sites

@Karma,

Great, things work now!

That was the positive news.

The 'bad' news is that your include points to your development map and that one doesn't exist.

#include "karma_roadblock_dev\karma_roadblock_start.sqf"

I removed the _dev and that fixed the crash to my desktop.

Keep on going!

Share this post


Link to post
Share on other sites
@Karma,

Great, things work now!

That was the positive news.

The 'bad' news is that your include points to your development map and that one doesn't exist.

#include "karma_roadblock_dev\karma_roadblock_start.sqf"

I removed the _dev and that fixed the crash to my desktop.

Keep on going!

Sorry bout that it was a copy paste error. I have two folders one called karma_roadblock_dev that I use for script development and accidentally copy and pasted from that file. Thanks for pointing out the error and I will correct it in the install directions in the initial post. Glad you were able to get the script working and hope the debug mode and the demo mission helped.

Karma

Share this post


Link to post
Share on other sites

Worked quite good on the last OP but the gate closed off our second vehicle which was following behind in full speed, which in combination with a indestructable gate was quite a comedic relief having survived the whole mission just to die by a closed gate at the end.Can you maybe adapt it so that it waits for the whole group to pass until it closes?.

Share this post


Link to post
Share on other sites
Worked quite good on the last OP but the gate closed off our second vehicle which was following behind in full speed, which in combination with a indestructable gate was quite a comedic relief having survived the whole mission just to die by a closed gate at the end.Can you maybe adapt it so that it waits for the whole group to pass until it closes?.

Sub I can see what I can do, I can possibly set some parameters that can be defined so the mission editor may increase the distance of the "Trigger" to open or close the gate that might be one work around. One more definable parameter might be the time to check when a unit is near or has left. The downside of that would be a more significant hit on performance or a longer wait at the gate. I might be able to run another check before the gate closes. See what I can do for the next release. But running a gate at full speed was not exactly what it was intended for.

Here is a video the crash that he was referring to it was during a Strategic Outcomes Op.



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  

×