Jump to content

wogz187

Member
  • Content Count

    827
  • Joined

  • Last visited

  • Medals

Everything posted by wogz187

  1. @Dyeg0, Check this out, Have fun!
  2. @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!
  3. 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!
  4. @olegreyghost, We learned how to use removeAllActions but maybe there is a different solution. BIS_fnc_guiMessage will create a Choice Menu from which you can run code based on the selection made, comment "use params to transfer variables into the spawn scope"; null= [player, talon_1] spawn { uiSleep 0.5; comment "required sleep for menu to load"; private _result= ["Menu Title", "Select", "Accept", "Decline"] call BIS_fnc_guiMessage; comment "menu title, subtitle, button OK, button CANCEL"; if (_result) then { //accept code } else { //decline code } }; Have fun!
  5. wogz187

    track a moving enemy

    @CN-bbdnmd, Try bis_fnc_stalk, [stalker_grp, stalked_grp] spawn BIS_fnc_stalk Have fun!
  6. I added you to the credits (playtesting) on the MMF topic page,

    Thanks for all your help!

  7. @GaryTheNoTrashCougar, @stanhope, Simplified, Have fun!
  8. @thy_, I checked by copying and pasting the script above (my post) into an open scenario and it worked as expected. You can check by pasting the function into the unit's init along with the call. It does not have to be the leader of the group. Or call it on your player character from the debug menu! Have fun!
  9. @codeivo, Event handlers are very important. General rule: if you can use an EH then do use an EH. Since event handlers only fire at the event they are almost always the most performant solution. See also: mission event handlers and MP specific MP event handlers Your while loop will be running continuously throughout the mission which, in this case, is totally preventable. Use parameters, [] spawn { _fleet = []; _limit = 3; By defining your parameters outside of the script you can customize the function with a spawn/call array instead of just leaving it blank (useless). [[], 3, player] spawn { params ["_fleet", "_limit", "_caller"]; // code } And by defining default parameters the script will fallback to that variable when nothing is provided, [[], 3] spawn { params [["_fleet", []], ["_limit", 3], ["_caller", player]]; _caller sideChat "I'm the player!" } Instead of bool for your loop condition use a variable you can control, missionNameSpace setVariable ["_do_loop", true]; while {sleep 1; missionNameSpace getVariable ["_do_loop", false]} do { //code}; missionNameSpace setVariable ["_do_loop", false]; //to exit above loop You can use waitUntil in a similar way, waitUntil { sleep 1; if (missionNameSpace getVariable ["_do_loop", false]) then {//code; true} else {false}} // return false to continue waiting, true to exit I didn't do this in the script above because the loop will exit within a few frames of execution. Instead we rely on the event handler to reinitialize the function when needed. This could have been an iteration instead of a loop. Since we could have used any of 3 methods (while, waitUntil, for _i) perhaps somebody else wants to weigh in as to which solution is best for this situation, or perhaps it really doesn't matter. Have fun!
  10. @codeivo, Here's a working example of your request, * maintain number of vehicles at center * default number = 3, default center = player Have fun!
  11. @thy_, Using a script function allows us to skip creating a new .sqf file. Paste the function in init.sqf, in the init field of a unit, object, helper, or directly in the mission init dialog field. Call the function any time with a single line, // in a script [_grp] call you_fnc_addIR; or // in a unit init field [group this] call you_fnc_addIR; This iterates through each unit in the group. The event handlers are necessary. Otherwise units will leave their IR beacon behind when boarding vehicles or upon death. To remove the lights, { deleteVehicle (_x getVariable ["you_IRlight", objNull]) } forEach units _grp Have fun!
  12. @Kamber, Add to initPlayerLocal, Or to try it in the init field of a unit, Have fun!
  13. Here's a couple fire related functions, you_createFire, *Updated you_fnc_houseFire (demo), Burn buildings to the ground! Spawn one central fire with smoke and a number of FX fires (performance) in the building. The building takes damage over time. Once the building is destroyed the performance fires are deleted and later the main fire. Fire will spread based on the distance supplied to the function ("_dist"). Use the parameter "_damage" (default true) to make persistent fire that does not damage the building over time or spread to other buildings.* Use parameter "_time" to determine how long each building will burn (default: 10, demo: 1). 1 second is equal to 20 seconds total burn (each iteration is %10 damage) and the main fire burns for the same amount of time again (1x10x2). The default value is 10 or 200 seconds (100 to collapse and 100 more to extinguish). 1) create a helper object on/near the building(s) ** 2) paste the function in init.sqf (or wherever) 3) see call methods in demo init.sqf * keep track of effects in the supplied array ** editor placed buildings may be "_caller" Have fun!
  14. @mattis, Sure. The script has no mechanism to accomplish this so it would be based on the default behavior of the engine or the specific behavior of the scenario. It seems to me that recording damage states and reapplying this state when the scenario is reinitialized would be totally do-able. Reapplying the burning status to buildings would be achieved in a similar way. Like I said, it's a great idea. I've never seen that on this forum-- recording environmental damage to a profile nameSpace or some persistent variable-- but of course this can be done.
  15. @Melody_Mike I posted the wrong line. This is the line that filters out non-building buildings, _buildingARR = [_buildingARR, [], {_x distance _caller}, "ASCEND",{count (_x buildingPos -1) > 1}] call BIS_fnc_sortBy; And yes you can have multiple instances running simultaneously.
  16. @Melody_Mike, The script is looking for a minimum number of building positions within the selected building, perhaps the connector tent doesn't have enough positions (it's 2, I think). You're more than welcome to comment the line below and see if that allows these objects to burn-- it almost certainly will-- but may also cause other nearby non-building type things to burn (like random fences). _buildingARR = [_buildingARR, [], {_x distance _caller}, "ASCEND",{count (_x buildingPos -1) > 1}] call BIS_fnc_sortBy; @mattis, There is no mechanism in the script to record building damage in a meaningful way. That sure is an interesting idea though... Have fun!
  17. @Melody_Mike, You're on the right track. If you look at the script in the link above all that is happening is that the fire effects are pushed back to an array for later removal via deleteVehicle.
  18. @Melody_Mike, This script dynamically creates and removes fire/smoke effects, all wrapped up in a demo mission so you can try it out. Have fun!
  19. wogz187

    The problem is in scripting

    @steam-76561198013707443, a) the "take" EH is triggered by collecting explosives from a box b) "... more than 3 bombs..." c) "... (bombs) are placed on the road..." I'm not an expert on locality but I think the public variable is unnecessary. Have fun!
  20. @Rosso777, Think about it like this, The entire Black Magic demo was created without even opening the core folder or significantly altering the initialization files. The mission is contained within the mission.sqm file. Included with BM is a "game_trigger" file you can check out. It contains the init data from the TV screen as a quick example. This file is not initialized, it's just there for your reference. You can view the init data of any of the objects/triggers in the scene for tips. Try copy/pasting the init data into a document for easier viewing. Have fun!
  21. @Rosso777, I'm not sure what dependencies means in this case. MMF_core must be installed to the mission root folder. No it isn't. To start any new mission with MMF just place a player on the map of your choice, save, and install both the initialization files and mff_core folder to the mission root folder. From then on the functions are available in the editor functions viewer. Enable/disable/configure options in the initialization files to determine automatic features. Try making yourself a tutorial by placing some objects and groups around in a VR map. Follow along with any / all of the #howTo on the MMF discord. Grab the Black Magic demo (alpha) if you need some inspiration! MMF discord Have fun!
  22. wogz187

    Finish countdown to run script

    @Pablogamonal, All wrapped up in a demo for you, you_trigger_check (drive) Have fun!
  23. wogz187

    Finish countdown to run script

    @Pablogamonal, script below...
  24. wogz187

    Finish countdown to run script

    @Pablogamonal, script below...
×