Jump to content

Recommended Posts

How does a if <something> then <do someting> else <do something else> end if look like in this editor thing?

Example.

I have a plane in the air to my mission, and if the plane got shoot down, the pilot will eject out.. now if that happend again, I want to make that pilot to join me if I have located him and is near him.. I do that with a trigger with JOIN and so on...

But how can I do with the other stuff... check if plane is shoot down and if the plane is shoot down I can resque this pilot, and if the plane is not shoot down i can do something else... like run a script then to respawn a pilot somewhere else or just skip the pilot thing.

I would like to have that in my objects like this

Object 1: destroy something

Object 2: kill all enemy

Now... if plane is not shot down nothing happens or I create something else.

But if plane craches I would like to get a new mission to resque him.

Object 3: Find and resque the pilot.

So that I need is to create a trigger that can know if plane is heavy damage or not, and then do something...

If plane not broken <do something> else <do something else>

How does that look like? :p

Thanks

Share this post


Link to post
Share on other sites
If plane not broken <do something> else <do something else>

Would be somthing like this:

if (alive plane) then {hint "something"} else {hint "something else"};

or perhaps.

if (canMove plane) then {hint "something"} else {hint "something else"};

Here's a Wiki about the If Statement.:

http://community.bistudio.com/wiki/Control_Structures#if-Statement

Here are some other good resources for scripting:

http://community.bistudio.com/wiki/Category:Scripting_Commands_ArmA2

Share this post


Link to post
Share on other sites

Thanks

---------- Post added at 13:43 ---------- Previous post was at 13:30 ----------

How can I do a trigger to best check this?

I did one one like this

Activation: none | Repeatedly

Type: none

Condition: if (canMove plane) then {hint "something"} else {hint "something else"};

On Act:

Is that good, or how do I make it?

I want to know right the moment the plane is craching

No good at all....

and if I change it to once instead of repeatedly, it would go crasy anyway....

I have like this now.

if (canMove plane1) then {} else {player exec "obj5.sqf"};

obj5.sqf is containing script to give me new mission order.

And after a few seconds I got about 10 new misssion of same kind.

This looks it working

if (canMove plane1) then {} else {player exec "obj5.sqf"; DeleteVehicle checkplane1};

chekcplane1 is the name of the trigger that check if plane1 is movable or not.

Edited by Kiptanoi

Share this post


Link to post
Share on other sites

Activation: None | Repeat
Type: None
Condition: true
OnAct: if (canMove plane) then {hint "something"} else {hint "something else"};

Activation: None | Repeat
Type: None
Condition: canMove plane
OnAct: hint "something"

Activation: None | Repeat
Type: None
Condition: not (canMove plane)
OnAct: hint "something else"

Just a few examples of how it could be done, remember the condition is in itself a if statement, and the then is the on activation.

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  

×