Jump to content
Sign in to follow this  
Little Blue Assassin

Get out of the vehicle, now!

Recommended Posts

I am attempting to make it so that if the player gets within a certain radius of a certain enemy tank, the enemy crew must all get out.  Now, most of this is easy.  I made the player, the tank, and the two crewmen, and gave everybody names.  I then placed the two crewmen in the tank using the "moveindriver" and "moveingunner" commands.  Then I made the trigger.  I set it to "activated by West" and put this in the "on activation" line:

crewmanone action ["eject", vehicle crewmanone]; crewmantwo action ["eject", vehicle crewmantwo]

This works.  The problem is that the tank must move, and the trigger won't move.  Thus the only way to activate the trigger is to go to the place on the map where the tank started out.  This is stupid.  Is there some way you can attach a trigger to a vehicle?

Share this post


Link to post
Share on other sites

use the distance command to fire the trigger whereever the tank is.

Check the comref on the syntax.

Share this post


Link to post
Share on other sites

Create a trigger with a zero/zero axis.

Condition: player distance vehicle crewmanone < xx

onActivation: crewmanone action ["eject", vehicle crewmanone]; crewmantwo action ["eject", vehicle crewmantwo]

:note - replace xx with the distance in meters you want

~S~ CD

Share this post


Link to post
Share on other sites

Ah!  Thank you very much, that is exactly what I was looking for.

Now on a somewhat related note, I am trying to delete a helicopter in the air when it reaches the edge of the map.  This works, but the pilots both fall to their deaths, and I want them to be deleted instead so that it does not affect my rating.  Now, I tried making an empty helicopter and two pilots with names (so that I could delete them seperately with a different trigger) and then placing the pilots in the helicopter, but one of the helicopter's waypoints before the deletion involves the "transport unload" command, and it will only work if the helicopter is created as a manned unit (I mean, it can't piloted by two guys placed inside using the "moveindriver" command as I tried to do).  And you can't name the drivers or pilots of a unit that is created manned (as far as I know).

What I am trying to do now is create a trigger that will affect all units within its radius, but I have searched both this forum and the command reference for a long time and I cannot find any "all units within this trigger's radius" command, or anything like it.  Please help.

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Little Blue Assassin @ Feb. 06 2003,06:44)</td></tr><tr><td id="QUOTE">Now on a somewhat related note, I am trying to delete a helicopter in the air when it reaches the edge of the map.  This works, but the pilots both fall to their deaths, and I want them to be deleted instead so that it does not affect my rating.  Now, I tried making an empty helicopter and two pilots with names (so that I could delete them seperately with a different trigger) and then placing the pilots in the helicopter, but one of the helicopter's waypoints before the deletion involves the "transport unload" command, and it will only work if the helicopter is created as a manned unit (I mean, it can't piloted by two guys placed inside using the "moveindriver" command as I tried to do).  And you can't name the drivers or pilots of a unit that is created manned (as far as I know).

What I am trying to do now is create a trigger that will affect all units within its radius, but I have searched both this forum and the command reference for a long time and I cannot find any "all units within this trigger's radius" command, or anything like it.  Please help.<span id='postcolor'>

a.

deleteVehicle (driver my_chopper)

deleteVehicle (gunner my_chopper)

create the trigger, set to activated by "anybody" (or everyone or whatever it is smile.gif )

ok: in "on activation" put "_x doThis thing" forEach thisList

but change the code within the "" to what you want it to be (if you use v. 1.90+ you can use {} instead of "" which is better smile.gif )

e.g. you want anyoine within the triggers radius to be deleted:

on activation: "deleteVehicle _x" forEach thisList

if you want to do some things, then it might get tricky: e.g. you want everyone to salute once when they get within a certain distance...if you used (on activation: {_x stop true;_x playMove "effectStandSalute";~2;_x playMove "effectStandSaluteEnd";_x stop false} forEach thisList) then any person within the trigger would constantly be saluting...so you'd have to come up with a workaround for it (probably using a script)

If you encounter any more problems just post again smile.gif

Share this post


Link to post
Share on other sites

Yeah Liquid Silence is right here,

just one more thing to prevent you from troubles in future:

Never use a waypoint of the unit/or group itself to execute

the deleteVehicle command, or the game will crash.

~S~ CD

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  

×