Jump to content

pierremgi

Member
  • Content count

    2480
  • Joined

  • Last visited

  • Medals

  • Medals

Community Reputation

768 Excellent

About pierremgi

  • Rank
    Warrant Officer

Profile Information

Recent Profile Visitors

1963 profile views
  1. stopwatch in percentage

    Don't "call bis_fnc_MP" your script. You have two challenges in MP: - a common reference for the gaz values; - a local hint, adapted to player's situation (inside or outside sub for example): One way to do that is to split into 2 scripts: in initServer.sqf (all init are at the mission root!): or, in your specific sqf,then executed from init.sqf (always at the mission root): if (isServer) then {[] execVM "scripts \ Oxygen.sqf"}; // you can choose your folder here As you need to make the variables (O2,CO) public, you have to broadcast these values on your network. One simple way is to assign these variables to the submarine and make them common. See setVariable (alternative syntax) for more info. This can be a little bit network resource consuming, so you should have to damper the loop refresh (more sleep time). The code will run at server (hosted or dedicated) start: [] spawn { submarino = "B_SDV_01_F" createvehicle [15300.707, 15765.22, 11.268]; publicVariable "submarino"; submarino setVariable ["oxygen",100,true]; submarino setVariable ["carbon_monoxyde",0,true]; while {alive submarino} do { if (underWater submarino) then { call { if ((getposASLW submarino select 2) < -30) exitWith { submarino setVariable ["oxygen",((submarino getVariable "oxygen") - 0.02 * count crew submarino) max 0,true]; submarino setVariable ["carbon_monoxyde", ((submarino getVariable "carbon_monoxyde") + 0.02 * count crew submarino) min 100,true]; }; if ((getposASLW submarino select 2) < -15) exitWith { submarino setVariable ["oxygen",((submarino getVariable "oxygen") - 0.003 * count crew submarino) max 0,true]; submarino setVariable ["carbon_monoxyde", ((submarino getVariable "carbon_monoxyde") + 0.003 * count crew submarino) min 100,true]; }; if ((getposASLW submarino select 2) < -7) exitWith { submarino setVariable ["oxygen",((submarino getVariable "oxygen") - 0.002 * count crew submarino) max 0,true]; submarino setVariable ["carbon_monoxyde", ((submarino getVariable "carbon_monoxyde") + 0.002 * count crew submarino) min 100,true]; }; if ((getposASLW submarino select 2) < -2) exitWith { submarino setVariable ["oxygen",((submarino getVariable "oxygen") - 0.001 * count crew submarino) max 0,true]; submarino setVariable ["carbon_monoxyde", ((submarino getVariable "carbon_monoxyde") + 0.001 * count crew submarino) min 100,true]; }; }; }; if ((submarino getVariable "oxygen") <=0) then { {_x setdamage 1} forEach crew submarino; }; if !(underWater submarino) then { submarino setVariable ["oxygen",((submarino getVariable "oxygen") + 0.02) min 100,true]; submarino setVariable ["carbon_monoxyde",((submarino getVariable "carbon_monoxyde") - 0.02) max 0,true]; }; sleep 0.1; }; }; So the server is the reference for the values of gaz. Now, you need to hint the value, along with player's situation: just add in initPlayerLocal.sqf (at the mission root): [] spawn { while {alive submarino} do { if (underwater submarino) then { _msg = ["",format ["oxigeno y dioxido de Carbono, \n\noxygen-status\n%1%2 \n\nmonoxide-status\n%3%4",submarino getVariable "oxygen","%",submarino getVariable "carbon_monoxyde","%"]] select (submarino getVariable "oxygen" < 100 && player in submarino); hintSilent _msg; }; sleep 0.1; }; };
  2. Yes, thanks. Same remark on dedmen side. I'll correct the code with setVariable on missionNameSpace.
  3. Yep! thanks. MissionNameSpace works fine! This way, you have also a true respawned vehicle with its name. More elegant than compile format. Tks.
  4. @Dedmen and @baermitumlaut . I scripted some code to respawn any vehicle, saving their variable name (if any). I admit you are far more skilled for manipulation variables. So please have a look and take time to correct my code, just the vehicle var name part of course, for the same result (I want to respawn some vehicles and their name without knowing them at start). It's a generic code to be applied in SP/MP. Your comment and your way to do that will be appreciated. Tks.
  5. Dude, the fact the vehicle spawns empty is not what I underlined here. Just mentioning a standard way to apply a variable name on an object. When a vehicle is created and named in the editor, the name becomes both the variable containing the vehicle object and the string representation of the vehicle object. vehicleVarName on the other hand is only string representation of the object. So if you want to refer to the actual object by its vehicleVarName, an extra step needed to assign the object to a variable of the same name. For example to see and refer to offroad as myFerrari: _offroad setVehicleVarName "MyFerrari"; MyFerrari = _offroad; But further step is not so evident. read discussion: Compile here is a way to allocate a string as variable, referring to the object. https://community.bistudio.com/wiki/Talk:setVehicleVarName I'm not alone and i didn't invent this kind of code. Just talking about general case: https://forums.bohemia.net/forums/topic/176372-change-variable-name-global-how/ https://forums.bohemia.net/forums/topic/191215-setvehiclevarname-and-remoteexec/ https://forums.bohemia.net/forums/topic/160361-set-name-of-vehicle-spawned-in/ http://www.arma3.fr/forum/viewtopic.php?f=13&t=916 https://www.reddit.com/r/armadev/comments/31x735/help_with_vehicle_variables_vanilla_arma_3_editor/
  6. Sorry for the returned array with bis_fnc_spawnVehicle. My bad. For the setVehicleVarName, I'm sure you need to pass the name to the object and I wrote a working solution. _OFFROAD1 =( [getMarkerPos "vehicleNE", 140, "I_G_Offroad_01_F", _crewNE] call BIS_fnc_spawnVehicle) select 0; _OFFROAD1 setVehicleVarName "OFFROAD1"; _OFFROAD1 call compile Format ["%1=_this","OFFROAD1"]; I confirm. @Dedmen: read compile. This makes the job.
  7. try to close the boat to enemies. The distance is a little bit far for infantry, even AI sniper (usually goggling instead of firing...). Add a Kamysh or some AT vehicle able to fire on your boat, just for test. It seems to me vehicles are far more responsive if you enable their sensors/ data links in eden editor.
  8. Error with bis_fnc_cp_main

    It seems to me linked with the laptop local time (windows time) different from actual local time, then internet local time. Error still persists....
  9. Extra playable unit happened to me also, recently on a mission but disappear after some changes. As sometimes I placed extra units for tests, I figured out it was another "old" test but I'm not surprised by your comment. I guess some BI feature, or a mod added this unit, probably in [0,0,0] or below ground, as you can add some logic for modules or else. The fact it's playable is probably unwanted. I don't have your kind of problem, avoiding respawn on start and waiting for any player before any script for end. I always use the mission editor, but I need to respawnOnStart = 0 in description.ext because it's missing in 3den. If all your playable units (can) start as civilian, obviously, you need to add a condition like {side _x == WEST} count allPlayers > 0 in your trigger end. (example).
  10. What kind of assets attack your boat? how far (distance)?
  11. A little chance, depending on your respawn mode, with setPlayerRespawnTime.
  12. How to get all vehicle classnames ?

    Just have a look at the config viewer (from console), and here.
  13. How to get all vehicle classnames ?

    Example for display name, for helicopter: "getNumber (_x >> 'scope') >= 2 && configName _x isKindOf 'helicopter' " configClasses (configFile >> "CfgVehicles") apply {getText (_x >> "displayName")}
  14. Don't duplicate the posts. As already said, MP session depends on disabled AI or not in lobby. switchableUnits = all playable units in SP, [] in MP playableUnits = [] in SP, all playable units in MP in they are enabled in lobby (all enabled slots), all played units (actual players) if AI not enabled in lobby. allPlayers = all present players at the time the code runs. You have also some differences in initialization order. So, your question is turning around your mission end conditions. As already said, depending on what you're expecting, you can add a condition for at least one player active (count allPlayers >0). You can delay your trigger also (timeout > 30 for example)
  15. To be healed or not depends on parameters and that can take some time. If no unit is available during the respawn time, you revive (SP) or die (MP). It's a temporary choice. Why? Because most of the time, SP missions don't allow team switch (conceived with one switchable/playable unit). Then, if you die, mission is over. On the other hand, in MP, most of the mission are written with respawn system. So, there is no problem to let let a player die. You can play solo in multiplayer. I'll have a check at SP healing.
×