OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting Multiplayer => Topic started by: sinchi runa on 19 Apr 2008, 19:46:59
-
greetings,
i have been digging through the archives, yet there seems to be no real answer as to how to keep addactions after respawns in MP.
example.. mando has spent so much time on missile and bomb scripts that look and work great... yet you get killed in game once and the console is gone for the rest of the game... :dunno: how do the support menus in evolution keep showing back up?.. is it the same in principle?
so what i am looking for at the moment is this:
i would like to add the mando air support console to evolution or domination type maps.. (i know it is harder than just making a new map.. but not as fun.)
i have been able to use triggers or the like to re-add the addaction.. but it adds it to everybody else's.. and if several are respawning and some haven't died.. they find 100 air support addaction in their menu..
thank you
-
of course it depends on respawn type, but for automatic stock ArmA respawns this should be enough:
// respawnable unit
_unit = _this select 0;
while {true} do
{
waitUntil {alive _unit};
// Addwhatever needed here
waitUntil {!alive _unit};
};
Many missions dont use respaws at all, but they are dynamically creating new units when others die. For these cases the setup code of any menu action, etc should be placed there where the unit is created (as in mando air war 3).
-
thanks for the reply,
where does that code go? in it own sqs or sqf file.. or in the init.sqf?
also here:
waitUntil {alive _unit};
// Addwhatever needed here
i would make it look as so?
// respawnable unit
_unit = _this select 0;
while {true} do
{
waitUntil {alive _unit};
player addAction ["Air Support console", "mando_airsupportdlg.sqf"];
waitUntil {!alive _unit};
};
-
Well, which criteria do you use to assing the console? unit name? rank? unit type?
From a BIS thread about the console, who has a Laser Designator, has the console. This might be a good criteria:
// Add to your init.sqf
[] spawn
{
private["_acidx1", "_acidx2", "_unit", "_veh"];
_acidx1 = -1;
_acidx2 = -1;
while {true} do
{
waitUntil {("Laserdesignator" in weapons player) && (alive player)};
_acidx1 = player addAction ["Console: Air support", "mando_airsupportdlg.sqf"];
while {("Laserdesignator" in weapons player) && (alive player)} do
{
_unit = player;
if (vehicle _unit != _unit) then
{
_veh = vehicle _unit;
_acidx2 = vehicle _unit addAction ["Console: Air support", "mando_airsupportdlg.sqf"];
waitUntil {(vehicle _unit == _unit) || (!alive _unit)};
_veh removeAction _acidx2;
};
Sleep 1;
};
_unit removeAction _acidx1;
};
};
-
WOW!! perfect.. and the linking it to the laser designator was a great idea.. thank you very much!