Jump to content

jshock

Member
  • Content Count

    3059
  • Joined

  • Last visited

  • Medals

  • Medals

Everything posted by jshock

  1. jshock

    Script MP/JIP Compatibility

    @Rawner, it honestly depends on where you need to execute those functions, on the clients (need to ensure you run it locally on all clients), the server only (make sure to run server side only), or both client and server.
  2. jshock

    Script MP/JIP Compatibility

    No, I'm saying move the script call to the initPlayerLocal.sqf instead of the init.sqf or the init fields of each playable character. Event Scripts
  3. Scripts are good for something like adding magazines to a player's inventory: player addMagazines ["someMagazineClass",5]; A function is good for returning a result, after some calculation on an input value, so let's say I want a function to return the distance of the player from some object: fnc_returnDistanceBetween = { _unit = (_this select 0); _object = (_this select 1); _distanceBetween = _unit distance _object; _distanceBetween;//return value line }; //Example call of the function would be: _returnedDistance = [player,object1] call fnc_returnDistanceBetween;
  4. jshock

    Script MP/JIP Compatibility

    Execute the script in the initPlayerLocal.sqf instead of the init.sqf or the init field of each unit..
  5. jshock

    Prevent respawn

    I would assume that a Killed EH would fire after someone bleeds out, so with that, simply attach a Killed EH to every player (via initPlayerLocal.sqf), and within that execute BIS_fnc_endMissionServer. Or any other means of letting the player's know they've failed the mission, and end it however you see fit.
  6. jshock

    Checking help.

    Well, let's see, what is it supposed to do, since I can't read your code, and what is it not doing or not working? And it would be a plus if you could provide the area of the code that would more than likely handle the portion that isn't working, so I don't go crossed-eyed trying to find it.
  7. jshock

    Mod not loading init.sqf

    Could you not just make the init file a function file, then execute the function via CfgFunctions with the postInit attribute?
  8. For in a trigger area (I believe it actually works directly for markers as well): https://community.bistudio.com/wiki/BIS_fnc_inTrigger
  9. What might be a good idea, in parrellel to what Dreaded stated above, is to look for a number of devs willing to help out and get a short resume on what they have done scripting wise, and with that you should have a good idea as to what they can do, at this point you should be able to go to one of the devs in the pool and say "hey I need a building garrison function that allows x, y, and z" let that dev work on it, let them know of any global information that would be needed (i.e. an array of the units added via the function), and then have your "integrator" like Dreaded said above integrate the function into the whole system or if there seem to be issues report that back to the dev so they can fix it. So instead of limiting yourself to a single, 24/7, extra hand on the project, have 10 that are willing to help on a "one-off" basis.
  10. Well, it's saying there are 3 arguments, expecting none, 1 or 2, so try: ["Your map has been updated with an marker. Search and destroy enemy weapons cache.","PLAIN",1] remoteExec ["titleText",0];
  11. initServer would be a good, and for titleText you can use BIS_fnc_MP to broadcast: [["Text Here","PLAIN",1],"titleText",true,false,false] call BIS_fnc_MP; Or the new remoteExec: ["Text Here","PLAIN",1] remoteExec ["titleText",0,false];
  12. It should yes, as long as you use "createMarker" and not "createMarkerLocal" or other "local" commands related to the marker scripting group.
  13. TBH, both cases are bad in an MP battle scenario, it's either a microfreeze due to conditional checking or a delayed execution, either of which could get you killed.
  14. { _waypointPos = _x addWaypoint [[_shootingRange select 0, _shootingRange select 1, 0],0]; _waypointPos setWaypointType "MOVE"; } forEach [_group1,_group2];
  15. What does _this show as its arguments coming into the function? I assume "(_this select 0)" in the init attribute in the Civilian class is the actual unit, I've never actually done anything from the Civilian class before so just checking.
  16. Well, this will be my first question in the forums in I don't know how long, and I'm having a bit of trouble trying to articulate the question into something understandable, so bear with me :D. I feel I am either overthinking this or it's not possible to accomplish what I want, or I'm just missing some necessary knowledge. So, I am working with a KeyDown displayEH, the "key press" that I check for is the actionKeys within a User Custom Action. I can get the code to execute perfectly when a single key is defined and pressed (i.e. 'Y'), but the issue that arises is when I do a combination of a key with control/shift/alt (i.e. "Left Ctrl + Y"). I know that within the EH you can check to see if control/shift/alt have been pressed, however, I cannot check to see if the user has defined control/shift/alt as an additional key that needs to be pressed in conjunction with another key (i.e. 'Y'). The command "actionKeys" returns an array of all the keys defined for that particular action (under configure>controls), for example, if the only key I have defined for custom User Action #9 is 'Y' the return of the command would be: [21] Which is easy enough to check within the EH by: (_this select 1) in actionKeys "User9" However, if I have the keybind set to "Left Ctrl + Y" it returns: [4.86539e+008] Which within the scope of this particular EH instance would return true that a control key is pressed, however, as far as I can tell, I can't check to make sure 'Y' is pressed along with it because the keybinding value of "Left Ctrl + Y" is some large number of (I assume) the two combined key values. So, question being, how would I calculate combined key values to be able to check against what is being returned by actionKeys, or what other means by which can I check to see if any particular key combination defined within a User Custom Action are pressed at the same time. And again stating that I feel I may simply be overthinking this as I've looked at this code quite late the last few nights, but still can't come to a final working set of code. Here is a semi-psuedo as to what I'm after (doing): fnc_checkKeyBinding = { /*????*/ }; (findDisplay 46) displayAddEventHandler [ "KeyDown", { _handled = false; if ([_this] call fnc_checkKeyBinding) then { [] call fnc; _handled = true; }; _handled; } ];
  17. Have you checked the output of "vehicleVarName _this"?
  18. You could check with the codePerformance function, but I would say for something simple like this with only two possible conditions the if-then-else would be the faster option.
  19. Your script is requiring an argument to be passed when executed (which would be _this select 0): fnc_Gear2 = { switch (_this select 1) do { case "PL":{[(_this select 0)] call fnc_removeall;}; case "PL2":{[(_this select 0)] execVM "scripts\loadouts\PL2.sqf";}; case "PS":{[(_this select 0)] execVM "scripts\loadouts\PS.sqf";}; case "PS2":{[(_this select 0)] execVM "scripts\loadouts\PS2.sqf";}; case "FRO":{[(_this select 0)] execVM "scripts\loadouts\P22.sqf";}; }; };
  20. Yea that's the problem with this whole thing thus far is the shear number of possible inputs you have to look for, and each has its own challenges in checking to see if it has occurred or not. -Single key (number/character) -Single key (ctrl/shift/alt) -Two keys (number/character-ctrl/shift/alt) -Two keys (number/character-number/character) -Two keys (ctrl/shift/alt-ctrl/shift/alt) -Double tapped key -And probably some other combinations The nice thing (as far as I saw) is the custom user action bindings can only go up to two keys per binding. Note on implementation of aforementioned code, I haven't had a lot of time this week to test and what not, hopefully have something together by end of week, early next week.
  21. I would use the initPlayerLocal.sqf or if you are doing respawns, place all in the onPlayerRespawn.sqf.
  22. He is putting if !(isServer) exithWith {}; at the beginning of his script, therefore, ensuring that only the server can proceed with the rest of the script.
  23. Yea it should ensure that only the server runs it on missions start, you could do it your way or in the object init: if (isServer) then {/*script execution*/};
  24. Are you spawning the carrier at mission start? And the server check at the top should fix it yes, but if you spawn it at mission start all you need to do is move the script execution into the initServer.sqf.
×