Jump to content
PCanas

Setup Several Respawns

Recommended Posts

Hello there o/

 

This goes a bit beyond just setting multiple respawn points.

I'm making a mp mission where you have to take a convoy from a FOB to a city. One of the convoy vehicles is a respawn vehicle, and it's supposed ot be the main respawn point. However, if the vehicle gets destroyed, the respawn point will be in the FOB.

Basically, what I want to do is when a player dies he gets to the respawn screen where he can choose between the vehicle and the FOB.

In the FOB there will be an heli that's meant to work as a "taxi". My idea is the heli will be there until someone (blufor) gets in. Then the heli will fly to a specific location in the city, land, wait for players to get out, and then return to FOB. This must, obviously, be repeatable. Also, the AI pilot must ignore every threat, and be as good as possible.

So...

1- How do I set the multiple respawn points? I know how to create a normal respawn point, but how do I make one of them be the convoy vehicle, and how do I make it possible for the player to choose between vehicle and FOB?

2- How do I setup the "taxi"?

 

Thanks for the help :)

 

(mods used: RHS USAF, ACE, ASR AI3)

 

Share this post


Link to post
Share on other sites

The respawn points are markers. You can update its position in a loop:

Not tested:
 

0 = [] spawn {
  while {!isNil "respawn_FOB"} do {
   if (alive myVehicleFOB) then {
      "respawn_FOB" setMarkerPos getPos myVehicleFOB;
    } else {
      "respawn_FOB" getMarkerPos aPosition;
      waitUntil {sleep 2; alive "respawn_FOB};
    };
    sleep 2;
  };
};

 

For helo taxi, you need to make it careless, probably disable damage (or respawnable but it's not immediate to keep the crew/ waypoints), add some waypoints, cycling, add an helipad, invisible or not, add some conditions to be met for completion on FOB and helipad.

The "wait for players" is not so easy to script, depending on waiting for the first player jumping inside helo, or for all players, for blufor players...


 

Share this post


Link to post
Share on other sites

I may be able to make the taxi work. At least I've managed for the heli to take off after 10sec of blufor present in the trigger area. The odd part is the timer only counts if I'm outside the heli, so I have to stand outside and wait for the heli to start it's engines, and then enter the heli. It flies to destination, lands (takes a while...) I'm automatically "kicked" from heli and then it returns to base and lands.

Repeating, however, didn't work...

 

Now, about the script, what parts are variable names I should change, and where should I put them?

Share this post


Link to post
Share on other sites

BLUFOR present count infantry and vehicles, not all units. I mean if some units are in vehicle, the trigger "sees" the vehicle, roughly. 3 infantry on foot + 3 units in a car will return a list of 4 (I don't say it's the thisList result on activation script).

 

Anyway, you don't need any trigger.

Place 2 helipads (invisible or not)  for base and FOB (example).

 

Place your helo (say helo1) onto the first helipad,

Now add waypoints with these scripts:

1st one : a move waypoint very close to the helo, so the completion distance is already OK but add in condition field :

{_x in helo1} count allPlayers > 0

or what you want like {_x in helo1} count units player == count units player

2nd and more if you need path : just classic move waypoints

 

near the 2nd helipad (50 m radius):

 a move waypoint with: vehicle this land "land"  in completion field (not the condition one!)

I know there is a specific "land" advanced waypoint but this simple move + simple script never fail. You can write: vehicle this land "get out"  (in 2 words) if you want the helo doesn't stop the engine.

then a next one, on helipad or near, with script:

{_x in helo1} count allPlayers == 0 in condition field

then path back to base

last but one, near the base: vehicle this land "land"  in completion field

last one : a cycle waypoint between the previous one and the very first one.

 

You see the principle.

 

 

 

 

 

 

 

 

Share this post


Link to post
Share on other sites

Ok, I got the first waypoint, but I'm not understanding exactly what code I have to where after that...

Share this post


Link to post
Share on other sites

What you can't understand?

Just look at the fields of a waypoint in editor.

Condition means "to be true for completion" (+ near position of course). The condition is something like {_x in helo1} count allPlayers > 0... if you named your helo: helo1 of course.

 

Completion means that the code will run when waypoint is completed...

Example: vehicle this land "land"  on the waypoint before (and near) the destination.

 

Roughly. You just have to read the tips, and my post above.

Share this post


Link to post
Share on other sites
9 hours ago, pierremgi said:

What you can't understand?

Just look at the fields of a waypoint in editor.

Condition means "to be true for completion" (+ near position of course). The condition is something like {_x in helo1} count allPlayers > 0... if you named your helo: helo1 of course.

 

Completion means that the code will run when waypoint is completed...

Example: vehicle this land "land"  on the waypoint before (and near) the destination.

 

Roughly. You just have to read the tips, and my post above.

 

That's the part I don't understand.

"Vehicle" is the name of the vehicle?

"This" refers to the waypoint (since you're writting it on the wp)?

" "Land" " (the one with "") is the name of the helipad or whatever location it has to land?

Share this post


Link to post
Share on other sites

So, you ask for learning scripting, and yes each word has sense but it's another topic. vehicle , land  , magic variable this in activation field of an edited trigger.

Share this post


Link to post
Share on other sites

Ok, taxi is working. Thanks :)

 

Now, about the respawn. In the script you posted before

0 = [] spawn {
  while {!isNil "respawn_FOB"} do {
   if (alive myVehicleFOB) then {
      "respawn_FOB" setMarkerPos getPos myVehicleFOB;
    } else {
      "respawn_FOB" getMarkerPos aPosition;
      waitUntil {sleep 2; alive "respawn_FOB};
    };
    sleep 2;
  };
};

"respawnFOB" is the name of the marker?

"meVehicleFOB" is the name of the vehicle?

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

×