Jump to content
Sign in to follow this  
RN Malboeuf

Setting AI in two locations

Recommended Posts

Ok, so I didn't know how to search for this. banghead.gif

Anyways, ill lay out some generic code....

in the Init.sqs:

var = Random 1; (I only want this to be whole integers *0 or 1*, will this work)

In Mission: there is a guy0 and guy1.

Depending on which var is chosen one of the guys will either disappear/appear. I am not sure how to code this. I hope it makes sense.

Share this post


Link to post
Share on other sites

the easiest method of doing this is to use the Probability of Presence & Condition of Presence options in the editor.

Set the POP of guy1 to 50%

Set the COP of guy2 to isNil "guy1"

The other option is to place 1 person and group him to two markers, but that limits you to a common set of waypoints.

See Wiki - ArmA Mission Editor

Share this post


Link to post
Share on other sites

random will create Real between 0 and x. For your example you will get everything in [0,..,1) including 0.1234.

You have either to <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">round random 1 or use <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">floor random 2 to get only 0 or 1.

Share this post


Link to post
Share on other sites

Ok, thanks for that...

Guy0 and Guy1 don't have waypoints they are stationary so I think the marker will work best. Can you please show me an example of this? Or explain a little more.

Share this post


Link to post
Share on other sites

Read the markers mode section in the wiki article

I've updated the description of this ability of groups mode in the in the groups section to make it more clear, since it was not really clearly explained there (only in the markers section).

Share this post


Link to post
Share on other sites

Thank you very much.

So, if I link a marker to a group, the group will either start where I placed them on map, or where the marker is. Correct?

If this is true there is no need to use the

Round Random 1;

unless I want to put a bunch of individuals in one place or the other... ok

thanks again

Share this post


Link to post
Share on other sites

Will this move the soldier to the marker if _x = 0?

+East soldier's name is e1

+x1 is a marker's name

_mPos = getMarkerPos "x1"

_x = floor random 2

if(_x = 0)

{

e1 setPos(_mPos)

}

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  

×