Jump to content

pierremgi

Member
  • Content Count

    6299
  • Joined

  • Last visited

  • Medals

  • Medals

Community Reputation

3907 Excellent

About pierremgi

Profile Information

  • Location
    Tahiti

Recent Profile Visitors

9015 profile views
  1. The initial value(s) can be on server (initServer.sqf) and publicVariable for clients. This way, the initial value(s) are not reset by JIP (they don't run initServer.sqf) On the other hand, when a player changes for other values (addAction or menu), these new values must be updated by publicVariable command also. In this case, the values are updated everywhere, so for JIP also. missionNameSpace setVariable ["yourVar", yourValue ,TRUE] is also a good way for broadcasting yourVar variable everywhere (so make it public and JIP compatible)
  2. trigger's condition is checked every 0.5 sec by default. Since 20.6, you can modify this parameter in editor. AnyPlayer present is a "preset" condition for this as specific variable. When the condition is met, you can use thisList in on activation field of the trigger. ThisList is always an array, here with all players who fired the trigger. Usually, it's quite impossible to have 2 or more players entering the trigger's area (so the condition) during the same 0.5 sec slot... but not impossible. Anyway, just pick (thisList select 0) as 1st player (even if the order is not guaranteed).
  3. wow! some basics: - local machine: player's PC (or server) but local variables are variables defined in a scope (so locally on PC and locally on (part of) script. - global can refer to all PCs (like commands ending by global as setTextureGlobal) but global variables (like your cam1) means "known by all scripts of the scenario on the PC(s)". If multiple PCs, each global variable, like cam1 has its own "life", i.e. there is no broadcast for value - public is a term for variables (roughly) and that's a way for making a variable "common". There are 2 ways: * using setVariable command with the 3rd parameter set tot true (see BIKI) * using publicVariable command EACH TIME the variable changes and must be updated for everyone. For script/code, we are speaking about remote execution or not (remoteExec command). Usually, it's easy to remote exec a command if needed. That depends on: - its argument(s). They can be local, global, server only... The need depends on the locality they apply. An example: allowDamage is a AL EG command. That means: must be applied where the unit is local, effects are global, so for everyone. As you can test, the (poor) option for disabling damage in editor worth in SP , or in MP on players. Just because such units, once played, change their locality (played unit is local to a client) , so your invincible unit will be killed. Such AL EG command "dislike" the shift of unit's owner. - on the other hand, a EL command like camSetFOV (AL EL) will give effects only locally. (Not a reason for remoteExecuting it, just think about same settings produce same effects) - there are other possibilities for commands: AG EG.. AL EG SE... Always refer to BIKI. For example it's a bad idea remoteExecuting setObjectTextureGlobal, already shared.Read BIKI links for details. - Last but not least, do not remote execute sqf or function unless that meets every argument and effect requirements (usually not the case). So, I suggest you to script yours codes in initPLayerLocal.sqf (means for each player) when a player sets something via addAction (or else). Make public some variables, so these values change for all players. As your MEH "draw3D" is a kind of loop, if you refer to these variables, your display can be updated (locally but everywhere).
  4. Your problem, IMHO, is that you want to synchronize UAV displays for all players: they must have the same picture, no matter who set the zoom and mode. For evident reason of broadcast, the displays are usually local. The best way to display the same thing on all PCs, even for JIP, is to run all possible things locally, then broadcast only little variables (like your _sMode or _sZoom) making them public instead of local. In such cases, use global sMode and publicVariable "sMode"; sZoom and publicVariable "sZoom"... and, as you are running a code on each PC, stop using setObjectTextureGlobal, prefer setObjectTexture. No need to broadcast such global command (it's even counter-productive: each JIP reset the texture for everyone!).
  5. pierremgi

    Using apply on group units

    Spawn that: [] spawn { // testGroup = createGroup [independent, true]; // totally useless (due to next line) testGroup = [getPos trg1, independent, (configfile >> "CfgGroups" >> "Indep" >> "IND_F" >> "Infantry" >> "HAF_InfSquad")] call BIS_fnc_spawnGroup; // call it sleep 0.5; // if needed: spawned units can be not completed before next line { _x execVM "unit_loadouts\checkgear.sqf" } forEach units testGroup; };
  6. pierremgi

    Headless clients dont work

    Where is the headless client? On hosted server, as 2nd session?, I'm not sure you'll gain any performance. Hosting means running mission as server and playing on the same PC , same session. A session is a launch. You are speaking about dedicated, server.cfg, What's the link with hosted mission? Perhaps are you running a dedicated session (using arma3server.exe if I refer to your first post), and a player session on the same PC (it's possible), but in this case, you don't have an hosted server. Perhaps you want yo launch somewhere a headless client... Same PC as server / player ? It's useless. Anyway, the first question is: what kind of server (dedicated or hosted, dedicated doesn't have any player/client in the same session)? The second question? : a headless client? What for? Most of the time, you don't need it. Think about dynamic simulation and spawn for units instead.
  7. The very first step is, as usual, clarify in plain language the aim of the script and effect(s) to obtain. Example: - in MP environment, (dedicated or hosted server, say dedicated), all / specific players can see/display a personal/global score (players, side, group..), for all / AIs / other players killed.... permanent / on any kill / on any player kill / on player kills only . That's the first difficulty, at least for me. Result can be as simple as the code I gave you and tested above, or an elaborated display with multiple entries.
  8. pierremgi

    Headless clients dont work

    Headless client is a... client, and it must run Arma as any other client. There is no client on dedicated server, by definition. Even with no interface, the dedicated server must run the mission. I doubt you can do that on a PC without Arma. If you are running a dedicated server, arma-3_server, you need to launch a mission in server parameter. There are plenty of missing things in your zip. https://community.bistudio.com/wiki/Arma_3:_Dedicated_Server https://community.bistudio.com/wiki/Arma_3:_Server_Config_File https://community.bistudio.com/wiki/Arma_3:_Headless_Client
  9. pierremgi

    Any Idea of Mine Detection?

    https://community.bistudio.com/wiki/Arma_3:_Field_Manual_-_Weapons_Advanced#Finding_Mines See also: disable/enableAI "MINEDETECTION"
  10. First of all, this code is supposed to save loadout/position/direction on server during the mission on server. So, in multiplayer session, during the session (as far as the server is running the mission). If you want to save something in SP or even hosted MP at home, you must save (what you want) in your profileNameSpace. You can use the MEHs "handleDisconnect" & "playerConnected" as above but your data must be saved in profileNameSpace, not missionNameSpace.
  11. pierremgi

    JBOY Boat Waypoints script

    in a waitUntil, it's safer to check for: isNil {anObject getVariable "blabla"}, or not, // double secured : anObject can be inexistent and blabla can be undefined. or even: anObject getVariable ["blabla",false] (so with a default value in case or undefined variable "blabla"). // simple secured by blabla by default. Fails if anObject is inexistent. If any doubt about the object's presence and the variable for the object, start like this: !isNil "anObject" && { anObject getVariable ["blabla",false] }
  12. Don't triple (even double) post! https://forums.bohemia.net/forums/topic/235999-task-not-completing/?tab=comments#comment-3446788 https://forums.bohemia.net/forums/topic/235994-how-do-you-prevent-a-randomly-spawned-vehicle-from-spawning-on-a-bridge/?tab=comments#comment-3446752
  13. Your code is false. You increment suicides + players killed! That's really what you need???
  14. pierremgi

    Questions: SOG Prairie Fire

    Hi, I don't have SOG on this hold laptop, so I can't test. On the other hand, try to find the turret by unitTurret in watch debug console . Then use lockturret.
×