Jump to content
Sign in to follow this  
tortuosit

Either - or... (with "probability of presence) how?

Recommended Posts

Hi guys,

editor objects have the "Probability of presence" flag. But somewhat it is usually useless for me.

Lets say I have unit_1 and unit_2. If unit_1 (50% probability) is not placed, unit_2 must be placed. And vice versa, I want only one unit. In code, I'd use a switch statement.

I have no chance to achieve this via Editor only, right? I.e., I think I have to place objects via code and include it with execVM?

I only ask, because for Alive I usually set up quick missions. Due to laziness or ease of use, I don't want to start writing code and and handle sqf files, if maybe I just oversee some UI capabilities...

Thx

Share this post


Link to post
Share on other sites

1. set unit_1 to 50% probability

2. Type in following into the condition of presence field of unit_2:

!alive unit_1

I'm not 100% sure if this will work because if unit_1 is created after unit_2 it may not work...

Share this post


Link to post
Share on other sites

Will the alive command also work for modules or vehicles? For instance, the Alive CQB module? Will test, I'm not at my gaming rig.

Share this post


Link to post
Share on other sites

You can do the unit spawning through scripting pretty easily

If {random 100 <= 50.00} then {

"soldierWB" createUnit [getMarkerPos "barracks", group player];

} else {

"soldierWB" createUnit [getMarkerPos "house", group player];
};

http://community.bistudio.com/wiki/createUnit

A random number out of 100 will be picked, if its less than 50, then the first soldier will spawn, if its over 50 then the second unit will be spawned.

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  

×