-
Content Count
3059 -
Joined
-
Last visited
-
Medals
-
Medals
Everything posted by jshock
-
preventing a script from running on all clients
jshock replied to ninja8889's topic in ARMA 3 - MISSION EDITING & SCRIPTING
The extent of my knowledge lays with what Johnny put above, but to specifically put it in the "init" line, I believe there is an attribute within the Man class (or one of its daughters) that you could override with a function or string of functions on unit spawn/init. -
Select random building from multiple near a map marker.
jshock replied to Warner's topic in ARMA 3 - MISSION EDITING & SCRIPTING
kavalaMarker nearObjects [(validHouse call BIS_fnc_selectRandom), 500]; Nevermind, started thinking about it, not as easy as that :P. -
Passing arguments to BIS_fnc_addStackedEventHandler help!
jshock replied to beako's topic in ARMA 3 - MISSION EDITING & SCRIPTING
It may just be a copy/paste error, but could cause an issue, when defining _grp, your're missing a semicolon at the end of that line. -
Passing arguments to BIS_fnc_addStackedEventHandler help!
jshock replied to beako's topic in ARMA 3 - MISSION EDITING & SCRIPTING
The arguements your're passing into the function within the stackedEH call don't exist, so you need to instantiate those variables before adding the stackedEH, then "_this" within the code executed in the stackedEH will actually contain defined values for the draw function to use. Also looking at it a bit further you may want the code that is executed by the stackedEH to look like this: _this spawn BEAKS_fnc_draw3DNEW;Notice the removal of the [ ]. -
Deployable Patrol base aka moveable respawn point
jshock replied to dkraver's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Question 1: Yes. Question 2: Somewhere in-between Question 3: There are plenty of capable people here that can help you, I would but I have a limited understanding of the respawn system outside of just "base" respawn. Also where the more "advanced" things come into play is linking a revive system with the respawn, the physical creation and deletion of the patrol base itself is simple enough. Sorry I'm limited to my phone and cannot provide adequet example code to point you in the right direction, but figured I could at least answer your other questions :). -
Passing arguments to BIS_fnc_addStackedEventHandler help!
jshock replied to beako's topic in ARMA 3 - MISSION EDITING & SCRIPTING
It's because these variables: _randomSectorDestination, _info, _grp, don't exist in the scope of the addStackedEventHandler call. They exist in the draw function, but not outside of it. -
A basic scripting question.
jshock replied to stowed4sea's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Startup Parameters RPT + others -
effects/ is not a class - problem
jshock replied to Undeceived's topic in ARMA 3 - MISSION EDITING & SCRIPTING
And need to know if your running any mods/addons. -
Custom Module - Error Zero Divisor
jshock replied to ovibag's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I would add the postInit attribute to the function, to ensure all objects have been created before running the module function. -
How to allow "friendly fire"?
jshock replied to BEAKSBY's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Try something more like this: { if (side _x isEqualTo WEST) then { _x addEventHandler [ "HandleDamage", { _returnDamage = (_this select 2); if ((side (_this select 0)) isEqualTo (side (_this select 3))) then { _returnDamage = 0; }; _returnDamage; } ]; }; } forEach allUnits; -
" " work just as good as { }, sure { } are easier to work with, but something else isn't working here, and changing _this select 1 would break it further. What do your two scripts look like?
-
Exit scripthandle if other scripthandle is executed.
jshock replied to davidoss's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Try something more like this, just re-work your logic on it: [west, "escort", ["Escort the Afghan Militia High Commander to Base.", "Escort AMHC", "Escort AMHC"], getMarkerPos "respawn_west", true] spawn BIS_fnc_taskCreate; ["escort", "CREATED",true] call BIS_fnc_taskSetState; script_handler = [] spawn { waitUntil {warlord distance getMarkerPos "respawn_west" < 50 AND (vehicle warlord == warlord) AND (alive warlord) }; }; waitUntil {!alive warlord || scriptDone script_handler}; if (!alive warlord) then { ["escort", "FAILED", true] call BIS_fnc_taskSetState; [west, "HQ"] sideRadio "task_failed"; } else { ["escort", "SUCCEEDED", true] call BIS_fnc_taskSetState; [west, "HQ"] sideRadio "good_job"; }; deleteMarker _markerwlord; ["capture", west] call BIS_fnc_deleteTask; ["escort", west] call BIS_fnc_deleteTask; -
Specific unit that can run a script
jshock replied to AdirB's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Sorry for not being on to answer back soon enough, but seeing how you already started another thread and got the answer: https://forums.bistudio.com/topic/184371-if-else/ That was a copy/paste error on me, but for future reference, turn on the "showScriptErrors" startup parameters. -
Specific unit that can run a script
jshock replied to AdirB's topic in ARMA 3 - MISSION EDITING & SCRIPTING
waituntil {!(IsNull (findDisplay 46)) _keyDown = (findDisplay 46) displayAddEventHandler [ "KeyDown", " if (_this select 1 == 199) then { if (typeOf player isEqualTo 'B_RangeMaster_F') then { _open = player execVM 'dialogs\open_tablet_dialog.sqf'; } else { //execute some other script }; }; " ]; Something more like this is I believe what you want. -
Specific unit that can run a script
jshock replied to AdirB's topic in ARMA 3 - MISSION EDITING & SCRIPTING
How exactly to you have the unit's separated, as in do you have them named in the editor, are you looking for a specific player ID, etc. If the unit's are named in the editor: if (player isEqualTo solider1) then { waituntil {!(IsNull (findDisplay 46))}; _keyDown = (findDisplay 46) displayAddEventHandler ["KeyDown", "if (_this select 1 == 199) then {_open = player execVM 'dialogs\open_tablet_dialog.sqf'}"]; }; -
Specific unit that can run a script
jshock replied to AdirB's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Expand on "specific" unit. -
Locality yes, from the addAction wiki page: So you need to add the action on every client via something like BIS_fnc_MP: [[_unit,["Hello","COS\civ_bomb.sqf"]],"addAction",true,true,false] call BIS_fnc_MP; [[_unit,["Hello",{null=[_unit] execVM "COS\civ_bomb.sqf"}]],"addAction",true,true,false] call BIS_fnc_MP; Sorry if the syntax is a bit off, but you get the idea.
-
Trigger to check when player leaves a vehicle
jshock replied to chondo999's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Or you could setup a Get Out EH: https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#GetOut -
Error with making a module.
jshock replied to JasperRab's topic in ARMA 3 - ADDONS - CONFIGS & SCRIPTING
Probably doesn't specifically reference that because it's not about module framework, that's a function framework issue. -
get unit in turret of the tank
jshock replied to jts_2009's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Look at this page for some more context on the "turretPath" argument: https://community.bistudio.com/wiki/moveInTurret And trial and error til you get the one your looking for. -
Error with making a module.
jshock replied to JasperRab's topic in ARMA 3 - ADDONS - CONFIGS & SCRIPTING
It's because your function "etr_modules_fnc_test", doesn't exist, because you haven't defined a "tag" for your functions in CfgFunctions, so you need to do the following to make it work the way you want: class CfgFunctions { class etr_operation_assets_modules_test { tag = "etr_modules"; class Test { file = "\etr_operation_assets\Modules\test\Functions"; class test{}; }; }; }; Here is an example of how my custom module setup looks like, using my simple garrison function: class CfgPatches { class JSHK_garrison { units[] = {"JSHK_garrisonModule"}; requiredVersion = 1.0; requiredAddons[] = {"A3_Modules_F"}; }; }; class CfgFactionClasses { class JSHK; class JSHK_garrisonClass: JSHK { displayName = "JSHK - Garrison"; }; }; class CfgVehicles { class Logic; class Module_F: Logic { class ArgumentsBaseUnits { class Units; }; class ModuleDescription { class EmptyDetector; }; }; class JSHK_garrisonModule: Module_F { scope = 2; displayName = "JSHK - Garrison"; category = "Garrison"; function = "JSHK_fnc_garrison"; functionPriority = 1; isGlobal = 0; isTriggerActivated = 1; isDisposable = 1; curatorInfoType = "RscDisplayAttributegarrisonModule"; class Arguments: ArgumentsBaseUnits { // Arguments shared by specific module type (have to be mentioned in order to be placed on top) class Units: Units {}; class JSHK_garrisonSide { displayName = "Side of Garrisoned Units"; // Argument label description = "Choose One"; // Tooltip description typeName = "STRING"; // Value type, can be "NUMBER", "STRING" or "BOOL" class values { class EAST {name = "EAST"; value = "east"; default = 1;}; // Listbox item class WEST {name = "WEST"; value = "west";}; class INDEPENDENT {name = "INDEPENDENT"; value = "independent";}; class CIVILIAN {name = "CIVILIAN"; value = "civilian";}; }; }; class JSHK_garrisonRadius { displayName = "Garrison Radius"; // Argument label description = ""; // Tooltip description typeName = "NUMBER"; // Value type, can be "NUMBER", "STRING" or "BOOL" defaultValue = 200; }; class JSHK_garrisonPercent { displayName = "Building Fill Percentage"; // Argument label description = "Must be between 0-1"; // Tooltip description typeName = "NUMBER"; // Value type, can be "NUMBER", "STRING" or "BOOL" defaultValue = 0.2; }; class JSHK_garrisonLimit { displayName = "Limit Units Spawned"; // Argument label description = ">(-1) overwrites percent fill, (-1) to use percent"; // Tooltip description typeName = "NUMBER"; // Value type, can be "NUMBER", "STRING" or "BOOL" defaultValue = -1; }; class JSHK_garrisonUnits { displayName = "Types of Units"; // Argument label description = "Array of Classnames"; // Tooltip description typeName = "ARRAY"; // Value type, can be "NUMBER", "STRING" or "BOOL" defaultValue = ["O_Soldier_F","O_Soldier_AR_F"]; }; }; class ModuleDescription: ModuleDescription { description = "J.Shock Garrison Module"; sync[] = {}; position = 1; // Position is taken into effect direction = 0; // Direction is taken into effect }; }; }; class CfgFunctions { class JSHK { tag = "JSHK"; class Garrison { file = "JSHK_garrison"; class garrison {}; class buildingPositions {}; }; }; }; -
Error with making a module.
jshock replied to JasperRab's topic in ARMA 3 - ADDONS - CONFIGS & SCRIPTING
What does your config look like? -
Rules for 'detected by' triggers
jshock replied to magicpanda's topic in ARMA 3 - MISSION EDITING & SCRIPTING
If your're using "getPosATL" you don't need [ ] around it, and you could just do it directly in the script call, i.e.: 0 = [(getPosATL (thisList select 0))] execVM "mortargunner1Loop.sqf"; *You also had the arguments and the "execVM" flipped. -
Defined a Variable in one line, use it in the next; says undefined?
jshock replied to thecoolsideofthepillow's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Well, the vehicle may not be actually created, it depends on what "(_this select 1)" is, so a little more context on your script would help. -
How to make a list to delete from?
jshock replied to bspendlove's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Should just need: _currentSpawns = ["AH-9", "MH-9", "Other class names... etc..."] { deleteVehicle _x; } forEach nearestObjects [getMarkerPos "formation2",_currentSpawns,25];