Jump to content

Mr H.

Member
  • Content Count

    597
  • Joined

  • Last visited

  • Medals

Everything posted by Mr H.

  1. Mr H.

    Esc key toggle rsc

    I did try to override the onload but it didn't seem to work. Maybe I did it wrong. Could you give an example for that?
  2. Mr H.

    Esc key toggle rsc

    Interesting post, onPauseScript = "script.sqf"; doesn't seem to work from an addon's config.cpp any idea how to make this addon based? (besides adding EH keydown to display 46)
  3. That's what I did but I wasn't aware it wasn't stackable (which might become an issue later) also the strangest thing happened: I use it to spawn stuff inside the tent of "rhsusf_M1085A1P2_B_D_Medical_fmtv_usarmy" (from RHSUSAF) when it's deployed. It works very well for me but in MP for my friend the actions where inverted: the items spawned when he closed the tent and I don't know why. Here's the full code: (includes some stuff that's also relevant to my previous question on getting init) : MHQ = [["Land_ClutterCutter_large_F",[0,-5,0],0,false,false,false,false,[]],["Sign_Arrow_Green_F",[-1803.37,-253.378,-0.564929],-335.682,false,false,false,false,[]],["Sign_Arrow_F",[-1803.37,-253.378,-0.564929],-335.682,false,false,false,false,[]],["Sign_Arrow_Yellow_F",[-1803.37,-253.378,-0.564929],-335.682,false,false,false,false,[]],["Land_HelipadEmpty_F",[0.353271,-1.85486,-1.53022],-335.682,true,false,false,false,[]],["Land_Stretcher_01_sand_F",[0.268799,-2.59204,-2.02156],-91.2231,false,false,false,false,[]],["Land_Stretcher_01_sand_F",[0.532959,-1.02863,-2.02274],-91.2226,false,false,false,false,[]],["Land_Stretcher_01_sand_F",[0.928955,-4.19342,-2.02103],-91.2235,false,false,false,false,[]],["MedicalGarbage_01_1x1_v2_F",[-0.236328,-1.82489,-1.76981],-335.682,false,false,false,false,[]],["Land_IntravenStand_01_2bags_F",[1.16663,-1.90289,-2.02262],24.3161,false,false,false,false,[]],["Land_TripodScreen_01_large_F",[2.72949,-6.46667,-2.02085],-80.7826,false,false,true,false,[]],["Land_Laptop_device_F",[-1.38879,-6.58466,-1.15523],-103.901,false,true,false,false,[]],["Land_Portable_generator_F",[-2.32483,-1.73682,-2.02105],24.316,false,false,false,false,[]],["Land_PortableLight_double_F",[-1.81714,-0.993042,-1.79225],-29.3421,false,false,false,false,[]],["acre_oe_303",[7.07385,-9.62292,-2.02203],-335.682,false,false,false,false,[]],["C_supplyCrate_F",[-2.58264,-7.60071,-2.01635],-175.218,false,false,false,true,[10,true,true]],["Land_WoodenTable_large_F",[-0.563721,-6.49072,-2.01851],-269.219,false,false,false,false,[]],["Land_CampingChair_V2_F",[-0.0749512,-7.23315,-2.01839],-193.902,false,false,false,false,[]],["Land_CampingChair_V2_F",[-1.07922,-7.46399,-2.01753],-253.899,false,false,false,false,[]],["Land_CampingChair_V2_F",[-0.0460205,-5.73322,-2.01936],-13.8943,false,false,false,false,[]],["Land_CampingChair_V2_F",[-0.987061,-5.78009,-2.01865],1.0712,false,false,false,false,[]],["Land_PaperBox_open_empty_F",[-5.26428,-5.37286,-2.01583],-155.682,false,false,false,false,[]],["ACE_medicalSupplyCrate_advanced",[3.02014,-2.38989,-2.02367],-82.6879,false,false,false,false,[]]]; inGameUISetEventHandler ["Action", "_this call MRH_fnc_RHS_CPBSACTION"]; MRH_fnc_grabObject = { params ["_pivot","_objectToGrab"]; _relPos = _pivot worldToModel (getPosATL _objectToGrab); _dir = getDir _pivot; _objDir = getDir _objectToGrab; _relDir = (_objDir - _dir); _className = typeOf _objectToGrab; _isAceMedicalFacility =_objectToGrab getVariable ["ace_medical_ismedicalfacility",false]; _isMRHSatelliteConsole = _objectToGrab getVariable ["MRH_Sat_isSatelliteConsole",false]; _isMRHSatelliteScreen = _objectToGrab getVariable ["MRH_Sat_isSatelliteScreen",false]; _AmmoCrateParams = _objectToGrab getVariable ["MRH_AmmoCrateParameters",[]]; _isAmmoBox = false; _isAceRepairFacility = _objectToGrab getVariable ["ace_isrepairfacility",0]; if !(_AmmoCrateParams isEqualTo[]) then { _isAmmoBox = true, _AmmoCrateParams deleteAt 0; }; _return = [_className,_relPos,_reldir,_isAceMedicalFacility,_isMRHSatelliteConsole,_isMRHSatelliteScreen,_isAmmoBox,_AmmoCrateParams,_isAceRepairFacility]; _return }; MRH_fnc_createObject = { params ["_pivot","_className","_relPos","_relDir","_isAceMedicalFacility","_isMRHSatelliteConsole","_isMRHSatelliteScreen","_isAmmoBox","_AmmoCrateParams",["_isAceRepairFacility",0]]; _object = _className createVehicle _relPos; _object setPosATL (_pivot modelToWorld _relPos); _object setDir ((getDir _pivot) + _reldir); _object setVectorUp surfaceNormal position _object; _object setVariable ["ace_medical_ismedicalfacility",_isAceMedicalFacility,true]; _object setVariable ["ace_isrepairfacility",_isAceRepairFacility,true]; if (_isMRHSatelliteConsole) then {[[_object],MRH_fnc_IsSatelliteConsole] remoteExec ["Call",[0,-2] select isDedicated,true]}; if (_isMRHSatelliteScreen) then {[[_object],MRH_fnc_IsSatMonitor] remoteExec ["Call",[0,-2] select isDedicated,true]}; if (_isAmmoBox) then { _AmmoCrateParams params ["_number","_unli","_refresh"]; [[_object,_number,_unli,_refresh],MRH_fnc_AmmoCrate] remoteExec ["Call",[0,-2] select isDedicated,true]; }; _object }; MRH_fnc_storeComp = { params ["_pivot","_objectsArray"]; _dataOutPut = []; { private _entry = [_pivot,_x] call MRH_fnc_grabObject; _dataOutPut pushBackUnique _entry; } forEach _objectsArray; _dataOutPut }; MRH_fnc_spawnComp = { params ["_pivot","_dataInput"]; _compObjects = []; { /* private _class = _x select 0; private _relPos = _x select 1; private _relDir = _x select 2; private _isAceMedicalFacility = _x select 3; private _isMRHSatelliteConsole = _x select 4; private _isMRHSatelliteScreen = _x select 5; private _isAmmoBox = _x select 6; private _AmmoCrateParams = _x select 7; private _isAceRepairFacility = _x select 8; */ _x params ["_class","_relPos","_relDir","_isAceMedicalFacility","_isMRHSatelliteConsole","_isMRHSatelliteScreen","_isAmmoBox","_AmmoCrateParams",["_isAceRepairFacility",0]]; private _object = [_pivot,_class,_relPos,_relDir,_isAceMedicalFacility,_isMRHSatelliteConsole,_isMRHSatelliteScreen,_isAmmoBox,_AmmoCrateParams,_isAceRepairFacility] call MRH_fnc_createObject; _compObjects pushBackUnique _object; } forEach _dataInput; _compObjects }; MRH_fnc_createComp ={ params ["_pivot"]; _allObjects = []; _allMission= allMissionObjects "All"; { if (!(isplayer _x) && (_x != _pivot) && (typeOf _x != "logic") && !(_x isKindOf "Man")) then {_allObjects pushBackUnique _x}; } forEach _allMission; _comp = [_pivot,_allObjects] call MRH_fnc_storeComp; copyToClipboard str _comp; }; MRH_fnc_RHS_CPBSACTION = { 0 = _this spawn { _vehicle = _this select 0; if ((typeOf _vehicle) != "rhsusf_M1085A1P2_B_D_Medical_fmtv_usarmy") exitWith {}; if ((_vehicle animationPhase "platform")!= 1) exitWith {}; _alreadyCalled = _vehicle getVariable ["MRH_MHQ_actionCalled",false]; if (_alreadyCalled) exitWith {hint "exited"}; _vehicle setVariable ["MRH_MHQ_actionCalled",true,true]; //if (((_vehicle animationPhase "hide_tent") != 1) && ((_vehicle animationPhase "hide_tent") != 0)) exitWith { hint "exited"}; _doDelete = _vehicle getVariable ["MRH_MHQ_Comp",[]]; if !(_doDelete isEqualTo []) then {{deleteVehicle _x}forEach _doDelete}; waitUntil {((_vehicle animationPhase "hide_tent") == 0) || ((_vehicle animationPhase "hide_tent") == 1)}; if ((_vehicle animationPhase "hide_tent") == 0) then {hint "tente repliée"}; if ((_vehicle animationPhase "hide_tent") == 1) then { hint "tente deployée"; _comp =[_vehicle,mhq] call MRH_fnc_spawnComp; _vehicle setVariable ["MRH_MHQ_Comp",_comp,true]; }; _vehicle setVariable ["MRH_MHQ_actionCalled",false,true]; }; };
  4. I have noticed that the event handlers animChanged, animDone and animStateChanged work very well on humans in game but they do not seem to fire when a vehicle's animation is fired (door opening on an RHS vehicle), is there any other way to test when a vehicle is changing animation? For the moment I'm using stuff like: waitUntil {((_vehicle animationPhase "hide_tent") == 0) || ((_vehicle animationPhase "hide_tent") == 1)}; But getting the EH to work would be much more satisfying.
  5. Hi! simple question : is there a way to return an object's init code (set in the editor in its init field, or later with createVehicle) in the form of a string?
  6. That's exactly what I'm doing right now, but I'd like it to be automated ^^ Thanks I tried looking in the mission sqm, but failed , didn't know I could #include it, with your solution It might just work!
  7. Thank you for your answer but that won't work for what I'm trying to do, the goal being to develop a simple composition grabber/ spawner. The idea was that I would for instance create a nice composition with animated characters, the animation would be coded in the characters' init field, this would mean that when I grab a composition I'd also grab whatever code they have and reexecute it when I spawn the composition, for any given composition, quickly and without reassigning scripts. (Which is what I'm doing so far and is rather tedious).
  8. I've made a script that grabs objects and stores their position relative to an object, I'd like to spawn compositions with it and also if needed store what was in the object's init field to re execute the code on the newly created object duplicate.
  9. Mr H.

    Skip briefing in MP Mission

    Nerver trust rumors, always check yourself
  10. Mr H.

    Skip briefing in MP Mission

    In Eden Editor >> attributes >> states >>uncheck show briefing
  11. But I think that your issue in the first video is that endLoadingScreen; is called before the loading is actually done and that's why you get the blue screen, maybe try to use waitUntil {getClientState == "GAME LOADED"}; or waitUntil {player == player}; before using endLoadingScreen; (untested I'm not sure!)
  12. maybe spawn the BIS_fnc_playVideo function and use waitUntil & scriptdone from the wiki : https://community.bistudio.com/wiki/BIS_fnc_playVideo hope this might help
  13. if you want the video to play on the display you still have to call bis fnc_playVideo after settext 030590 cutRsc ["MRHPip", "PLAIN"]; disableSerialization; _display = uiNamespace getVariable "MRHPip"; _ctrlPICHG = (_display displayCtrl 1200); _ctrlPICBD = (_display displayCtrl 1201) ctrlShow false; _video1 = "media\video\video1.ogv"; _ctrlPICHG ctrlsettext _video1; _videoplaying = [_video1, [10, 10]] call BIS_fnc_playVideo; //_ctrlSIZE = (_display displayCtrl 1203)ctrlShow false; //sleep 10; _ctrlPICHG = (_display displayCtrl 1200) ctrlShow false; _ctrlPICBD = (_display displayCtrl 1201) ctrlShow true; _ctrlPICBD = (_display displayCtrl 1201); _video2 = "media\video\video2.ogv"; _ctrlPICBD ctrlsettext _video2; _videoplaying = [_video2, [10, 10]] call BIS_fnc_playVideo; sleep 9; _display closedisplay 2; I had this that worked in a mission but not used with startLoadingScreen it states in the wiki that you can't use sleep with startLoadingScreen but uisleep instead, maybe this will help, I'm not sure.
  14. If you set your cam down with setVectorDirAndUp [[0,0,-1],[0,1,0]]; It will look down however the setdir will not work since it rotates on itself, you will have to use setVectordirAndUp again to rotate the view. However you'd be better off having the camera following an invisible target (or a set of position arrays) with camPrepareTarget & camSetTarget
  15. the texture is 2048*2048 BUT it is doubled, that's a technique bohemia uses to put two texture in one file, in other words in your pic the top part 2048*1024 will be displayed if the texture is applied to the briefing screen and the bottom part (same size) will be applied if it's on the briefing desk (maybe the other way around, I don't remember for sure) so you should get something that looks like this:
  16. I don't think you can (disable a single light), however the trick would be to detect the light source with nearestObject and delete it
  17. Just the front right light? If so maybe find and delete the light source.
  18. source: https://forums.bohemia.net/forums/topic/169161-isnull-and-undefined-variable-issue/ If you place a playable entity and no one (including AI) is slotted on it at mission start it won't be created, and no variable will be created. So isNull won't work that's why you have to use isNil instead. that's also why I use the exitWith on the second line. I exit the scope because if the variable is Nil, the following line with !(isPlayer EOD_TL) will throw an error.
  19. if no one is occupying the slot it will return true for isNil so: waitUntil {time > 20}; //(give time for players to load) if (isNil "EOD_TL") exitWith {endMission "end7"}; if !(isPlayer EOD_TL) then {endMission "end7"}; // end if and AI is in the slot
  20. You could just have added an else scope. There was no need to list all the other vests. Also this is is strange because that first line of code I posted should have worked. Putting it in on player respawn file does the same as the event handler.
  21. Mr H.

    WW2 scenarios

    It is always possible but you will have to post some specifics. If the mission maker has included such settings in their mission they will be accessible on the lobby screen. If not you will have to unpbo the mission and edit it. If that is the case make sure that you have the creator's authorization before doing so.
  22. btw: in player setVariable ["ace_medical_medicclass", 2, true]; The 2 means doctor, replace by 1 if you want them to only be simple medic, same goes for engineers, 1 means mechanic (or whatever they are called I don't remember) 2 means advanced engineer. Set to 0 To reset for both.
  23. player addEventhandler ["Respawn",{ if( vest player == "classNameOfYourVest") then {player setVariable ["ace_medical_medicclass", 2, true];}; if( "ToolKit" in items player) then {player setVariable ["ACE_IsEngineer",2,true];}; }]; put this in your initplayerlocal.sqf. Replace "classNameOfYourVest" by the desired classname
×