Jump to content
Sign in to follow this  
Crighton

Probability of appearance

Recommended Posts

Hi All, long time reader first time poster.

I am sorry if this is a simple question, I have looked through the editor manuals and guides as well as this forum but for the life of me I cannot find exactly what I am looking for.

I know there is a slide on a unit in the editor which gives the change that that particular unit from appearing in the mission.

However when I have a squad, and adjust the probability of the Squad Leader appearing, it only affects him and not the entire squad.

Change the probability to the same in each squad member and it affects that squad member only.

So I tried Naming the Squad Leader S1, and using the probability of the other units being If S1 exists then they do and if S1 does not exist then the rest of the squad does not exist.

But I just get Syntax errors so clearly have no idea what I am doing.

So I am hoping someone would be kind enough to enlighten me how I link the probability of the whole squad all or nothing.

My idea hope is for the following scenario. The Heroes/Players have to defend two convoys, each going to a different village.

Now they will not know which is under attack until it happens ( that I can script). For this to happen I would like to be able to script in two attack forces.

Each attacking its own convoy. However I only want one to exist, so have a 50% chance that attack force A exists (as a whole) and of Attack force A does not exist then Attack for B will.

Thus making it random each time we play.

Thank You in Advance

Share this post


Link to post
Share on other sites

i dont think there is a way you can set the probability of presence to an entire group, but you can do it with a little bit of scripting.

-so first you place two game logics (or any unit you want but these are the best for this purpose), and you put their probability of presence to 50 percent.and name them say a1 and a2

-then you create a script file (text file with .sqf behind it), you can just copy another script file if you want and then just change the name and delete the contents. name it say spawn1 and also create a second one named spawn2.

-add

Grp1 = Creategroup EAST;

"SquadLeaderE" createUnit [position w_1 , Grp1, "", 1, "sergeant"];

"SoldierEMedic" createUnit [position w_1 , Grp1,"", 1, "corporal"];

"SoldierEG" createUnit [position w_1 , Grp1,"", 1, "corporal"];

"SoldierEAT" createUnit [position w_1 , Grp1,"", 1, "corporal"];

"SoldierESniper" createUnit [position w_1 , Grp1,"", 1, "corporal"];

"SoldierEMG" createUnit [position w_1 , Grp1,"", 1, "corporal"];

WP1 = Grp1 addWaypoint [position w_2, 0];

WP1 setWaypointType "MOVE";

to the contents of the script file, this script if activated will spawn a group of east soldiers on position w_1 (you can again best use a game logic with this name at the location you want your unit to spawn) and this unit will then move to position w_2 (again game logic).

you should then make a similar script for the second position but with a different spawning location.

for more info on the way to spawn units and waypoints just search the commands in the bohemia interactive wiki or the ofpec comref.

-then you should make a trigger, who has !(alive a1) as condition and in the activation field null= execvm "spawn1.sqf".

and create another trigger the second spawn just change a1 to a2 and spawn1.sqf to spawn2.sqf

so tecnicaly that should do it

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  

×