-
Content Count
7443 -
Joined
-
Last visited
-
Medals
-
Medals
Everything posted by pierremgi
-
BIS_fnc_ambientAnim issues
pierremgi replied to Delusional1's topic in ARMA 3 - MISSION EDITING & SCRIPTING
if (local _object) then { [_object, _animation, _equipment, _snapToObj] call BIS_fnc_ambientAnim; } is the right way. This function uses AL EG commands. Perhaps you should delay a little bit the anim at start. You have also another newer function anim created for Expeditionary forces DLC (if all payers have this DLC). Not tested- 1 reply
-
- animations
- bis_fnc_ambientanim
-
(and 2 more)
Tagged with:
-
Because it was hard to understand why you parameter _spwnDelayMethods with zero by default then check if an array. Anyway, both are possible. See params params ["_side", ["_spwnsInfo", [[], ""]], ["_grpClasses", []], ["_form", ""], ["_behavior", ""], ["_destsInfo", ["", ""]], ["_spwnDelayMethods", 0,[0,[]]]; Anyway, two possible tracks: - what happens if you name a trigger this_trigger_doesnt_exist ? (or any existing trigger?) - did you check for ghost extra character? (they can be visible if you encode your code in ANSI for example (instead of UTF-8) There are plenty of ghost characters when copying/pasting code. Example: Same for other scripts. That said, I didn't find any error, in rpt file or screen, testing parts of your code, after removing these ghost characters.
-
["_spwnDelayMethods", 0] as parameter in fn_CSWR_globalFunctions.sqf ? why a number if you check an array: if ( typeName _spwnDelayMethods isEqualTo "ARRAY" )... in fn_CSWR_globalFunctions.sqf? Note : if (_spwnDelayMethods isEqualType [] ) ... is faster.
-
For player, not in a vehicle: player addEventHandler ["SoundPlayed", { params ["_unit", "_soundID"]; if (_soundID == 8) then {_unit setOxygenRemaining 1}; }];
- 10 replies
-
- 2
-
_spwnDelayMethods = [this_trigger_doesnt_exist]; { if ( !isNil "_x" ) exitWith {hint format ["%1 is a trigger",_x]}; systemChat "still not a trigger"; } forEach _spwnDelayMethods; works without throwing error, even if no trigger at all. Are you sure you don't have any other part of code invoking _x ?
-
missing command for switch seats of crew
pierremgi replied to h4wek's topic in ARMA 3 - ADDONS - CONFIGS & SCRIPTING
Did you try the "moveTo..." actions? https://community.bistudio.com/wiki/Arma_3:_Actions#MoveToCargo and others. -
Spawned vehicle not visible for other players in MP?
pierremgi replied to dlder's topic in ARMA 3 - ADDONS - CONFIGS & SCRIPTING
If you host and play your own scenario, add the code in init.sqf file or even in init field of any objects (all these init fields are running locally at every start). If not, you must have access to the console (esc menu) , copy/paste the code and run it everywhere. If not, only a mod can work. -
mgi scripts Player(s) can decide when a task is done!
pierremgi posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hi all, Just a little way about how you can achieve a task (succeeded) when you decide it. The Arma task framework is fine. You can set tasks then add conditions for making them automatically successful (or else) and then proceed to the next and so on. Well... In real life, there is not so often a software telling you: "good guy, you've swept all the mines without error". In Arma, most of the scenarii are made like this: Let's set a task for demining an area (marked on map, I let you decide how to mine and where) The create task module (or equivalent in script) could be: owner : groups of synchronized objects (by default) Task ID : task1 // important to be set Title : Clear the mined area Description : Sweep all mines in this area then, usually, the scenario maker add a trigger above this area and set a condition like: count (allMines select {_x inArea thisTrigger}) == 0 to activate the trigger, synced to the task state module, synced to the create task one,.. iot declare the task as succeeded, with a green title popup. tadaaa So, in game, once there is no more active mine in the area (swept or exploded), the task is done. Marvelous. But, as said, real life is not often so mathematical, and, foot in mud, the guy(s) must decide when the task is done, and then report to HQ. How to do that? Place a same create task module in editor, remove (or not) the trigger and the stask state, and just modify the description field of the create task module by: Sweep all mines in this area. <execute expression = " ['task1','SUCCEEDED',true] call Bis_fnc_taskSetState">report when done.</execute> The task will be successful and marked as done (exactly as previously), when a player clicks on the link in description of the task, but without guarantee there is no forgotten active mines. You can even work with some possibilities (limited by the fact there is no parameters passed in the expression string). Example : modify the description for pointing at who decided the task is done (should work in MP, not deeply tested) Sweep all mines in this area. <execute expression = " ['task1', [name player + ' did it', ('task1' call bis_fnc_taskDescription) #1 , '']] call BIS_fnc_taskSetDescription;['task1','SUCCEEDED',true] call Bis_fnc_taskSetState">report when done.</execute> Have fun! -
Not sure about what you intend to do but, on diary ( map), you have tasks (if any) and briefing menus. If you want to "add" or trigger "task" on a briefing page, you can add active text(s) , like you can do with a marker link showing its position on map: <marker name="respawn_west">You'll respawn here!</marker> , in description field of your create diary record module, by the execute expression (also in description field) : You will regroup <marker name="yourMarker_X">here</marker>, but if not ready, <execute expression= "['task1', 'CANCELED', TRUE] call BIS_fnc_taskSetState">cancel this task.</execute> Mind for the syntax! https://community.bistudio.com/wiki/Arma_3:_Briefing https://community.bistudio.com/wiki/createDiaryRecord (for script, or possibilities on module. Click show test).
-
2 questions about built in revive system
pierremgi replied to dupa1's topic in ARMA 3 - MISSION EDITING & SCRIPTING
No, entity respawned EH works for killed and respawned units only. If you mean revive by healing, try something like: player addEventHandler ["AnimStateChanged", { params ["_unit", "_anim"]; if ("unconsciousout" in _anim) then { [_unit,-1000] remoteExec ["addScore",2]; }; }]; -
2 questions about built in revive system
pierremgi replied to dupa1's topic in ARMA 3 - MISSION EDITING & SCRIPTING
1. Totally agree... old topic and BI didn't improve anything for that. 2. Yes, probably. What do you mean by "point" score? rating? Use the respawn EH : EntityRespawned or script something if you have your own reviving system. -
profileNameSpace shenanigans
pierremgi replied to dupa1's topic in ARMA 3 - MISSION EDITING & SCRIPTING
https://community.bistudio.com/wiki/Array#Reserved_variable_in_expression The reason why you need to add a plus (+) if you don't want to modify the former array, or fail by reserved variable. -
Keeping your head down, or suppressive fire woes
pierremgi replied to cooked auto's topic in ARMA 3 - MISSION EDITING & SCRIPTING
_mg doSuppressiveFire (getposASL player vectorAdd [((1 + random 1) + (-1 + random -1)), ((1 + random 1) + (-1 + random -1)), (2 + random 2)]);..... or _mg doSuppressiveFire (getposASL player vectorAdd [-1 + random 2, -1 + random 2, (2 + random 2)]); (same 😋) 1+ 0...1 means 1...2 -1 + -1...0 means -2... -1 1...2 + -2... -1 means -1 ... 1, same as -1 + 0...2 -
Keeping your head down, or suppressive fire woes
pierremgi replied to cooked auto's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Example: place in init field of the gunner (here a MK30 HMG). Make sure your player is prone at start! this spawn { while {true} do { sleep 2; _this doSuppressiveFire (getposASL player vectorAdd [0,0,1]); _this suppressFor 10; _this setVehicleAmmo 1; sleep 10; }; }; Feel free to trigger it as you need. doSuppressiveFire works in ASL position. The vectorAdd can set an altitude (z) above the player's feet. setVehicleAmmo is for turret. For heavy gunner, use setAmmo instead (the syntax is different) -
It's hard to say what occurs in your scenario. The fact is there are plenty of reasons for missing something. As example: - triggers must be triggered by due conditions and synced to modules (create task to make it appear in diary, setTaskState for modifying its status...). - all createTask modules must be synced to players, group leaders (or not if you choose a side). If you are not among the owners of the task, you will neither see it and nor notification. - task can be delayed (so hidden) if synced to one trigger (no more). When activated, the task appears with the status you decided.... or the status of setTaskState synced to its own trigger and the task. If sometimes, the notification doesn't show, the first thing to do is to schedule what happens by triggers (all) and avoid too many events at the same time. (triggers can be delayed, especially for task notification on completion).
-
For MP edited scenario, don't forget the dynamic simulation. A common error is to fill up the map with enemies, as you could spawn them via scripts. The BI spawn system by modules is not really powerful. The dynamic simulation can help. If you're not afraid by mods (mandatory for all players) you could have a look at my modules (so no script). I have done them for make the edited scenario far easier.
-
currentcommand [SOLVED] How do we know if a vehicle is shooting?
pierremgi replied to thy_'s topic in ARMA 3 - MISSION EDITING & SCRIPTING
You can use simple global variable: isShooting = false; { _x addEventHandler ["Fired", { isShooting = TRUE }]; } forEach _teamVeh; Perhaps I missed something. -
Yes. For example, I'm using: BIS_fnc_setTask BIS_fnc_taskSetState BIS_fnc_taskState See also Arma_3:_Task_Framework (you'll find a tutorial) That looks like (part of script): Now, if you don't want to script, your MP scenario will be basic. Place task modules and triggers for revealing tasks, making them succeeded or failed or canceled... Choose for hosted or dedicated server (harder) Test your scenario with JIP. As you need, at least, to set some conditions and that's little codes, you should have a look at: Locality Multiplayer_Scripting and perhaps some other Arma_Scripting_Tutorials
-
Nice to read you @EricJ , and thanks for your well-known mods about Taliban fighters. It seems to me the MP issues are gone for a while on task modules. Usually, edited tasks are revealed/assigned/completed... by edited triggers and this could be tricky to manage, especially if you need specific tasks for specific players. The scripted tasks are probably easier to set for due players at due time but the syntax is not really simple and you need to script your scenario. If you have more details about your project, what you did, and what you would like to fix...
-
So, perhaps, you just have to call your silencer script just before : _unit setVariable ["UnitData", _unitData]; and that's all.
-
currentcommand [SOLVED] How do we know if a vehicle is shooting?
pierremgi replied to thy_'s topic in ARMA 3 - MISSION EDITING & SCRIPTING
You can apply: thisCar addEventHandler ["Fired", { params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"]; }]; Here _unit is already the vehicle. No need for vehicle _unit (which also returns the same vehicle). You can use _gunner for the _unit who shot, but that doesn't work for passengers. The reason why there is another EH: { _x addEventHandler ["FiredMan", { params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle"]; }] } forEach crew thisCar; -
In SP, there is no respawn. I duno what you wrote for that. Mine (SP Simple Respawn module) makes the player fall unconscious, then aware (+ some options). So, your unit remains unchanged and you don't need anything to re-run. For AIs, I wrote some other modules in this case, and yes, I re-create same unit as the one who died. I manage this "SP respawn" system (MP also) with options same loadout as at start / same loadout as in death. I'm using get/setUnitLoadout commands for that. You just have to get the loadout once the silence is added, for example. Anyway, your script is working..., even for Vanilla BLUFOR equipped with any MX rifle.
-
Steam under the flight deck of the aircraft carrier
pierremgi replied to Babylon1984's topic in ARMA 3 - MISSION EDITING & SCRIPTING
OK, approaching the real life... but little bit laggy (for me) The steam is not visible while the deflector is down; as soon as the deflector rises, the steam appears; the deflector is retracted; 30 sec sleep; The steam disappear; the steam is visible as soon as the deflector rises again.... and so on. private _shuttle1 = allMissionObjects "Land_Carrier_01_hull_04_2_F" #0; private _shuttle2 = allMissionObjects "Land_Carrier_01_hull_04_1_F" #0; private _shuttle3 = allMissionObjects "Land_Carrier_01_hull_07_1_F" #0; private _shuttle4 = allMissionObjects "Land_Carrier_01_hull_07_1_F" #0; _shuttle1 spawn { params ["_shuttle1"]; private _partArray1 = []; while {TRUE} do { waitUntil {sleep 0.5; _shuttle1 animationPhase "deflector_1" > 0}; private "_ps1"; for "_i" from 0 to 116 do { _ps1 = "#particlesource" createVehicleLocal (_shuttle1 modelToWorldVisual [3+_i/10.2,-3-_i,18.5]); _ps1 setParticleParams [ ["\A3\Data_F\ParticleEffects\Universal\Universal",16,9,16,1], "", "Billboard", 0,2,[0,0,0],[0,0,0.0001],0,1.28,1,1,[0.4,0.8,0.2], [[1,1,1,0.05],[1,1,1,0.25],[1,1,1,0.05],[1,1,1,0.225],[1,1,1,0.05]], [0],0.5,0.2,"","", _ps1 ]; _ps1 setParticleRandom [0.5,[0.1,0.1,0.1],[1,1,1],0.2,0.3,[0,0,0,0],0,0,45,0]; _ps1 setDropInterval 0.1; _partArray1 pushBack _ps1; }; waitUntil {sleep 0.5; _shuttle1 animationPhase "deflector_1" == 0}; sleep 30; {deleteVehicle _x} count _partArray1; }; }; _shuttle2 spawn { params ["_shuttle2"]; private _partArray2 = []; while {TRUE} do { waitUntil {sleep 0.5; _shuttle2 animationPhase "deflector_2" > 0}; private "_ps2"; for "_i" from 0 to 116 do { _ps2 = "#particlesource" createVehicleLocal (_shuttle2 modelToWorldVisual [-18.3+_i/34,-3-_i,18.5]); _ps2 setParticleParams [ ["\A3\Data_F\ParticleEffects\Universal\Universal",16,9,16,1], "", "Billboard", 0,2,[0,0,0],[0,0,0.0001],0,1.28,1,1,[0.4,0.8,0.2], [[1,1,1,0.05],[1,1,1,0.25],[1,1,1,0.05],[1,1,1,0.225],[1,1,1,0.05]], [0],0.5,0.2,"","", _ps2 ]; _ps2 setParticleRandom [0.5,[0.1,0.1,0.1],[1,1,1],0.2,0.3,[0,0,0,0],0,0,45,0]; _ps2 setDropInterval 0.1; _partArray2 pushBack _ps2; }; waitUntil {sleep 0.5; _shuttle2 animationPhase "deflector_2" == 0}; sleep 30; {deleteVehicle _x} count _partArray2; }; }; _shuttle3 spawn { params ["_shuttle3"]; private _partArray3 = []; while {TRUE} do { waitUntil {sleep 0.5; _shuttle3 animationPhase "deflector_3" > 0}; private "_ps3"; for "_i" from 0 to 116 do { _ps3 = "#particlesource" createVehicleLocal (_shuttle3 modelToWorldVisual [-2.6+_i/16,-37.3-_i,18.5]); _ps3 setParticleParams [ ["\A3\Data_F\ParticleEffects\Universal\Universal",16,9,16,1], "", "Billboard", 0,2,[0,0,0],[0,0,0.0001],0,1.28,1,1,[0.4,0.8,0.2], [[1,1,1,0.05],[1,1,1,0.25],[1,1,1,0.05],[1,1,1,0.225],[1,1,1,0.05]], [0],0.5,0.2,"","", _ps3 ]; _ps3 setParticleRandom [0.5,[0.1,0.1,0.1],[1,1,1],0.2,0.3,[0,0,0,0],0,0,45,0]; _ps3 setDropInterval 0.1; _partArray3 pushBack _ps3; }; waitUntil {sleep 0.5; _shuttle3 animationPhase "deflector_3" == 0}; sleep 30; {deleteVehicle _x} count _partArray3; }; }; _shuttle4 spawn { params ["_shuttle4"]; private _partArray4 = []; while {TRUE} do { waitUntil {sleep 0.5; _shuttle4 animationPhase "deflector_4" > 0}; private "_ps4"; for "_i" from 0 to 116 do { _ps4 = "#particlesource" createVehicleLocal (_shuttle4 modelToWorldVisual [12.7,-17-_i,18.5]); _ps4 setParticleParams [ ["\A3\Data_F\ParticleEffects\Universal\Universal",16,9,16,1], "", "Billboard", 0,2,[0,0,0],[0,0,0.0001],0,1.28,1,1,[0.4,0.8,0.2], [[1,1,1,0.05],[1,1,1,0.25],[1,1,1,0.05],[1,1,1,0.225],[1,1,1,0.05]], [0],0.5,0.2,"","", _ps4 ]; _ps4 setParticleRandom [0.5,[0.1,0.1,0.1],[1,1,1],0.2,0.3,[0,0,0,0],0,0,45,0]; _ps4 setDropInterval 0.1; _partArray4 pushBack _ps4; }; waitUntil {sleep 0.5; _shuttle4 animationPhase "deflector_4" == 0}; sleep 30; {deleteVehicle _x} count _partArray4; }; }; Don't forget the wind on deck for better effect. Steam subject also to vortex of helo rotor... -
[Solved] RemoteExec on player vehicle in trigger
pierremgi replied to Northup's topic in ARMA 3 - MISSION EDITING & SCRIPTING
That doesn't matter. Your preset condition "Any" "present" will be true everywhere the trigger is known (server + client or server only). So, the code will run... and: - if on server only, you may have to remote execute some commands (depending on locality for arguments or effects). For example spawning a vehicle (via createVehicle) is straight (no remote execution) because the command is GE. On the other hand, a command like playSound , which is LE, needs to be remote executed for clients (players). I can't say for your NUP_fnc_repairVehicle functions, because I don't know which commands are involved here. If just a setDamage, no need for remote execution, the command is GA GE! But I guess there are other commands like hint (LE) or else. - if for everyone, (not server only) , the code will run everywhere. The reason why sometimes people ask why there are so many vehicles spawned at the same place, even without any remote execution. This option is fine for running code everywhere (without useless broadcast), but may cause other issues. Remark: - For edited triggers, you can choose between server only / or not, options. - For scripted triggers, you can script where you need (server, some clients, all clients, server + clients), and you can decide if the trigger is "local" or "global" (in confusing term of makeGlobal true or false) this option (see createTrigger syntax) has no sense in editor, but makes sense in script, especially in MP scenario. See this post: Two questions: 1 Where your trigger is written ( server script, initPlayerLocal.sqf... ?) 2 what your NUP_fnc_repairVehicle is made of (code)? -
[ Package, "Grab the package", "\a3\ui_f\data\IGUI\Cfg\actions\take_ca.paa", "\a3\ui_f\data\IGUI\Cfg\actions\take_ca.paa", "_this distance _target < 2 && {isNull attachedTo _target}", "_caller distance _target < 2 && {isNull attachedTo _target}", {}, {}, { Package attachTo [_caller,[-0.23,-0.16,0],"Spine3",true]; [ player, "Drop the package", "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", "Package in attachedObjects _this", "Package in attachedObjects _caller", {}, {}, {detach Package}, {}, [], 3, 1, true, false ] call BIS_fnc_holdActionAdd; }, {}, [], 3, 1, false, false ] call BIS_fnc_holdActionAdd; addMissionEventHandler ["EntityKilled", { params ["_killed", "_killer", "_instigator"]; if (Package in attachedObjects _killed) then { detach Package}; }]; Not deeply tested.