SkyDice 10 Posted July 28, 2010 Hi all - I'm creating a co-op mission and I could use a little help. I've got the players running/driving/etc their way from one end of the map to the other, 'escaping' from a Takistani jail. I want to end the mission in a different place each time, and have an airlift called in when they reach the pickup point. I'd planned to call the location of an invisible H with a large placement radius to randomise the mission, and to call to place the objective marker in the briefing. But of course, I can't place a trigger in the location to activate a helo-pickup if the location is randomised each time. Is there a way to create one at the invisible H, even when it's random? I'd also like them to have access to a single supply drop past a certain distance travelled, which I've been trying to get working with the BIS call support_fnc on a blufor/present trigger, but I can't seem to get it working either. Any thoughts on either problem would be appreciated! I've searched, and I've tried everything I can think of, but I'm still stuck! :) Share this post Link to post Share on other sites
kylania 568 Posted July 28, 2010 Umm... well, rather than the large placement radius, group the H with various markers, when the mission starts the H will spawn at the location it was places, or one of the grouped markers. Just setPos the trigger to wherever the H is to move it there. The SupplyDrop feature is slightly bugged, but works mostly. I'd suggest searching for terms or concepts rather than sentences or something. Everything you want to do has been asked and answered numerous times before. :) For example "random trigger location" resulted in threads that answer each of your questions. You can't just check the top three results. :) Share this post Link to post Share on other sites
SkyDice 10 Posted July 28, 2010 Ok, will give those a try, thanks. Re the search, I think for noobs like myself the hard part is finding the right post.. sometimes, if it's not what *exactly* what you're looking for, it can be hard to apply it. I do try though :) Also trying to find a way to make MiG24's use searchlights, any ideas? :) Appreciate the help! EDIT: Also, will the code for the supply drop work with an ammo crate? Or several? Just repeat the code for more than one item per drop? Share this post Link to post Share on other sites
kylania 568 Posted July 28, 2010 For lights on the vehicle would have to be set to: this setBehaviour "CARELESS" The supply drop just drops one crate per use. Also remember to use the proper class name since it's broken for OA. Repeating the code would work for multiple drops. Share this post Link to post Share on other sites
SkyDice 10 Posted July 28, 2010 Thanks for taking the time to help, I appreciate it. One final question - I've had to place a fair few enemy units/waypoints on the map, but I'm sure there's a way to spawn enemy units and add waypoints with triggers. I've read a couple of threads on this, tried out the code and nothing spawned - and the threads are just code, with no explanation. Any thoughts? :) Share this post Link to post Share on other sites
kylania 568 Posted July 28, 2010 Download this demo mission I did and check out the selNewDir.sqf. That shows how to spawn groups in random areas based on a trigger. It's all code, but it's commented code! :) ////////////////////////////////////////////////////////////////// // Function file for ArmA 2: Operation Arrowhead // Created by: kylania (Some code from shk) ////////////////////////////////////////////////////////////////// // This script, called from a trigger, will pick a destination and spawn guys on it. // Don't allow a new wave if a current wave is active. if (respawnAble) then { // Initialize Functions waitUntil{!(isNil "BIS_fnc_init")}; waitUntil{!(isNil "BIS_MPF_InitDone")}; // Run from a trigger it will activate on all clients, by making // it check for isServer this will only run on the server. The // rHINT function will broadcast the direction to all clients. // This way we only get one direction instead of everyone getting // a different direction. if (isServer) then { _rndDir = ["North","East","South","West"] select floor(random 4); _rndDirhint = [nil,nil,"per",rHINT,_rndDir] call RE; // If you only wanted one of the two markers to get guys use this line. //_markerRnd = curDir + "spawn" + str(ceil(random 2)); _marker1 = _rndDir + "spawn1"; _marker2 = _rndDir + "spawn2"; // How many enemies in each group. _enemyCount = _this select 0; // Warn of the incoming attack. hint format["%1 Spawn activated!", _rndDir]; // Spawn the first group and have them attack. grp = [getMarkerPos _marker1, east, _enemyCount] call BIS_fnc_spawnGroup; null = [grp,(getMarkerPos "infdestination")] call BIS_fnc_taskAttack; // Spawn the second group and have them attack. grp2 = [getMarkerPos _marker2, east, _enemyCount] call BIS_fnc_spawnGroup; null = [grp2, (getMarkerPos "infdestination")] call BIS_fnc_taskAttack; }; } else { // If there's currently an attack underway, remind the player of that instead of spawning new. hint "Attack underway!"; }; Share this post Link to post Share on other sites
SkyDice 10 Posted July 28, 2010 Wow script looks great, thanks - one problem is that de-pboing is completely beyond me (I have the program but no idea how to use it, and yes I've tried!) so I won't be able to check that way. However, from what you've said this code is going in a selNewDir.sqf (which I can create fine), to be called by a trigger (which is where it gets sketchy). Can you fill in the gaps? You're creating two groups, waiting until both are killed and then calling another two groups? Is there a delay? I get the set enemies count section (should it be set to '0'?). How would I duplicate markers - if that's where enemies are spawning, then marker a/b will be fairly close to the trigger perimeter - to set up multiple triggered spawns in different places? Share this post Link to post Share on other sites
kylania 568 Posted July 28, 2010 (edited) Oops! Here's the editor version! That script was called via nul = [[b]n[/b]] execVM "selNewDir.sqf" where n is how many units per group to spawn. There were 8 markers on the map, northspawn1 and northspawn2, eastspawn1 and eastspawn2 and so on for all four cardinal directions. They were all around 800m or so from the middle. There were three triggers (radio) setup, one to spawn 2, 4 or 8 units per group. The Functions module had to be on the map as well. Edited July 28, 2010 by kylania Share this post Link to post Share on other sites
SkyDice 10 Posted July 28, 2010 (edited) Ok, great, thanks! I do have a couple more questions though.. :) I'm using this heli extraction script btw (thanks again - searching does work sometimes!), on a BLUFOR present trigger getpos'd to the grouped invisible H, like you said: http://forums.bistudio.com/showthread.php?t=103625&highlight=helicopter+extraction and I just want to check that when you say Place your Functions Module hStart and hEnd markers you mean putting a functions module down for each and naming them hStart & hEnd - for where the heli is spawned, and where it should land/vanish? I'm going to have the hEnd at an airbase, with an endmission BLUFOR/Present trigger when they get close to the base.I'm also using: removeallweapons this; this addmagazine "30Rnd_545x39_AK"; this addmagazine "30Rnd_545x39_AK"; this addmagazine "30Rnd_545x39_AK";this addweapon "AKS_74" to set up weapons (stolen ak's) for the escapees - but the mission begins early in the morning and it's pitch black (for a while anyway). I'd like one or two of the players to have NV goggles (maybe the guards had them, etc) so they're not completely screwed in the dark, but the addweapon/addmagazine don't recognise the class "NVGoggles". Any idea how to add NV goggles manually? Also, looking at the Direction Spawn in the editor, I see you've got a trigger making sure the groups are dead in the mission area, and that you've got radio triggers set for each group. the .sqf seems to randomly select one of the spawn markers to spawn the group when the trigger is called. So - to implement this in my mission (say, three or four locations where enemies will spawn when approached), am I right in thinking I'd need to make one spawn marker, one trigger that uses the selnewdir.sqf (set to say 8 men) script and a unique selnewdir.sqf for each location? Would I also need separate triggers to ensure the groups are dead? I think I understand most of it, just filling in my own gaps now lol! I'm also not sure what's defining 'infdestination' (I assume a getpos player?) to define where the enemy attacks. Thanks again for all the help :) EDIT: Tested it all and for some reason, the exfil point only appears at the invisible H :( I've got an invisible H grouped with 4 empty markers (exfil1 through 4), with trig1 setpos getpos this; exfilmarker setpos getpos this in the init line (the briefing calls a marker called "exfilmarker" to place the objective, which is also getpos'd to the invisible H). The trigger, trig1 has nul = [player] execVM "plannedExtraction.sqf"; on a BLUFOR present 50 x 50 metres (so they'll trigger it, and the message, when they get close). The invisible H is grouped as you said, but it doesn't seem to be randomising the spawn between the markers and the placement position, the H just stays where it is. After a bit more testing, the trig1 setpos/exfilmarker setpos aren't being placed on top of the invisible H, AND the H isn't randomising it's spawn with the grouped markers either - so it's actually two problems! Edited July 28, 2010 by SkyDice Share this post Link to post Share on other sites
kylania 568 Posted July 28, 2010 this addWeapon "NVGoggles"; For the spawning thing, never duplicate scripts when you can simply add another argument. :) I'll write up what it would look like. Share this post Link to post Share on other sites
W0lle 1052 Posted July 28, 2010 §22) Use descriptive thread titles If you start a new thread, please make sure your thread title explains what you want without forcing people to read through your post first. Thread titles such as "How in the world do I...", "Need help!" or "Will we ever see..." are anything but descriptive. We do not allow these kind of titles and threads with such titles are subject to be closed. Also please use the forum search, there is a good chance your question(s) have been asked and answered in the past. Share this post Link to post Share on other sites
kylania 568 Posted July 29, 2010 For the spawning, I went with the approach of "spawn stuff in front!" so you can place a trigger with this in it's onAct: nul = [(thislist select 0), 8] execVM "spawnResponse.sqf"; Which calls this script: if (isServer) then { // How many enemies in each group. _sourcePoint = _this select 0; _enemyCount = _this select 1; // Get a random position within 300-600m and in a 90 degree arc in front of the player's vehicle/player. _randDir = getDir vehicle _sourcePoint - 45; _randDir = _randDir + random(90); _randDist = (random 100) + 200; _enemyLoc = [(getPos vehicle _sourcePoint select 0) + (_randDist * sin(_randDir)), (getPos vehicle _sourcePoint select 1) + (_randDist * cos(_randDir)), 0]; // Spawn the first group and have them attack. grp = [_enemyLoc, east, _enemyCount] call BIS_fnc_spawnGroup; null = [grp,(getPos vehicle _sourcePoint)] call BIS_fnc_taskAttack; grp reveal _sourcePoint; }; That'll spawn 8 (or whatever number) of east units 300-600m in front of the unit that set off the trigger. Share this post Link to post Share on other sites