Jump to content

wogz187

Member
  • Content Count

    823
  • Joined

  • Last visited

  • Medals

Everything posted by wogz187

  1. wogz187

    Adding init to spawned group

    @xXPinkFloyd92Xx, I don't have ACE installed so I tested with, (units ((player modelToWorld [0,5,0]) call fnc_createGrouplost)) apply {systemChat str _x}; I can't account for what happens inside the apply scope.
  2. wogz187

    Adding init to spawned group

    @xXPinkFloyd92Xx, Have fun!
  3. @sizraide, _markerArray = ["l_1", "l_2", "l_3", "l_4", "l_5", "l_6", "l_7", "l_8", "l_9", "l_10"]; _IEDarray = ["IEDUrbanSmall_Remote_Ammo","IEDLandSmall_Remote_Ammo","IEDUrbanBig_Remote_Ammo","IEDLandBig_Remote_Ammo"]; _markerArray apply { private _veh= (selectRandom _iedArray) createVehicle (getMarkerPos _x); _veh spawn { waitUntil { sleep 1; if !((_this nearEntities ["Man", 20]) select {_x in allPlayers} isEqualTo []) then {_this setDamage 1}; !alive _this } }; _veh }; Create an IED at each marker position. Detonation radius is set to 20 which you may change as you please. Have fun!
  4. wogz187

    AI interaction

    It's a relatively simple function, MMF_fnc_conversation={ { _this addAction [(_x #0), { params ["_target", "_caller", "_actionId", "_arguments"]; [(getDir _caller)-180] apply {_target setFormDir _x; _target setDir _x}; private _prompt= _target getVariable ["you_prompt", [""]]; [ [name _caller, (_prompt select _actionID select 1)], [name _target, (_arguments select 0), (_arguments #1)] ] spawn BIS_fnc_EXP_camp_playSubtitles; [_target, _caller] spawn (_arguments #2) },(_this getVariable ["you_dialog", []] select _forEachIndex),9,false, true,"", "alive _target", 3] }forEach (_this getVariable ["you_prompt", []]) }; with a lot of instructions, Have fun!
  5. wogz187

    Having trouble with _this

    this spawn { waitUntil {sleep 1; if alive _this then {systemChat str _this}; !alive _this } } [this, name this, group this] call { params ["_unit", "_name", "_grp"]; _this spawn { waitUntil {sleep 1; if alive (_this #0) then {systemChat str _this}; !alive (_this #0) } } } _this is the argument(s) passed to a script. A magic variable from which other variables may be derived. THIS is just another way to refer to the unit, object, vehicle into which you paste script. If you name a unit "bob" then THIS is bob in bob's init field. Have fun!
  6. @Play3r, Here's a more recent version that handles weapon dropping, It will work in a loop, { _x addEventHandler... }foreach allUnits select {side _x == EAST}; Change "this" to "_x" inside forEach. Have fun!
  7. wogz187

    Remove Item from Inventory

    Remove all this classname from the calling unit, [this, "ACE_plasmaIV_250"] call {{(_this #0) removeItem _x} forEach (((uniformItems (_this #0) + vestItems (_this #0) + backpackItems (_this #0))) select {_x== (_this #1)})} If you'll be calling this often, you_remove_strings= { {(_this #0) removeItem _x} forEach (((uniformItems (_this #0) + vestItems (_this #0) + backpackItems (_this #0))) select {_x== (_this #1)}) }; //call [this, "ACE_plasmaIV_250"] call you_remove_strings Have fun!
  8. wogz187

    Associate smoke to object

    @Coladebote, Try the alt-syntax of createVehicle, private _fire = createVehicle ["test_EmptyObjectForSmoke", getMarkerPos "SMOKE_1", [], 0, "CAN_COLLIDE"]; Have fun! smoke_effect={ if !isServer exitWith {}; params [["_pos", [0,0,0]], ["_time", 900], ["_mark", ""], ["_effect", ["Land_d_House_Small_02_V1_F", "test_EmptyObjectForSmoke"]], ["_code", {{deleteVehicle _x} forEach _this}], ["_arr", []]]; if !(_mark isEqualTo "") then {(createMarker [_mark, _pos]) setMarkerShape "ICON"}; {private _veh= createVehicle [_x, _pos, [], 0, "CAN_COLLIDE"]; _arr pushBack _veh}forEach _effect; [_arr, _time, _code] spawn { params ["_arr", "_time", "_code"]; sleep _time; _arr spawn _code }; _arr }; EXAMPLES: Your coordinates, default params [[13413.9,6621.1]] call smoke_effect 10 second test, [(player modelToWorld [0, 20, 0]), 10, "FIRE"] call smoke_effect Hunter wreck (smoke and fire) [ (player modelToWorld [(random 100), (random 100), 0]), 600, "Hunter Wreck", ["Land_wreck_hunter_f", "test_EmptyObjectForFireBig", "test_EmptyObjectForSmoke"] ] call smoke_effect
  9. Add a semicolon before starting a new line within the same scope, this spawn { waitUntil { sleep 1; if alive _this then {systemChat str alive _this}; !alive _this } } this spawn { waitUntil { sleep 1; if alive _this then {systemChat str alive _this}; !alive _this }; systemChat "exited loop" } Have fun!
  10. @Nicole_UK, Paste the script into the init field of one of the units. The first NPC is the "trigger area" (10 m). No waypoints or triggers required. It will only affect the units listed in the array. I edited the script so the NPCs listed in the array will move to, then board the vehicle listed last in the array, [NPC_0, NPC_1, NPC_2, truck_1] spawn { private _veh= _this select (count _this) -1; waitUntil { sleep 1; if (player distance (_this select 0) < 10) then { { [_x, _veh] spawn { params ["_unit", "_veh"]; sleep 10; _unit switchMove ""; _unit enableAI "ALL"; _unit doMove (getPos _veh); waitUntil {sleep 1; _unit distance _veh < 5}; _unit moveInAny _veh } }forEach _this }; (player distance (_this select 0)<10) }; waitUntil {sleep 1; {_x in _veh} count _this == count _this -1}; driver _veh spawn {_this doMove (_this getVariable ["move_pos", (_this modelToWorld [0,0])])}; }; Have fun!
  11. @Nicole_UK, I'm not sure why your NPC isn't moving but I am sure that triggers and waypoints are holding you back! [NPC_0, NPC_1, NPC_2] spawn { waitUntil { sleep 1; if (player distance (_this select 0) < 10) then { { _x spawn { sleep 10; _this switchMove ""; _this enableAI "ALL"; _this doMove (_this getVariable ["move_pos", (_this modelToWorld [100, 100, 0])]) } }forEach _this }; (player distance (_this select 0)<10) } }; Uses the first NPC in the array as an area center, 10 m. When player enters the area wait 10 seconds and release the NPCs listed in the array from their animation. Send them to the variable "move_pos" default: 100 meters that way. Exit loop. Have fun!
  12. MISSION MAKER FRAMEWORK for ARMA III, ver. 0008 (2021) This MODULE is compatible with BASE GAME (current version) MMF is an easy-to-use function library for mission designers. Live readMe Discord Channel (new) Change Log (new) FAQ (new) MMF Version 8 (install to mission root) (dev) MMF_vX (drive) (new) Demos (new) Images Features Have fun! Credits: Soolie Build Menu GUI SmartGames Function Configs Custom Notification Benchmark, Mr Pants Playtesting Arma Public License No Derivatives (APL-ND) Use:
  13. @Rosso777, It's best to install MMF to a freshly created scenario with the intention of using if from the start. That way you can embrace the design philosophy and accomplish with 1 line what used to take a jumble of triggers and webs of waypoints— those are the complicated things— MMF is easy-to-use (it says so right on the tin!). Some recent additions, like MMF_fnc_unit_maker, make designing missions even easier. some_object spawn MMF_fnc_unit_maker; I cannot simplify it any further. Have fun!
  14. @Nicole_UK, To do what you originally asked, { deleteVehicle _x } forEach (nearestObjects [thisTrigger, ["all"], (triggerArea thisTrigger) select 0]); in a trigger which includes all the base objects within its area. Have fun!
  15. @Nicole_UK, 1) Create a new layer (folder) in the editor and title it something like "base_objects" 2) Place your base objects into this new folder 3) Create a trigger on your base, player activated (not present) 4) Paste, (to delete) [["base_objects"], false, true] call you_hide_layers in the trigger ON ACTIVATION field or 3) Create a trigger on your base, player activated (present), repeatable 4) Paste, (to toggle show/hide) ON ACTIVATION: [["base_objects"]] call you_hide_layers ON DEACTIVATION: [["base_objects"] true] call you_hide_layers 5) Paste the function somewhere, it only has to be loaded once. It can go basically anywhere. Paste it in your player's init field if you like. you_hide_layers={ params [["_layers", []], ["_show", false], ["_remove", false], ["_exec", {}]]; if _remove then {_exec ={deleteVehicle _x}} else {_exec= {_x hideObjectGlobal _show}}; for "_i" from 0 to count _layers -1 do { {call _exec} forEach ((getMissionLayerEntities (_layers select _i)) select 0) } }; Have fun!
  16. @Nicole_UK, Remove or hide/show all objects in a layer, Have fun!
  17. @Joe98, Generally speaking this is my favorite type of loop, Have fun!
  18. @GamersFortitude, This does what the script above is supposed to do, However I'm not sure that's exactly what you want it to do. As a function it can work repeatedly but mostly for visual effect (there's no aim), Have fun!
  19. @sarogahtyp My favorite line from the script above, _down_start > 0 and (diag_tickTime - _down_start) > _down_time now that's how you return bool like a pro! Thanks, man!
  20. wogz187

    Issue with script

    @BluBoi, This topic reminds me of myself. Here is your script running without errors, However there are still a number of problems (I don't think it does what you want it to do). Like was said before, 1) system chat stuff to debug your script 2) read the wiki 10x for each command you use 3) make little experiments instead of full blown scripts (then compile successes together) Have fun!
  21. @Dyeg0, Check this out, Have fun!
  22. @Nemanjic, If you must use a trigger consider @pierremgi's solution below. Otherwise, forget about the trigger and just loop for a condition (area distance?), null=[_veh, "m1", _area] spawn { params ["_veh", "_mark", "_area"]; waitUntil {sleep 1; if (_veh distance (getMarkerPos _mark)> _area || !alive _veh) then { if (!alive _veh) exitWith {"vehicle is destroyed, exit loop"; true}; "vehicle is out of area, exit loop"; true }else{ "vehicle is in area, continue loop"; false } } }; Have fun!
  23. This version update includes tons of new functions and significant tweaks, improvements and optimizations. Check the changelog for an overview of new content or download the test scenario to try it out. Install v8 to a custom mission: MMF_v8_extract_to_mission_root.7zip Join the discord channel for tutorials, script help and discussion. Request features, provide feedback, share screenshots and more! Have fun!
×