Jump to content
Sign in to follow this  
heywheresmysnack

Activating a trigger causes a unit to appear

Recommended Posts

Does anyone know the steps for the following setup:

1. Bluefor Spots Opfor trigger activates

2. Trigger causes a helicopter to come and blow up the opfor.

I can not get the trigger to work. I've been trying for almost 5 hours.

---------- Post added at 03:08 AM ---------- Previous post was at 02:24 AM ----------

Someone please help?

Edited by heywheresmysnack

Share this post


Link to post
Share on other sites

Place a trigger, BLUFOR, set it to "Detected by OPFOR". Then have the trigger execute a script that creates a helicopter, and a crew, and flies it to the location.

Share this post


Link to post
Share on other sites

Okay. Yes. I realize that would do what I want... but I don't know how to do what you described... I don't even know where to start. I have gone through the user made guides, but I still can't seem to get it to work.

Share this post


Link to post
Share on other sites

Try this one(It's very simple, but it works....just a copy&paste of a script from me with changed names for better understanding.):

GroupAlpha1 = CreateGroup West;
Helo1 = createVehicle ["AH1Z", [(getMarkerPos "Startingpoint") select 0,(getMarkerPos "Startingpoint") select 1,100], [], 0, "FLY"];
HeliPilot1 = GroupAlpha1 createUnit ["USMC_Soldier_Pilot", [0,0,1], [], 0, "CAN_COLLIDE"];
HeliPilot1 moveInDriver Helo1;
HeliPilot2 = GroupAlpha1 createUnit ["USMC_Soldier_Pilot", [0,0,2], [], 0, "CAN_COLLIDE"];
HeliPilot2 moveInGunner Helo1;
wp12 = GroupAlpha1 addwaypoint [position Targetarea, 0];
wp12 setwaypointtype "SAD";

Example for use:

Now Name the script for example: attackhelo.sqf and put it into your missions folder. Now make a trigger (Blufor spots Opfor, once) in the "Onactivation" put this: [] exec "attackhelo.sqf".

If now an Opfor Unit spots a Bluefor Unit within the triggerzone, then it starts the script. Thats it ;)

HeliPilot1 and HeliPilot2 are the names of the created Pilots(Western Pilots).

Helo1 is the name of the created Helo(AH1Z SuperCobra).

Startingpoint isthe name of the marker, from where the Helo should starting.

Targetarea is the name of an object that you have to place. You can use for example a "(empty) H" - you will find it in the Editor under "empty" > "objects".

But you also can use player. Then it will come to players position.

Example: wp12 = GroupAlpha2 addwaypoint [position player, 0];

Waypointtype in my Code is set to SAD, which means Search and Destroy. Take a look at: http://community.bistudio.com/wiki/setWaypointType

(And also read the rest of the Wiki;))

MrMurray's Editing Guide is excellent for beginners. It's for ArmA 1, but most(if not all(?)) of the things works also in ArmA 2: http://www.mr-murray.de.vu/

Edit: Oops...a typo mistake in the script...fixed :)

Edited by Duke49th

Share this post


Link to post
Share on other sites

If 'Duke49th's good method seems a bit to complicated for you?

Could try another way-although not perfect should do the job.

Create the heli out to sea-set its ability to 'Flying'

Give it 2 waypoints - 1st one directly infront of heli-2nd one on the Opfor.

Create the trigger -'Opfor detected'

Then 'Syncronise' the 1st waypoint to the trigger.

Once trigger is fired the heli will then move on its way to the Opfor.

Share this post


Link to post
Share on other sites
The second way seems much much simpler. I appreciate your help guys.

Your're welcome;)

But keep in mind that, if you have a big mission, full of units, it could cause performance issues.

Better let them spawn and later delete them, than having hundreds of units on the map.

;)

Share this post


Link to post
Share on other sites

Not to mention, they might run out of fuel.

Share this post


Link to post
Share on other sites

Tried the code listed above, can get any vehicle to spawn, but no crew or any people?

Am I missing something here?

Share this post


Link to post
Share on other sites

Place a trigger, BLUFOR, set it to "Detected by OPFOR". Then have the trigger synchronized to a helicopter/unit who is far away, which then comes in under a way point defined by you.

Might be easier, depending on the use. Hell you could put it on a cycle with a dynamic game Logic location for the move way point.

Share this post


Link to post
Share on other sites

Only thing i can think of is make sure the unit/soldier 'class' names are correct?

Im not 100% sure but if they're wrong-i dont think it throws an error now but chucks the error in your Rpt.file?

Share this post


Link to post
Share on other sites

Ok finally got the pilots to spawn, some undetectable error in the text when I copied it. re wrote it manually and it worked.

Only thing it, similar problem with the waypoints, they spawn but go nowhere?

Share this post


Link to post
Share on other sites

this one works nicely, now all i need is a good way to spawn the aircraft at 1100 meters height (i am spawning a MV22 with this script and placing the player inside for a HALO jump) and a way to delete the vehicle a couple of seconds after the player has left the cargo.

Share this post


Link to post
Share on other sites

Thank you for this. Figured out how to get a helo to spawn, fly to a waypoint and load:

groupdustoff = CreateGroup West;
dustoff11 = createVehicle ["RAF_Chin47", [(getMarkerPos "dustoffstart") select 0, (getMarkerPos "dustoffstart") select 1, 10], [], 0, "FLY"];
dustoff11pilot = groupdustoff createUnit ["USMC_Soldier_Pilot",[0,0,10],[],0,"CAN_COLLIDE"];
dustoff11pilot moveInDriver dustoff11;
dustoff11pilot assignAsDriver dustoff11;
dustoff11gunner = groupdustoff createUnit ["USMC_Soldier_Pilot",[0,0,20],[],0,"CAN_COLLIDE"];
dustoff11gunner moveInGunner dustoff11;
dustoff11gunner assignAsGunner dustoff11;
dustoff11medic = groupdustoff createUnit ["USMC_Soldier_Medic",[0,0,30],[],0,"CAN_COLLIDE"];
dustoff11medic moveInCargo dustoff11;
dustoff11medic assignAsCargo dustoff11;
dustoff11wp1 = groupdustoff addWaypoint [position dustoffpad, 0];
dustoff11wp1 setWaypointType "LOAD";
dustoff11wp1 setWaypointSpeed "NORMAL";
dustoff11wp1 setWaypointCombatMode "WHITE";
dustoff11wp1 setWaypointBehaviour "AWARE";
dustoff11wp1 setWaypointStatements ["true", "doStop dustoff11;dustoff11 land ""land"";"];

Thanks

Edited by vaaf_rup

Share this post


Link to post
Share on other sites

Ι usually place and empty helicopter somewhere safe and place a pilot unit near it. I give the pilot a "move" waypoint near the chopper and then another "get in" waypoint on the chopper.

Then I put the another (or many) "move" waypoint which is where I want the chopper to end up (picking me up, attacking something etc).

Then I sync a trigger with the pilot's first "move" waypoint.

That way the game starts and the pilot moves to his first waypoint and waits there until the trigger is activated by me or the enemy depending on your mission. If the trigger is activated the pilot gets in the chopper and flies to the place I want without wasting any fuel.

78201452.th.png

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  

×