Ajira
Member-
Content Count
27 -
Joined
-
Last visited
-
Medals
Community Reputation
10 GoodAbout Ajira
-
Rank
Private First Class
-
waitUntil {!alive _this}; not working on vehicles ?
Ajira replied to Ajira's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
sweet, thanks man :D -
"addPublicVariableEventHandler" not working in multiplayer ?
Ajira replied to Ajira's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Nevermind that last question.. i've made a very nice/workable solution :) In the server "loop": while {NewTargetName == _OldTargetName} do { _random = round(random(7) +1); NewTargetName = "CombatZone" + (format ["%1", _random]); }; _message = format ["Enemy forces have been sighted in %1.", (_villages select _random)]; ServerMessage = [_message, "taskNew"]; publicVariable "ServerMessage"; and then in the player init: waitUntil {alive player}; // Update the current target. "NewTargetName" addPublicVariableEventHandler { "CombatZoneMarker" setMarkerPos (getPos CombatzoneTrigger); }; "ServerMessage" addPublicVariableEventHandler { taskHint [(ServerMessage select 0), [1, 1, 1, 1], (ServerMessage select 1)]; }; //- Works like a charm, thanks for the tip guys :D -
"addPublicVariableEventHandler" not working in multiplayer ?
Ajira replied to Ajira's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
but won't that spam the sideChat bigtime if there's 32 players ? or is it shown only for the current player ? -
Make A City/Town Ruined/Destroyed At Mission Start?
Ajira replied to Rg's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Why not just do a simple {_x setdamage 1;} foreach nearestObjects [_object, [], 500]; where _object is just a random unit you spawned in the middle of town... this destroys everything in sight in a 500m radius. Houses, vehicles, trees, everything is leveled. -
"addPublicVariableEventHandler" not working in multiplayer ?
Ajira replied to Ajira's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
can you be more specific ? you mean making the marker do the sideChat ? -
waitUntil {!alive _this}; not working on vehicles ?
Ajira replied to Ajira's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
ah you mean make the trigger say it and then spawn the vehicle ? hmm... -
"addPublicVariableEventHandler" not working in multiplayer ?
Ajira replied to Ajira's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
using the " " with the publicVariable solved the problem! Thanks dengibtscchon :D ---------- Post added at 11:34 ---------- Previous post was at 10:43 ---------- hmm.. now just need to figure out how to broadcast the [West,"HQ"] sideChat "New area selected."; to all players. any ideas guys ? :confused: -
waitUntil {!alive _this}; not working on vehicles ?
Ajira replied to Ajira's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
hmm.. i prefer to use an SQF for the init, because we want to put in access control as well later on (e.g. only pilots can enter a plane, etc ) -
waitUntil {!alive _this}; not working on vehicles ?
Ajira replied to Ajira's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Yes, but i forgot to post it on the forum. by the way, if i use this in MP on a dedicated server: _unit = format ["%1", _this]; [West,"HQ"] sideChat _unit + " is now available on base."; it gives a load of crap like like "#<number> <number> AV8B.P3D is now available on base." :confused: -
"addPublicVariableEventHandler" not working in multiplayer ?
Ajira replied to Ajira's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I think i found it.. but not sure.. will have to test in the morning.. CombatZoneTrigger setPos (getMarkerPos NewTargetName); -vs- CombatZoneTrigger setPos (getMarkerPos "NewTargetName"); -
waitUntil {!alive _this}; not working on vehicles ?
Ajira replied to Ajira's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Yeah, that gives the name of the vehicle, but not the description/vehicleVarName.. it's different :( -
Ok here's the problem... on init.sqf i check if it's the server or a player that's running it. If it's a server, it starts the following loop: while {true} do { if (AreaCleared) then { while {NewTargetName == _OldTargetName} do { NewTargetName = "CombatZone" + str(ceil(random 32)); }; _OldTargetName = NewTargetName; "CombatZoneMarker" setMarkerPos (getMarkerPos NewTargetName); CombatZoneTrigger setPos (getMarkerPos NewTargetName); [West,"HQ"] sideChat "New area selected."; // Do stuff, spawn russians, etc.. } publicVariable NewTargetName; sleep 10; }; This works.. a russian spawns at the marker.. if i kill it, 10 seconds later a russian spawns on another random marker. So... the trigger is moved, and the marker is also moved. if it's a player that's running the init.sqf it runs the following code: waitUntil {alive player}; "NewTargetName" addPublicVariableEventHandler { "CombatZone" setMarkerPos (getPos CombatzoneTrigger); }; while {true} do { player setVehicleInit "_return = this execVM ""scripts\player_init.sqf"""; processInitCommands; waitUntil {!alive player}; hint "you died... sucks to be you, man... "; }; This works fine in the editor, but it doesn't do jack shizzle in multiplayer. The russian guy spawns, but the marker on the map stays rock solid on the old location. For some reason it doesn't see that the variable NewTargetName changed, and so it doesn't move the marker for the user. first of all, i thought markers were for all users, not per user ? So how come it works for player1 ( unit is "player" ), but not for player 2,3,4,5,6, etc (unit is "playable" ) ? And how come it works for player1, untill he disconnects and then reconnects ? it doesn't work anymore after that. Any ideas guys ? :confused:
-
Any way to find the ACTIVE players ?
Ajira replied to Ajira's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Super, thanks guys :D -
waitUntil {!alive _this}; not working on vehicles ?
Ajira replied to Ajira's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
funny how "vehicleVarName" always returns empty in MP... anybody got an idea how to get that to show ? -
waitUntil {!alive _this}; not working on vehicles ?
Ajira replied to Ajira's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
*facepalm* :banghead: nevermind, fixed.. thanks :blush: Been staring at the init script for so long, not thinking about the actual spawn script, hehe :p