Jump to content

jshock

Member
  • Content Count

    3059
  • Joined

  • Last visited

  • Medals

  • Medals

Everything posted by jshock

  1. 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.
  2. kavalaMarker nearObjects [(validHouse call BIS_fnc_selectRandom), 500]; Nevermind, started thinking about it, not as easy as that :P.
  3. 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.
  4. 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 [ ].
  5. 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 :).
  6. 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.
  7. Startup Parameters RPT + others
  8. And need to know if your running any mods/addons.
  9. I would add the postInit attribute to the function, to ensure all objects have been created before running the module function.
  10. 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;
  11. jshock

    if - else

    " " 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?
  12. 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;
  13. 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.
  14. 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.
  15. 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'}"]; };
  16. 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.
  17. Or you could setup a Get Out EH: https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#GetOut
  18. Probably doesn't specifically reference that because it's not about module framework, that's a function framework issue.
  19. 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.
  20. 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 {}; }; }; };
  21. What does your config look like?
  22. 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.
  23. 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.
  24. Should just need: _currentSpawns = ["AH-9", "MH-9", "Other class names... etc..."] { deleteVehicle _x; } forEach nearestObjects [getMarkerPos "formation2",_currentSpawns,25];
×