Jump to content
Sign in to follow this  
tequnique

Creating waypoints

Recommended Posts

Hello everybody!

I have a question that I am very eager to have answered by you script fanatics out there....

Situation:

I want to run two Forward OP ( Alpha OP and Bravo OP) with a standby Infantry Platoon back at the barracks waiting to reinforce the front lines transported by a Truck (ran by a dedicated driver).

Once the Either Alpha OP or Bravo OP spots enemy activity in their sector they will call for reinforcements which will head for the one in contact >>> Deploy their forces in a safe distance from the contact then do a search and destroy in the area for about 600 seconds... >>> return to the truck >>> and then return to base >>> and reset.

I had in mind to do something like this:

1) Attach a trigger to the group leader and set it to "guarded by" (in lack of better ideas)

2) Set the drivers of reinf vehciles to a guard waypoint

3) Attach a trigger to reaction force to disembark if enemy is in it and spawn a search and destroy waypoint their attached trigger (to start hunting enemy)

4) Set a base marker for the transport to return to

5) When force has disembarked - order the vehicle to RTB

6) Set a timer for the S&D waypoint to 600 - then activate a call for transport

7) After picking up the Reaction force - they return to base and the scripts resets.

QUESTION:

How would you guys script this or do this?

DO you have any similar scripts?

Thank you for your answer!

Share this post


Link to post
Share on other sites

Attaching trigger named trg1 to _unit (this most likely only needs to run on the server, but it depends on what the trigger actually does):

while {condition} do
{
  trg1 setPos getPos _unit;
  sleep .01;
};

This will move the trigger every frame to the position of _unit. This will not run every 0.01 seconds, as once a sleep is activated the game will only check if that script needs to continue running once every frame, so it should not "overload" anything.

For waypoint manipulation see thses commands: http://community.bistudio.com/wiki/Category:Command_Group:_Waypoints

Namely addWaypoint, setCurrentWaypoint, deleteWaypoint and setWPPos.

One thing to note is that if you setWPPos on a group's current waypoint it will not necessarily take effect - You will also have to setCurrentWaypoint to a different one and then set it back to the one you moved for the new waypoint position to become effective.

Share this post


Link to post
Share on other sites

Thank you very much for your answer here...

I will play around with this, then come back with some feedback :)

Share this post


Link to post
Share on other sites

I'm trying to do a similar thing.

Right now I'm in the final stages of designing another mission for ArmA 2, and I want to add the following feature, but don't know how.

Two of the objectives that the players have to complete is the destruction of two objects, let's call them Object1 and Object2. I have already managed to do this. But I want two things to happen when the players complete (blow up) either one of those objectives:

1.) The sound of an alarm to go off (not too long, about 30 seconds should be enough).

2.) A squad of about 8 Russian soldiers to run to a certain waypoint or marker, near where the explosion was. In other words they check out the noise and engage the players if they see them.

These two actions have to trigger only once. So if the players blow up Object 1 or 2 and one minute later blow up the other Object, the actions are not allowed to repeat.

FYI: this is how it currently detects the destruction of Object1:

A trigger with the following Condition:

!alive object1;

On Activation:

nul = execVM "tsk_object1_completed.sqf"; hint "Object one destroyed!";

And another trigger for Object2, with the same condition and activation (except this time it links to object2 of course).

TBH the object and tasks aren't called like that in the mission, but I don't want to post any spoilers. ;)

Does anyone know how I can do this?

Thanks!

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  

×