I'm comfortable with scripting for single player...but multiplayer is a whole new ball game!
I'm working on a MP mission for my mates at DAGR, and basically am desperately trying to get addAction to work!
Two things I'm trying to do:
1. Have a hostage rescue scenario with a little hidden nasty IED surprise sitting behind him.
I have this in the POW's init:
And this in the IED's init:Code:0 = [this] execVM "pow.sqf";
The pow.sqf:Code:0 = [this] execVM "disarm.sqf";
The pow1.sqf:Code:private ["_pow"]; _pow = _this select 0; //Dedicated has no players to perform the action; that is, don't bother having dedi server run this if (!isServer) exitWith{}; _pow addAction ["Rescue the Hostage","pow1.sqf"];
the disarm.sqf:Code:if (!isServer) exitWith{}; _pow = _this select 0; _caller = _this select 1; _id = _this select 2; _pow removeAction _id; if (_free) then { _pow enableAI "MOVE"; _pow enableAI "ANIM"; //_pow switchmove ""; [_pow] joinsilent (group _caller); } else { _IED="R_PG7V_AT" createVehicle [2114.48,1879.38,0.243683]; };
the disarm1.sqf:Code:private ["_bomb"]; _bomb = _this select 0; //Dedicated has no players to perform the action; that is, don't bother having dedi server run this if (!isServer) exitWith{}; _bomb addAction ["Disarm the IED","disarm1.sqf"];
And of course this line in my init.sqf:Code:if (!isServer) exitWith{}; _bomb = _this select 0; _free = TRUE; sleep 1; hint "Bomb has been disarmed."
So far nothing happens when I try to rescue the hostage with or without disarming the IED. He just sits there, and if I don't disarm the IED nothing explodes. I got this to work fine in SP without using all of these fancy schamcy variables and all that.Code:private ["_free"]; _free = FALSE;
Also, is there any way to condense these scripts into just one or two, rather than four. I'm still trying to wrap my mind around how MP works, so please bear with me, but I've been at this for weeks :/
2. Next I have a number of maps, notebooks, satellite phones, etc. strewn throughout the AO for my team to locate and collect. Collecting the intel will then display markers on a map for everyone to find. I haven't fooled with these yet as I'm still just trying to get the hostage rescue/IED scripts to work. But this is what I have so far for one of the intel pieces:
the intel's init:
Note* I know I have to make a public variable and all that and can't just put in the addaction into the item's init, but like I said I haven't fooled with this yet, but would still like some help on it.Code:this addAction ["Collect Intel","intel0.sqf"];
intel0.sqf:
Code:if (!isServer) exitWith{}; _rep = _this select 0; _caller = _this select 1; _id = _this select 2; _rep removeAction _id; deleteMarker "obja"; hint "OPFOR markers have been added to your map."; _marker1 = createMarker ["redbush", getMarkerPos "ambush"]; "redbush" setMarkerShape "ICON"; "redbush" setMarkerType "mil_ambush"; "redbush" setMarkerColor "ColorRed"; "redbush" setMarkerText "засада"; "redbush" setMarkerDir 270; _marker2 = createMarker ["redwep", getMarkerPos "weapons"]; "redwep" setMarkerShape "ICON"; "redwep" setMarkerType "hd_dot"; "redwep" setMarkerColor "ColorRed"; "redwep" setMarkerText "тайник с оружием"; _marker3 = createMarker ["redhouse", getMarkerPos "safehouse"]; "redhouse" setMarkerShape "ICON"; "redhouse" setMarkerType "hd_flag"; "redhouse" setMarkerColor "ColorRed"; "redhouse" setMarkerText "безопасный дом"; _marker4 = createMarker ["redpow", getMarkerPos "pow"]; "redpow" setMarkerShape "ICON"; "redpow" setMarkerType "hd_objective"; "redpow" setMarkerColor "ColorRed"; "redpow" setMarkerText "заключенный";
Thanks in advance.
HOME 
Reply With Quote
