-
Content Count
3059 -
Joined
-
Last visited
-
Medals
-
Medals
Everything posted by jshock
-
Script MP/JIP Compatibility
jshock replied to jordanbache97's topic in ARMA 3 - MISSION EDITING & SCRIPTING
@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. -
Script MP/JIP Compatibility
jshock replied to jordanbache97's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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 -
Difference between functions and scripts
jshock replied to emrak's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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; -
Script MP/JIP Compatibility
jshock replied to jordanbache97's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Execute the script in the initPlayerLocal.sqf instead of the init.sqf or the init field of each unit.. -
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.
-
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.
-
Mod not loading init.sqf
jshock replied to tortuosit's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Could you not just make the init file a function file, then execute the function via CfgFunctions with the postInit attribute? -
Creating limiting borders for map click.
jshock replied to Ilias38rus's topic in ARMA 3 - MISSION EDITING & SCRIPTING
For in a trigger area (I believe it actually works directly for markers as well): https://community.bistudio.com/wiki/BIS_fnc_inTrigger -
Recruiting 1 dev for our mission framework ! job will be payed !
jshock replied to doomnet's topic in ARMA 3 - FIND OR OFFER EDITING
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.- 6 replies
-
- 1
-
- developper
- script
-
(and 3 more)
Tagged with:
-
Working out trigger for bigger project.
jshock replied to thedubl's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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]; -
Working out trigger for bigger project.
jshock replied to thedubl's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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]; -
Working out trigger for bigger project.
jshock replied to thedubl's topic in ARMA 3 - MISSION EDITING & SCRIPTING
It should yes, as long as you use "createMarker" and not "createMarkerLocal" or other "local" commands related to the marker scripting group. -
[Discussion] Async keyDown EventHandler, what you think? What could be improven?
jshock replied to KernelPanicAkr's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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. -
addWaypoint to multiple Groups
jshock replied to bspendlove's topic in ARMA 3 - MISSION EDITING & SCRIPTING
{ _waypointPos = _x addWaypoint [[_shootingRange select 0, _shootingRange select 1, 0],0]; _waypointPos setWaypointType "MOVE"; } forEach [_group1,_group2]; -
prevent addeventhandler on specific unit.
jshock replied to davidoss's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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. -
Checking Multi-key Return Value KeyDown DisplayEH
jshock posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
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; } ]; -
prevent addeventhandler on specific unit.
jshock replied to davidoss's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Have you checked the output of "vehicleVarName _this"? -
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.
-
How to use addAction in editor placed Helicopter and Respawn Module
jshock replied to csk222's topic in ARMA 3 - MISSION EDITING & SCRIPTING
https://community.bistudio.com/wiki/createVehicleCrew- 12 replies
-
- addaction
- respawn module
-
(and 1 more)
Tagged with:
-
switch / do script not working - noob help please
jshock replied to kOepi's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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";}; }; }; -
Checking Multi-key Return Value KeyDown DisplayEH
jshock replied to jshock's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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. -
how to make an array with setPosATL & setDir positions for MP respawn ?
jshock replied to doomnet's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I would use the initPlayerLocal.sqf or if you are doing respawns, place all in the onPlayerRespawn.sqf. -
Spawning carrier duplicates on JIP?
jshock replied to schadler17's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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. -
Spawning carrier duplicates on JIP?
jshock replied to schadler17's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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*/}; -
Spawning carrier duplicates on JIP?
jshock replied to schadler17's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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.