-
Content Count
4792 -
Joined
-
Last visited
-
Medals
-
Medals
-
Everything posted by pierremgi
-
Multiplayer Animations
pierremgi replied to Cryptdik's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Yes, it's hard to make that in MP. And I guess there are more than a single problem to obtain what you want! Like you tried, you need to remoteExec a switchMove animation, because the effect is local, then only on player's PC (or server for an AI belonging to a group on server). First test a current animation, something like: if (local player) then {[player,"Acts_InjuredCoughRifle02"] remoteExec ["switchMove",0,true]}; // -2 for dedicated Second, test with your specific animation but I'm not sure the setdamage 1 will not override it (but if ok in SP...) Third, keep on mind the server/clients exchanges. I've been often disappointed with remote execution for some "heavy" sequences and switchmove doesn't help to do it light. There is no error.. but sometimes no animation if too busy. I hope you'll find more constructive help. The topic is interesting. -
Detect if SEA is within an area
pierremgi replied to randy andy tw1's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Here is my 2 cent code. Just choose any position (on any map) and a radius (range) to be dry. MGI_dryCheck = compileFinal " _pos = _this select 0; _posWet = []; _range = _this select 1; _deltaR = _range / 3600; for '_i' from 0 to 3600 step 10 do { _ckPos = _pos getPos [_deltaR*_i,_i]; if (surfaceIsWater _ckPos) exitWith {_posWet = _ckPos} }; _posWet "; MGI_wetCheck = compileFinal " _pos = _this select 0; _posDry = []; _range = _this select 1; _deltaR = _range / 3600; for '_i' from 0 to 3600 step 10 do { _ckPos = _pos getPos [_deltaR*_i,_i]; if !(surfaceIsWater _ckPos) exitWith {_posDry = _ckPos} }; _posDry "; MGI_dryArea = { _pos0 = _this select 0; _range = _this select 1; _pos = _pos0; _cnt = 0; if (surfaceIsWater _pos0) then { _posDry = [_pos,_range] call MGI_wetCheck; while {(_posDry isEqualTo [])} do { _pos = _pos vectorAdd ((_pos vectorFromTo [worldSize/2,worldSize/2,0]) vectorMultiply _range); _posDry = [_pos,_range] call MGI_wetCheck; }; _pos0 = _posDry; _pos = _pos0; }; _posWet = [_pos,_range] call MGI_dryCheck; while {!(_posWet isEqualTo [])} do { _cnt = _cnt + 1; _pos = _pos vectorAdd ((_poswet vectorFromTo _pos) vectorMultiply (_range - (_pos distance _posWet))); _posWet = [_pos,_range] call MGI_dryCheck; if (_cnt == 20) exitWith { _range = _range * 0.66; [_pos0,_range] call MGI_dryArea; }; }; deleteMarker "dry drop"; _mk = createMarker ["dry drop",_pos]; _mk setMarkerShape "ellipse"; _mk setMarkerSize [_range max 50,_range max 50] }; [any position,range] call MGI_dryArea; How it works: first checking if in water or on ground; spiraling for touching any ground if water only, close the ground in direction of the center of the map, for a distance equal to the range you chose; check if any ground by spiraling; .... reaching a ground, check for shore by spiraling, if any shore, move away to opposite direction for range - distance to shore, check if any shore in a 20 round loop, if no more shore, tada, you've got the exact dry area with range radius. if no joy, shrink the radius to 0.66 of the former one and test again. (you are in a tiny island with a too big radius) Performances are not too bad. Hope this help. -
Custom loadout for WEST, EAST......(Help)
pierremgi replied to ROTAHOE's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Place the code in init.sqf to be run in initPlayerLocal.sqf. You can do what you need in initplayerLocal.sqf, so disregard the init field of the unit. On the other hand, if you like to work with the init field of the units, as the code runs on each JIP, you have to wait for the player to be local (on player's PC) and target this player only. In the units init field, write something like: 0 = this spawn { waitUntil {sleep 0.5; isPlayer _this && local _this}; [this] execVM "loadouts\Blu_gear.sqf"}; I repeat you can execVm, directly in initplayerLocal.sqf, instead. -
Yep, I did that for radio backpack :
-
mp give control of a unit to player
pierremgi replied to dlegion's topic in ARMA 3 - MISSION EDITING & SCRIPTING
If (!local _object && !(_object isKindOf "CAManBase")) then {...}; -
Detect if SEA is within an area
pierremgi replied to randy andy tw1's topic in ARMA 3 - MISSION EDITING & SCRIPTING
surfaceIsWater someposition; -
Trying to get a position on higher gound near a objectiv
pierremgi replied to FederalRazer89's topic in ARMA 3 - MISSION EDITING & SCRIPTING
See below. -
Teleport players into vehicle
pierremgi replied to Luckyas's topic in ARMA 3 - MISSION EDITING & SCRIPTING
That's not what intended. allPlayers depends on the moment you run the code and doesn't make difference between JIP and already playing guys! -
MP/PVP - Only one side is allowed to respawn
pierremgi replied to allnamesaretakendammit's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Please, you are in a specific case you don't want to trigger anything! So, don't garble the message with your science! For 99.999 % usage of a trigger, you can hint on each frame the thisList result and see what occurs. When fired, thisList is updated within the 0.5 sec slot, the reason why you can have 2 or 3 units in this array, if very close in case of presence check. For sure, a trigger check every 0.5 sec. But, when fired, when thisList takes sense, there is no way to update it without rearming (deactivate) the repeatable trigger. -
Detect if SEA is within an area
pierremgi replied to randy andy tw1's topic in ARMA 3 - MISSION EDITING & SCRIPTING
On my mind, it's already included in the 5th parameter of the BIS_fnc_findSafePos ! -
Only on Unsung?
-
You can run the code where you want. if you use local variable such as _tsk1, don't forget to spawn it : 0 = [] spawn {...} , like in a trigger for example. And yes, Here is a main script, creating a task (assigned or created), then waiting for its status changed (succeeded), from another script, to be continued. The fact is I did another script to trigger some conditions of success (someMission.sqf). it was just an example that you can run in 2 different scripts what concern the task state. First script: - create task1; - spawn someMission.sqf; // or any name you want - do what you want; - waituntil success of task1; - create another task (for example); .... second script (someMission) - do what you want; - waitUntil some condition are met (triggerActivated or else); - set task1 successful PS: I'm passing "Task1" as argument for execVM the script someMission.sqf. In fact, I didn't test that, you could run the script without argument as far as the task ID "task1" seems to be global (defined for any script on your PC). One sure thing: the "return value or handle" _tsk1 doesn't do the job for setTaskState, even if passed as argument.
-
Teleport players into vehicle
pierremgi replied to Luckyas's topic in ARMA 3 - MISSION EDITING & SCRIPTING
You don't need to multiply network exchange: { _x spawn { _plyr = _this; waitUntil {isplayer _plyr}; _plyr moveincargo unit1 } } forEach playableUnits; -
Adding weapon to crate with specific attachments
pierremgi replied to chronicsilence's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Why is it impossible to declare it in description.ext? -
Dialog but Admin only
pierremgi replied to 1para{god-father}'s topic in ARMA 3 - MISSION EDITING & SCRIPTING
Even the BI command admin coming soon! -
Don't mix modules and script methods. The tasks Id are too much hard to make them work in this condition. If you place a task module then add settaskstate module also. The triggers are not a real problem edited or scripted (triggerActivated myTrigger...). What I'm using for tasks scripts in MP: _tsk1 = ["task1", true, ["description here","title here",""], getMarkerPos myMarker, "ASSIGNED", 1, true, true,"attack",true] call BIS_fnc_setTask; "tsk1" execVM "someMission.sqf"; ......................... Passing "tsk1" in someMission.sqf script // NOT _tsk1!............................... _tsk = _this; bla bla condition [_tsk,"Succeeded",true] call BIS_fnc_taskSetState; .................................................................................................................................. //1st script to be continued: waitUntil {sleep 0.5; ([_tsk1] call BIS_fnc_taskState) == "Succeeded"}; // _tsk1 here! .................. Anyway, I do prefer bis_fnc_setTask rather than bis_fnc_taskCreate.
-
Variable not appearing in hint
pierremgi replied to daniel1060's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Probably because atm.sqf runs before the game starts (Time>0) or before cash is public. Try a waitUntil {time > 2} in this sqf. -
Syntax seperation help
pierremgi replied to DieselJC's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Personally, I use createLocation. Something like: _location1 = createLocation ["nameLocal", [8200,3850,0], 400, 400]; .... -
Did you link all players to this task?
-
Damage hull and engine after x roadkills
pierremgi replied to Goro's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Yep, my opinion is slightly different. As some people can push their working/complete scripts here, and it's a good idea, there is no reason to avoid some topics even if no clue to start. I like the challenges. And I just skip the topics without answer or interest for me. This topic is clear and seems to me interesting. I attempted to use EH "epeContactStart", which could be smart, but that doesn't work on non physX object (like man). That works with contact on vehicles like cars. So, here is not a perfect script, but a track to what you intend to do: {_x addEventHandler ["killed", { _victim = _this select 0; _killer = _this select 1; if (!isnull objectParent _killer && _victim distanceSqr _killer < 25) then { _dam = vehicle _killer getHitPointDamage "hitHull"; vehicle _killer setHitPointDamage ["hitHull",_dam + 0.3] }; }] } forEach allUnits; Spawned units are not taken into account here. -
The reason why i don't buy Jet DLC is the poor attention BI paid for stick parameters, in general. The minimum would have been the 0 to 1 throttle and separate air brakes instead of this weird -1 +1 setting. Not mentioning afterburners.
-
How to create an objective in arma 3 editor
pierremgi replied to Durcaz's topic in ARMA 3 - TROUBLESHOOTING
You just have to place a task module (F5). Choose Intel, create task , then a task ID (not useful if you don't call it in a script, a title, a description, type... just read the tips; synchronize with player(s); add a trigger, optional, to add this task in game and not at start; add a trigger for success, with a condition like: !alive myenemy, sync it to a task state module "succeeded", and sync this module to the task one. You can also add some briefs through diary record module. Read the tips. -
Sliding Gate Script help?!?!?!?
pierremgi replied to natanbrody's topic in ARMA 3 - MISSION EDITING & SCRIPTING
With a land_barGate_F, (named bar1 for example) place a repeatable presence trigger with: onActivation: bar1 animateSource ["Door_1_source", 1]; onDeactivation: bar1 animateSource ["Door_1_source", 0]; -
Weapon Pool duplicates itself in campaign progress
pierremgi replied to Undeceived's topic in ARMA 3 - MISSION EDITING & SCRIPTING
disregard. answer done when not updated. -
Detect name of player and select the box
pierremgi replied to bullkanox's topic in ARMA 3 - MISSION EDITING & SCRIPTING
You are in multiplayer and you want to work on a cash variable and some equipment for the player. So, just work in the initPlayerLocal.sqf which is a specific script (add it into the mission root if not already present). With this script, cash and equipment will concern the player only. To "couple" a box with a player: - you can spawn the box in this initPlayerLocal.sqf. So the box is identified locally and you just have to fill this box. There is nothing more to do; - or place in advance as much boxes as playable units, name them box1, box2... and add them as a variable attached to the player: * in init field of playable units: this setVariable ["mybox",box1]; (and so on...) * in initPlayerLocal: _myBox = player getVariable "mybox"; // now you refer to the right box.

