Jump to content
Sign in to follow this  
DecimusAquila

Sytax condition problem...

Recommended Posts

My issue is...

say for example; 2 heli's flying to drop point. heli 1 and heli 2. Player is in heli 2

Say I want heli 1 to land first, then once it heli 1 lands, heli 2 begins landing too.

what syntax to the condition can I use?

..........................................................

NOTE

I know I can use a syntax command for condition for the units in heli 1 to come out of heli 1 first before heli 2 lands with...

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">NOT (unit1 in heli1) AND NOT ...so on.

I really donot want to do it this way, I want heli 1 to touch down first then heli 2 lands. Is there a command condition for this?

Share this post


Link to post
Share on other sites

Salve,

if I understand your requirement correct (first Heli1 touches down, then Heli2 starts descending) then you might as well just check for the height of Heli1.

I do this in one of my scripts because the Heli AI is a mystery to me sometimes; even when scripted the AI seems to be driven by a lot of AI code still (shifting landing zones, ignoring some commands).

So what I would do is simply something like this:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">@(position heli1 select 2 < 5)

That way the script really only continues when Heli1 almost is at touchdown. That ensure synchronicity of events at least.

Victor

Share this post


Link to post
Share on other sites

Thankyou for your reply...

Yes you got my issue right. Though, could you explain what the figures stand out for...2 < 5,

then I can work it out from there with your command. Thankyou.

Share this post


Link to post
Share on other sites

Sure,

position heli1 select 0 = x position of heli1 on map

position heli1 select 1 = y position of heli1 on map

position heli1 select 2 = z position of heli1 on map (current height)

position heli1 select 2 < 5 = current height of Heli1 is smaller than 5 (meters)

Regards,

Victor

Share this post


Link to post
Share on other sites
Sure,

position heli1 select 0 = x position of heli1 on map

position heli1 select 1 = y position of heli1 on map

position heli1 select 2 = z position of heli1 on map (current height)

position heli1 select 2 < 5 = current height of Heli1 is smaller than 5 (meters)

Regards,

Victor

You should always use parantheses in those sitations so the game doesn't accidentally see the end as 2 < 5. Make sure the game knows the entire (getpos heli1 select 2) is being evaluated.

Share this post


Link to post
Share on other sites

In this particular case I have to disagree. Using parentheses can be very useful to avoid mistakes, true. But SELECT is a known statement to the parser so he will evaluate the complete expression first and only then look at further operators. It's a proven concept by the way, used it a lot already.

Victor

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  

×