Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×

pierremgi

Member
  • Content Count

    7536
  • Joined

  • Last visited

  • Medals

  • Medals

Everything posted by pierremgi

  1. pierremgi

    Forum has died

    You're right Gunther. Totally agree. I vote for you as moderator. I can help also, if needed.
  2. pierremgi

    Forum has died

    DDOS attack on servers and spam/scam for a couple of weeks.
  3. pierremgi

    Progressbar

    A lot of files! At least, in your mission.sf, you can't private the global variable totalSpawned . Remove "totalSpawned" from private array. I'm not sure (not so much time to check all the stuff) but if you call mission.sqf on server, then Edistymispalkki.sqf is on server only Right? So, no way for displaying something anywhere else than hosted server. The rule is simple : make the display local, for each server, publicVariable data from server, each time data change, if you keep the count on server only.... or addMissionHandler "entityKilled" everywhere (e.g. init.sqf) then the count can be local, with no sync on server, as far as the addition or subtraction is same for everyone. You are using plenty of hold scripts, using their own init.sqf or else... difficult to help you more in this jungle.
  4. [this, 'DeployFloats'] remoteExec ['lxRF_fnc_Cougar']; is not fine: this refers to the object in init field of this one. So, Each time a PC starts, this code runs. Consequences depend on the code itself. Can be local, can be global so "pollute" all other PC. In such case, remote execution is weird. the lxRF_fnc_cougar uses the setWaterLeakiness command (set to 0). This command is La Ge. that means a simple : this setWaterLeakiness 0; in init field of the object should work. Perhaps, re-run at owner's change in MP (when a player jumps as pilot) and no, that doesn't work for tanks. For planes and cars, it's just... 🤪 That works also for objects such as Airport tower! If you want to do a base or any composition at sea... just do it! See also: setWaterFillPercentage
  5. pierremgi

    Progressbar

    You should add more hints about your scripts. 1 mission.sqf ?? bad idea. there is an automatic mission.sqm and a good practice could be a different name, even with a different extension. For clarity. 2 Your sqf are present on each PC, so it should be OK for displaying normally. And locally (avoid remote execution for nuts) 3 prefer functions (in description.ext) rather than sqf (execVm compiles each time you run it). Important for a loop. 4 Initialization is important for: - initialization order - variable initialization on server only (you don't want a JIP initialize public variable). 5 so _totalSpawned should be replaced by: totalSpawned (global variable on server, made public by publicVariable "totalspawned" at start then each time the value changes). Something like : initserver.sqf : totalSpawned = 0; publicVariable "totalSpawned"; .... for some reason, on server, you spawn units then change: totalSpawned = totalSpawned +1; publicVariable "totalSpawned"; initPlayerLocal: For script calling a function for your display with totalSpawned as global variable. Same for _maxAIteams but you can save publicVariable broadcast if hard coded as a unique value (keep it simple).
  6. Saving the loadout at start, recovering at respawn: in initPlayerLocal.sqf player spawn { params ["_plyr"]; sleep 2; _plyr setVariable ["ldOutAtStart", getUnitLoadOut _plyr]; _plyr addMPEventHandler ["MPRespawn", { params ["_plyr","_corpse"]; _plyr setUnitLoadOut (_corpse getVariable ["ldOutAtStart",getUnitLoadOut _plyr]); }]; }; The sleep command is not mandatory but that could secure the loadout at start if you are scripting or using mod about that. If that doesn't work, share what mod or script you are running at start (what happens with players).
  7. Are you sure you give the same variable name everywhere (hvt or obj_hvt,...) ?
  8. pierremgi

    Arsenal BluFor Whitelist

    You can select WEST weapons (and more). See this topic: Once you have your filter, use it: https://community.bistudio.com/wiki/Arma_3:_Arsenal See also this topic:
  9. Hi johnnyboy , To say the truth, it was a quick and dirty example. I thought about addWaypoint just for updating the position by setWaypointPosition. You're right doMove is fine. This script could be improved, for sure. I added a better aiming with modelToWorldworld and suppressFor (less ammo waste). If I'd to give a move to spawned animals, I'll probably use setDestination And the probable best use for that code needs to choose only spawned species, without rabbits in _priority variable (they spawn too often).
  10. Animals in Arma? Rabbits, snakes, butterflies... Animals are spawned by engine in vicinity of the player, like this: Animals:_Ambient_System - You can add rabbits by editor (and only rabbits because other classes are not in public scope, they are protected) - you can spawn some classes like found here. - some mods add specific animals (like dromedaries by Western Sahara DLC) Side: not very handy! AMBIENT LIFE for edited rabbits (or dromedaries or else) CIVILIAN for edited by createAgent (read it from top to bottom!) UNKNOWN if spawned by engine (butterflies,mosquitos... snakes, rabbits) You can't modify the side of an animal. That said, here is a little script for hunting. Place it in init field of an AI unit: this spawn { params ["_hunter","_animals","_targets","_target"]; private _initPos = getpos _hunter; private _wpt = [group _hunter,0]; _hunter setSkill 1; private _priority = ["Rabbit_F","Dromedary_01_lxWS"]; while {sleep 2; alive _hunter} do { _animals = ((allMissionObjects "Animal" select {alive _x}) apply {_an = _x;[_priority findIf { _an isKindOf _x}, _an distance2D _hunter, _an]}); _targets = _animals select {_x#0 != -1}; _targets sort TRUE; call { if (_targets isEqualTo []) exitWith { _hunter enableAI "FIREWEAPON"}; if (isNil {_hunter getVariable "target"}) exitWith { _target = _targets #0#2; _hunter setVariable ["target",_target]; _hunter doMove getPos _target; _hunter enableAI "FIREWEAPON"; }; _target = _hunter getVariable ["target",objNull]; _hunter doMove getPos _target; if (isNull _target or !alive _target) exitWith { _hunter move _initPos; _hunter setVariable ["target",nil]; }; if (_hunter distance2D _target < 30) exitWith { doStop _hunter; _hunter doSuppressiveFire (_target modelToWorldWorld [0,0,0.5]); _hunter suppressFor 1; sleep 1; _hunter disableAI "FIREWEAPON"; sleep 2; if (alive _target && !isNull _target) then {_hunter enableAI "FIREWEAPON"}; }; }; }; }; Where: _priority is an array of your favorite animals (classes) sort by priority (here Western Sahara dromedaries for test, then rabbits). classes must comply with isKindOf command. I'm using doSuppressiveFire command to fire on a position. Not the best. Feel free to choose something else for firing an object (civilian) The hunter seems to shoot too many bullets, the reason why I tried to dim that by disabling /enabling its FIREWEAPON ability.
  11. pierremgi

    Player leave Ai group

    We don't have the same script. https://forums.bohemia.net/forums/topic/317664-player-leave-ai-group/?do=findComment&amp;comment=3594257 Everything works fine for me. I can't understand why you can have multiple dismissal, tested multiple Join/dismiss. There is no reason for adding another action on a AI unit! So, you did something on your side, a loop or else... I can't say. I keep the "leaving group" option, working fine, after a respawn... the script has been corrected for that, as you required. So, if you can't find this action menu after a normal respawn (BI respawn system) I can't understand. That's the first time I read the MPEH MPRespawn fails. I hope you don't try 2 codes at the same time... or add multiple mods already managing stuff on respawn. No clue about what to do more.
  12. pierremgi

    Make unit invicible

    Spawned in game or edited (i.e. existing at start)?
  13. pierremgi

    Player leave Ai group

    Did you test the last script? I added an MPEH for respawn. That works on respawn! Eliminated? if player13 (or 14) respawns in MP, that doesn't change anything for him. They are still player13 (or14) as variable name. The respawn EH throws the addAction on new unit. So, I don't understand what "eliminated" means. Did you name two slots with player13 and player14? If not, what are characters 13 and 14 ? What means "eliminated"? What occurs? respawn, back to lobby? How can they still play if eliminated?
  14. pierremgi

    Script not working on server

    That's a wide MP topic. For example, the weather broadcast, the fact it rains or not, the fact players can't see same clouds,... all shared (braoadcast) data can drastically impact on server flow. Synchronisation is managed by Arma 3's engine, not supposed to be the best engine for multiplayer. Let's see the case for bullets, fired by each client! If I remember (I'm not specialist for that), bullets are local and that saves bandwidth. On the other hand, flying missiles, grenades are global (like planes), so synced (for the display). But all these projectiles (small & fast or big & slow) are owned by the "shooter" (?) Don't ask me for the case of a vehicle (so belonging to the driver) when another player, gunner, fires from the turret. The projectile is probably owned by the turret owner. Furthermore, It seems to me that the hits are local, then damages are shared by broadcast. Someone more skilled with that could provide far better explanation than mine. Anyway, demanding codes should be executed locally each time it's possible. Multiplayer_Scripting Code_Optimisation Something relevant, imho: a MP scenario should use: - simple objects each time it's possible ( for static scenery like camping table "Land_CampingTable_F", chairs...); That disable possible simulation. - edited objects locally (see in editor the attributes of object: local only), or scripted by createVehicleLocal for plenty of props like ruins (looks like simple object but this option is not in editor), but also particles (sure, you'll never see the absolutely same particles as another player can see, but who cares?) ; - if possible, disabled simulation (can be destroyed but no more input like collision, object frozen example: rotating antenna or turret frozen, impossibility for embarking/disembarking such vehicles); - and most of time: dynamic simulation.
  15. pierremgi

    Script not working on server

    That's probably because things are glitchy, to say the least, when you try to modify/attach object from server. This can't be easily done on each frame. I think you'll experience more and more glitches for clients, especially when you add this kind of script in an "heavy" scenario. (a simple test can pass, depending on your PC) The first thing I'll do is to replace: if (isServer) then { createVehicle ....} by: createVehicleLocal ... This way, a Spartan is created locally, on each PC and not synced to server.
  16. pierremgi

    Player leave Ai group

    Yes, as any addAction on respawning unit. Script like this: if (player in [player13,player14]) then { XXX_ManageGroup = [ "<t color='#ff3333'>Dismiss</t>",{ params ["_unit","_plyr","_id"]; if (group _unit isNotEqualTo group _plyr) then { [_unit] joinSilent group _plyr; _unit setUserActionText [_id,"<t color='#ff3333'>Dismiss</t>"]; } else { [_unit] joinSilent grpNull; _unit setUserActionText [_id,"<t color='#33ff33'>Join group</t>"]; }; }, [], 0, false, true, "", "true", 8 ]; XXX_PlyrLeavingGroup = [ "<t color='#3333ff'>leaving group</t>",{ params ["_unit","_plyr"]; {removeAllActions _x} forEach units player; [_plyr] joinSilent grpNull; }, [], 0, false, true, "", "units _this isNotEqualTo [_this]" ]; { _x addAction XXX_ManageGroup; } forEach (units player select {!isPlayer _x}); player addAction XXX_PlyrLeavingGroup; group player addEventHandler ["UnitJoined", { params ["_group", "_newUnit"]; _newUnit addAction XXX_ManageGroup; }]; player addMPEventHandler ["MPRespawn",{ params ["_new","_old"]; removeAllActions _old; _new addAction XXX_PlyrLeavingGroup; }]; };
  17. pierremgi

    Player leave Ai group

    my bad: params ["_unit","_plyr"]; don't double _unit param! Check also if you didn't erase the last }; at bottom end of the script for closing: if (player in [player13,player14]) then {...} brackets!
  18. pierremgi

    Player leave Ai group

    Simple correction: if (player in [player13,player14]) then { XXX_ManageGroup = [ "<t color='#ff3333'>Dismiss</t>",{ params ["_unit","_plyr","_id"]; if (group _unit isNotEqualTo group _plyr) then { [_unit] joinSilent group _plyr; _unit setUserActionText [_id,"<t color='#ff3333'>Dismiss</t>"]; } else { [_unit] joinSilent grpNull; _unit setUserActionText [_id,"<t color='#33ff33'>Join group</t>"]; }; }, [], 0, false, true, "", "true", 8 ]; { _x addAction XXX_ManageGroup; } forEach (units player select {!isPlayer _x}); group player addEventHandler ["UnitJoined", { params ["_group", "_newUnit"]; _newUnit addAction XXX_ManageGroup; }]; player addAction [ "<t color='#3333ff'>leaving group</t>",{ params ["_unit","_plyr","_unit"]; {_unit = _x; _unit setUserActionText [(actionIds _unit) findIf {((_unit actionParams _x)#0) isEqualTo "<t color='#ff3333'>Dismiss</t>"},"<t color='#33ff33'>Join group</t>"]} forEach units player; [_plyr] joinSilent grpNull; }, [], 0, false, true, "", "units _this isNotEqualTo [_this]" ]; }; That allows you to regroup dismissed units (within 8 m distance). If you don't want them anymore when you leave the group, it's also simple: replace the last player addAction by: player addAction ["<t color='#3333ff'>leaving group</t>",{ params ["_unit","_plyr","_unit"]; {removeAllActions _x} forEach units player; [_plyr] joinSilent grpNull; }, [], 0, false, true, "", "units _this isNotEqualTo [_this]"];
  19. EHs are, most of time!, less often checked than loops... They are "triggered" for an event. That said each framed EH is checked every frame. A simple trigger is tested every 0.5 sec if set by default. That said, the "test", i.e. the condition can be more or less resource consuming. A simple alive player vs a allUnits findIf {isPlayer _x && alive _x} > -1 or else, can make a difference. Scripting for SP, it's not so hard to save CPU resource, making scenario with basic rules: Code_Optimisation Code_Best_Practices Code_Positivity Mission_Optimisation Dynamic_Simulation
  20. Yes, but filtered for unit becoming player (checked after 1 second delay).
  21. Lol. That reminds me why I didn't kill and re-create the player in my own SP respawn system. My player falls unconscious, then revive (or be revived by AI fellows) Anyway, a quick script (without loop or radio trigger) for what you want: in a trigger set to true (for example), SP mission. private _requester = objNull; private _syncObjs = +synchronizedObjects player; if (_syncObjs isNotEqualTo [] && {_syncObjs findIf {typeOf _x isEqualto "SupportRequester"} > -1}) then { _idx = _syncObjs findIf {typeOf _x isEqualto "SupportRequester"}; _requester = _syncObjs #_idx; }; private _providers = player getVariable ["BIS_SUPP_allProviderModules",[]]; private _HQ = player getVariable ["BIS_SUPP_HQ",objNull]; XXX_supports = [_requester,_providers,_HQ]; addMissionEventHandler ["EntityCreated", { params ["_entity"]; _entity spawn { params ["_newPlyr"]; sleep 1; if (isPlayer _newPlyr) then { {[_newPlyr,XXX_supports #0,_x] call BIS_fnc_addSupportLink} forEach (XXX_supports #1); _newPlyr setVariable ["BIS_SUPP_transmitting", false]; _newPlyr kbAddTopic ["BIS_SUPP_protocol", "A3\Modules_F\supports\kb\protocol.bikb", "A3\Modules_F\supports\kb\protocol.fsm", {call compile preprocessFileLineNumbers "A3\Modules_F\supports\kb\protocol.sqf"}]; _newPlyr setVariable ["BIS_SUPP_HQ", XXX_supports #2]; {_newPlyr setVariable [format ["BIS_SUPP_used_%1", _x],0,TRUE]} forEach ["Artillery","CAS_Heli","CAS_Bomb ing","UAV","Drop","Transport"]; } } }];
  22. My script will work if your switchable unit is also synced to the requester module. Loops can be light, depending on condition you check and frequency. There is also a teamSwitch EH but that means player must open the teamswitch menu. For automatic teamswitching, that doesn't fire. The reason why I preferred a simple loop checking if the player's unit has changed.
  23. I'm not sure why you need a radio trigger. This could help without need of a radio trigger: This will work, as far as you switch on a unit with a link to a requester module (edited or scripted previously). If you want to "add" support on switchable unit not supposed to have access to support(s) (i.e. not synced to a requester), the script will be slightly different.
  24. pierremgi

    Enemy counter

    In initPlayerLocal.sqf (or trigger, set to true) addMissionEventHandler ["EntityKilled", { params ["_killed", "_killer", "_instigator"]; if (isNull _instigator) then { _instigator = UAVControl vehicle _killer select 0 }; if (isNull _instigator) then { _instigator = _killer }; private _side = side group _killed; if (_side getFriend side _instigator < 0.6) then { private _cnt = _side countSide allunits; hintSilent format ["Remaining %1 units: %2",_side,_cnt]; }; }];
  25. pierremgi

    Player leave Ai group

    You just have to leave your group (no impact on Warlords setting and player's data iirc). So the units will stay grouped, without you. add this in initPlayerLocal.sqf or trigger if (player in [player13,player14]) then { player addAction ["<t color='#3333ff'>leaving group</t>",{ params ["_unit","_plyr","_id"]; [_plyr] joinSilent grpNull }, [], 0, false, true, "", "units _this isNotEqualTo [_this]" ]; };
×