Home   Help Search Login Register  

Author Topic: MP Multiple Respawn & Trigger help (SOLVED)  (Read 3483 times)

0 Members and 1 Guest are viewing this topic.

Offline trooper543

  • Members
  • *
MP Multiple Respawn & Trigger help (SOLVED)
« on: 23 Jan 2009, 22:08:44 »
Hi there all

What i am trying to do for a CoOp Mission is have a respawn for each player group for each of sides

this what i have so far

Respawn_West_1 is for team 1
Respawn_West_2 is for team 2
Respawn_West_3 is for team 3
Respawn_West_4 is for team 4


Respawn_East_1 is for team 1
Respawn_East_2 is for team 2
Respawn_East_3 is for team 3 

How do i allocate these Respawn Points to each team ?

In my description

i have

respawn= 3
respawndelay = 6

The second part of this question is how do i prevent a trigger from being activated by an player aircraft as this cause massive desync when playing on line as the triggers are used to spawn enemy

Many thanks in advance for any help

thanks
cheers
« Last Edit: 24 Jan 2009, 22:02:59 by trooper543 »

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: MP Multiple Respawn & Trigger help
« Reply #1 on: 24 Jan 2009, 01:40:11 »
You can't directly give groups individual respawns. Give them regular base respawn (respawn = "BASE") (and put the base respawn marker somewhere away from the action, where they will flicker in for an instant), then move them immediately to the correct respawn point, once they spawn in:
Code: (group_base_respawn.sqf) [Select]
// Run from init.sqf with:
//  [] execVM "group_base_respawn.sqf"
if (isServer and isNull player) exitWith {}; // Don't run on dedicated.

waitUntil { alive player };

player addEventHandler ["KILLED",
{
  [] spawn
  {
    waitUntil { alive player };

    // Chose a respawn point, based on group name.
    // Might need to change the names, of course, based on your mission.
    _marker = switch (str group player) do
    {
       case "WEST 1-1-A": { "Respawn_West_1" };
       case "WEST 1-1-B": { "Respawn_West_2" };
       case "EAST 1-1-B": { "Respawn_East_1" };
       // etc.
    };

    player setPos (getMarkerPos _marker);
  };
}];

For your triggers problem, just make the trigger condition something like this:
Code: [Select]
({ ((getPos _x) select 2) < 1 } count thisList) > 0
So that you ignore any aircraft (well, any vehicle not near the ground).
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline trooper543

  • Members
  • *
Re: MP Multiple Respawn & Trigger help
« Reply #2 on: 24 Jan 2009, 03:03:41 »
@ Spooner

Many thanks for this

Offline Shadow.D.

  • Members
  • *
Re: MP Multiple Respawn & Trigger help (SOLVED)
« Reply #3 on: 14 Feb 2009, 21:57:39 »
Hey Spooner, is there anyway to get this working on a dedicated server?  It is just what i'm looking for but need it to work on a dedicated.

Thanks in advance for any help.

Offline Rommel92

  • Members
  • *
Re: MP Multiple Respawn & Trigger help (SOLVED)
« Reply #4 on: 14 Feb 2009, 22:57:19 »
This will run on dedicated servers.
Code: [Select]
if (isServer and isNull player) exitWith {}; // Don't run on dedicated.

//isServer : Execution Local to Server
//isNull player: Is Player Null (on Servers, players are Null)

The code must run local to the player, and not local to the dedicated server. So the code will always run on the player side, however will not run (useless if it did) on the dedicated server.

Hope that helps.

Offline Shadow.D. ^BOB^

  • Members
  • *
Re: MP Multiple Respawn & Trigger help (SOLVED)
« Reply #5 on: 15 Feb 2009, 00:26:17 »
Ah, the problem i was having was related to the unit name.  I am running it on a map with AI Disabled, with the squad leader not present the group was not named correctly.  I have named the group in each unit's init field and all seems good.

Thanks for the reply.