Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Sign in to follow this  
Fumbles88

Delete units (have searched)

Recommended Posts

Hi Guys,

I'm getting back into scripting some missions after a long hiatus so as such my skill is back to being rather basic.

I've searched for this particular problem but haven't found anything that has worked for me. In the mission I'm making I have two medics working on two injured people in the background (with animations running on all of them). However once the variable (airsup=true) is in action I'm wanting the units to 'disappear' to give the impression they've been loaded onto the medevac chopper.

I've tried all the different 'deleteVehicle' syntax in my triggers but to no avail; and I'm hoping someone here can help me as I'm at the point of tearing my hair out. The current script I have in the trigger to delete them is as follows -

condition - airsup = true;

on activation -injured1 switchmove ","; medic1 switchmove ","; deleteVehicle Injured1; deleteVehicle medic1;

and the same for the second trigger (only that one replaces the medic1 and injured1 with medic2 and injured2 etc).

If anyone could help me out with this it would be most appreciated.

Many Thanks

Fumbles.

Share this post


Link to post
Share on other sites

first of all "," should be ""

also not sure if its just here but first injured1 is with a - front and small i.

try this:

injured1 switchmove ""; medic1 switchmove ""; deleteVehicle injured1; deleteVehicle medic1;

Edit: also i dont see why you need to switchmove anything since you are deleteing the unit anyway, so this would be enough i believe:

{deleteVehicle _x} foreach [medic1,injured1];

Share this post


Link to post
Share on other sites

Its your condition.

airsup = true is an assignment, not an equality check.

Share this post


Link to post
Share on other sites
first of all "," should be ""

also not sure if its just here but first injured1 is with a - front and small i.

try this:

injured1 switchmove ""; medic1 switchmove ""; deleteVehicle injured1; deleteVehicle medic1;

Edit: also i dont see why you need to switchmove anything since you are deleteing the unit anyway, so this would be enough i believe:

{deleteVehicle _x} foreach [medic1,injured1];

Cheers mate will give that a try, I ended up putting in switch move as when the code wasn't working I wondered if it was a glitch that stopped 'deleteVehicle' from working if an animation was in progress.

Its your condition.

airsup = true is an assignment, not an equality check.

Will also change that - how would I make it an equality check; would it just be a simple task of making it airsup == true?

Once again thanks for your help guys, its much appreciated!

Fumbles.

Share this post


Link to post
Share on other sites
Guest
would it just be a simple task of making it airsup == true?

Yep, that is what he means.

When you use "=" you give something a value.

To check if something is "equal to" you use "=="

Share this post


Link to post
Share on other sites

when it comes to trigger conditions:

airsup == true will not work, use:

airsup

wich means that it is true, !airsup means false, see?

Share this post


Link to post
Share on other sites

Got it working now, had to a bit of jiggling with it but would still be pulling my hair out if it weren't for you guys!

Cheers all round!

Share this post


Link to post
Share on other sites
Sign in to follow this  

×