OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting Multiplayer => Topic started by: trooper543 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
-
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:
// 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:
({ ((getPos _x) select 2) < 1 } count thisList) > 0
So that you ignore any aircraft (well, any vehicle not near the ground).
-
@ Spooner
Many thanks for this
-
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.
-
This will run on dedicated servers.
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.
-
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.