Jump to content

Mr H.

Member
  • Content Count

    597
  • Joined

  • Last visited

  • Medals

Everything posted by Mr H.

  1. or flags have hidden selection textures so you could change them instead of creating a new flag every time, useful if you want to use customized textures
  2. try sound[] = {"\SonidosRadio\audio1.ogg",15,1,100}; 15 is the volume, 1 is the pitch 100 is the max distance from source where sound will be heard and the path to your sound needs to be between quotes ""
  3. Mr H.

    creat a simple module

    https://community.bistudio.com/wiki/Arma_3_Module_Framework this is a good place to start but alas the example doesn't fully work. What do you want your module to do?
  4. fnc_Resize_ctrl_totext = { params ["_displayIDC","_ctrlIDC"]; _control =((findDisplay _displayIDC) displayCtrl _ctrlIDC); _myControlPos = ctrlPosition _control; _ctrlh = ctrlTextHeight _control; _xpos = _myControlPos select 0; _ypos = _myControlPos select 1; _width = _myControlPos select 2; _control ctrlSetPosition [_xpos,_ypos ,_width ,_ctrlh]; _control ctrlCommit 0; }; call it with the idd of yourdisplay & the idc of the controm you want to resize (after putting the text) eg. [123456,1600] call fnc_resize_ctrl_totext
  5. Hey, I'm interested in that example if you still have it!
  6. Do you have a land contact lod? It might help
  7. lbSetData [1001, 0, name _unit]; in your other script: _selectedPlayer = [lbData [ 1001, (lbCurSel 1001)]]; _selectedPlayerConverted = objNull; { if (str _x == _selectedPlayer) then {_selectedPlayerConverted = _x}; }forEach allUnits; and now selectedPlayerConverted is your unit
  8. Mr H.

    Force player pace

    Yes, I have tried that, it works but you'd have to basically relink every animation, eg walking is not just one animation, there's one for strafing left , strafing right, moving backwards etc. Doing that for every available pace would be loooonngg and painful, and also I don't know if it will have effects on stamina etc. I will do this only if I do not find a better solution... My end goal is to produce a mod that would allow you to change your pace with ctrl + scrollwheel (like you can in escape from tarkof for example), there has to be commands and functions for character movement but alas except for forcewalk none of them have been made public by BI...
  9. I did this once, it's kind of half-assed and it kind of worked, it's definetly not perfect, I used INDE as enemies because their allegiance can be switched midgame. So make Independants friendly to Bluefor then execute this code on every player's machine: undercover = true; publicVariable "undercover"; weapinhand = false; detected = false; indeguys = []; knowsaboutplayer = []; seesplayer = []; {if ((side _x) == resistance) then {indeguys = indeguys + [_x]}} forEach allUnits; sleep 1; /////////detecte si le joueur a une arme en main et définit la variable weapinhand true ou false [] spawn { while {undercover} do { { weaponequipped = currentWeapon _x; if (weaponequipped == "") then { _x setVariable ["weapinhand", false];} else { _x setVariable ["weapinhand", true];}; } forEach allplayers; sleep 0.5; }; }; sleep 1; ///////////verifie si le joueur est detecté while {undercover} do { {dist = _x distance player; if (dist < 10) then {seesplayer = seesplayer + [_x]} else {seesplayer = seesplayer - [_x]} } forEach indeguys; sleep 0.5; {seen = _x knowsabout player; if (seen > 0.3) then {knowsaboutplayer = knowsaboutplayer + [_x]} else {knowsaboutplayer = knowsaboutplayer - [_x]} } forEach seesplayer; sleep 0.5; weapinhand = player getVariable "weapinhand"; sleep 0.5; {if (weapinhand) then { detected = true; publicVariable "detected"; } } forEach knowsaboutplayer; sleep 0.05; }; when the variable "detected" is set, execute the following code either through a mission eventhandler or a trigger: west setFriend [independent, 0]; independent setFriend [west, 0]; As I said, this is fffffffffffaaaar from perfect but it worked in my mission in MP, it just detect players if they have a weapon in their hands, weapons mus be concealed in their uniforms. This is just a pointer you will have to improve i greatly
  10. everything is explained here (I wonder why they didn't put it on the ace framework page): https://code.clearbackblast.com/snippets/58
  11. yes it figures! thanks for the help!
  12. Hi, I have a script that I need to run server side on a dedicated server, but I also need the script to run only after the first client has joined and is ingame because my serverside script must detect its position. I have used an overcomplicated and unsatisfying method to that and I was wondering how you guys would go about it.
  13. i have tried waitUntil {!isNil "allplayers select 0"}; but it didn't work, I will try your solution
  14. yeah that's a good Idea! I'm to lazy to retexture every lod separatly, I just wanted to check that the different Lods I had created were working properly.
  15. Quick question, for debug purposes, is there a function or a command that returns which LOD is currently shown by the engine?
  16. Hi! This is my very first try at making an object and importing it into arma 3, I have modeled a simple object in Blender and imported it into Object Builder, my object is and inventory object (defined in cfgWeapons children class of CBA_MiscItems). Everything looks fine when I take the object out of my inventory to put it on the ground it has the correct model. The only issue is that the object is kind of "standing up" while I'd like it to be laying on the ground. In OB the object was correctly positioned laying flat. Can anybody give me pointers to fix this?
  17. @Jackal326 that's what I did eventually. @Dedmen I tried the land contact Lod but it didn't work. Thanks for the info about the invisible container, I didn't know that. I'm trying to add an addaction to inventory object directly from the config and obviously it doesn't work, I know why now!
  18. yup I already checked before asking but I have a vague memory of stumbling across something like that, I've checked the functions too but couldn't find anything.
  19. kcgrims I had tried your solution with local _x, and it didn't work. It seems to me that moveIncargo si bugged with remote exec on dedi servers, my solution is a workaround. + it is my understanding that this: [[],{player moveInCargo xplane}] RemoteExec ["Spawn",0,true]; will run the code on everymachine so if the player is local where the code executes (everywhere because of the 0) the player will be moved inside the vehicle. You wouldn't need allplayers then ==> That didn't work also the wiki for remote exec states: "String - the function will be executed only where object or group defined by the variable with passed name is local" so local _x is not necessary in your code and I tried it and it didn't work. I agree that both your solutions are simpler and more elegant, problem is they don't work because... arma.
  20. I'm trying to teleport all players in a vehicle at some point in the mission (in MP, on a dedicated server) {_x moveInCargo xplane} forEach allplayers; won't work but I think that's normal because 'player' can't be passed to another machine in MP but what's stranger is that this: [[],{player moveInCargo xplane}] RemoteExec ["Spawn",0,true]; won't work either, it only moves one player inside the plane I've even tried this {[[],{player moveInCargo xplane}] RemoteExec ["Spawn",_x,true];} forEach allPlayers; with the same result. Ive tried giving variable names to playable units eg. allPlayersSpecial = [p1,p2,p3, etc.]; {_x moveInCargo xplane} forEach allPlayerSpecials; same results [[],"introscript\intro.sqf"] RemoteExec ["ExecVM",0,true]; where intro.sqf contains a bunch of stuff and the line player moveInCargo xplane ==> the other stuff will run fine for all other players, but they won't be moved inside the plane... Any ideas, solutions?
  21. For anyone stumbling into this I have found a working solution: //eg [allplayers,plane] call MRH_fnc_MoveInCargo; MRH_fnc_MoveInCargo = { Params ["_groupOfplayers", "_vehicle"]; { //this scope will be remote executed for all given players [[_vehicle,_x],{ Params ["_vehicle","_entityToMove"]; if (isPlayer _entityToMove) then {_entityToMove = player};//might not be necessary //innermost scope create trigger localy //step 0 generate a random contion variable //step 1 pass the variables to the player _trg = createTrigger ["EmptyDetector", [0,0,0],false]; _trg setVariable ["MRH_MoveInCargoVeh",_vehicle]; _trg setVariable ["MRH_MoveInCargoEntity",_entityToMove]; //step 2 create the trigger, get the variables from player _trg setTriggerActivation ["NONE", "PRESENT", false]; _trg triggerAttachVehicle [player]; _trg setTriggerStatements ["true", " _veh = thisTrigger getVariable 'MRH_MoveInCargoVeh'; _entityToMove = thisTrigger getVariable 'MRH_MoveInCargoEntity'; _entityToMove moveInCargo _veh; deleteVehicle thisTrigger; " , ""]; }] RemoteExec ["Call",_x,true]; } forEach _groupOfplayers; };
  22. Hey I know that it's a bit late... But I bump this up with a workin and tested solution for anyone interested: //eg [allplayers,plane] call MRH_fnc_MoveInCargo; MRH_fnc_MoveInCargo = { Params ["_groupOfplayers", "_vehicle"]; { //this scope will be remote executed for all given players [[_vehicle,_x],{ Params ["_vehicle","_entityToMove"]; if (isPlayer _entityToMove) then {_entityToMove = player};//might not be necessary //innermost scope create trigger localy //step 0 generate a random contion variable //step 1 pass the variables to the player _trg = createTrigger ["EmptyDetector", [0,0,0],false]; _trg setVariable ["MRH_MoveInCargoVeh",_vehicle]; _trg setVariable ["MRH_MoveInCargoEntity",_entityToMove]; //step 2 create the trigger, get the variables from player _trg setTriggerActivation ["NONE", "PRESENT", false]; _trg triggerAttachVehicle [player]; _trg setTriggerStatements ["true", " _veh = thisTrigger getVariable 'MRH_MoveInCargoVeh'; _entityToMove = thisTrigger getVariable 'MRH_MoveInCargoEntity'; _entityToMove moveInCargo _veh; deleteVehicle thisTrigger; " , ""]; }] RemoteExec ["Call",_x,true]; } forEach _groupOfplayers; }; execute the code globally (eg from init) but call the function only locally it handles locality on its own. Tested in MP on a dedi. First parameter needs to be an array, second the target vehicle eg: [[player1, player2,etc ], plane] call MRH_fnc_MoveInCargo; or [allplayers,plane] call MRH_fnc_MoveInCargo;
  23. //eg [allplayers,plane] call MRH_fnc_MoveInCargo; MRH_fnc_MoveInCargo = { Params ["_groupOfplayers", "_vehicle"]; { //this scope will be remote executed for all given players [[_vehicle,_x],{ Params ["_vehicle","_entityToMove"]; if (isPlayer _entityToMove) then {_entityToMove = player};//might not be necessary //innermost scope create trigger localy //step 0 generate a random contion variable //step 1 pass the variables to the player _trg = createTrigger ["EmptyDetector", [0,0,0],false]; _trg setVariable ["MRH_MoveInCargoVeh",_vehicle]; _trg setVariable ["MRH_MoveInCargoEntity",_entityToMove]; //step 2 create the trigger, get the variables from player _trg setTriggerActivation ["NONE", "PRESENT", false]; _trg triggerAttachVehicle [player]; _trg setTriggerStatements ["true", " _veh = thisTrigger getVariable 'MRH_MoveInCargoVeh'; _entityToMove = thisTrigger getVariable 'MRH_MoveInCargoEntity'; _entityToMove moveInCargo _veh; deleteVehicle thisTrigger; " , ""]; }] RemoteExec ["Call",_x,true]; } forEach _groupOfplayers; }; Tested in MP on dedi, works like a charm!
  24. //eg [allplayers,plane] call MRH_fnc_MoveInCargo; MRH_fnc_MoveInCargo = { Params ["_groupOfplayers", "_vehicle"]; { //this scope will be remote executed for all given players [[_vehicle,_x],{ Params ["_vehicle","_entityToMove"]; if (isPlayer _entityToMove) then {_entityToMove = player};//might not be necessary //innermost scope create trigger localy //step 0 generate a random contion variable _condition = round (random [1,500,1000]); _condition = "MRH_MoveinCargoCond_" + (str _condition); //step 1 pass the variables to the player _trg = createTrigger ["EmptyDetector", [0,0,0],false]; _trg setVariable ["MRH_MoveInCargoCondition",_condition]; _trg setVariable ["MRH_MoveInCargoVeh",_vehicle]; _trg setVariable ["MRH_MoveInCargoEntity",_entityToMove]; //step 2 create the trigger, get the variables from player _trg setTriggerActivation ["NONE", "PRESENT", false]; _trg triggerAttachVehicle [player]; _trg setTriggerStatements ["missionNameSpace getVariable (thisTrigger getVariable 'MRH_MoveInCargoCondition');", " _veh = thisTrigger getVariable 'MRH_MoveInCargoVeh'; _entityToMove = thisTrigger getVariable 'MRH_MoveInCargoEntity'; _entityToMove moveInCargo _veh; deleteVehicle thisTrigger; " , ""]; //Step 3 activate the trigger missionNamespace setVariable [_condition, true]; }] RemoteExec ["Call",_x,true]; } forEach _groupOfplayers; }; Might work! Let's test it asap!
  25. yes, where you respawn doesn't matter
×