

thecoolsideofthepillow
Member-
Content Count
253 -
Joined
-
Last visited
-
Medals
Everything posted by thecoolsideofthepillow
-
The sewer part in the mission; did you make that with objects in the game or is it a location somewhere actually built into the map?
-
Help with a Scripted Gunfight
thecoolsideofthepillow posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
I am trying to make a little opening scene where you are suddenly betrayed and everyone starts shooting. I don't want it to be dynamic, though, I want the player to survive (at least until they are taken control of) but I want his subordinates to die. I know I could just straight up kill them, but it looks dumb. I want the bad guys to shoot them. The problem is the other group of AI guys will not attack me first. If I have them set so everyone can fight, my men end up overpowering the other guys; despite them being undermanned, lightly armed with only pistols, in the open against guys in cover and are even unable to move. It's kind of ridiculous, actually. If I give the baddies god mode, they don't die, but they also take an insane amount of time to actually open fire on targets they are forcibly given at init. How can I get my baddies to murder my men and look like they are actually standing there, pumping them full of lead? I'd prefer them to not even move while doing it, just to make it look cooler. -
Editing scripts
thecoolsideofthepillow replied to Argonauta's topic in ARMA 3 - MISSION EDITING & SCRIPTING
From what I've been seeing the past few days trying to use the C130 from CUP for this very purpose, it's that the AI just can't fly that big cargo plane very well. They drop their speed too much and then drop out of the sky like a rock, and they completely ignore any height commands. -
Help with a Scripted Gunfight
thecoolsideofthepillow replied to thecoolsideofthepillow's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Sorry; I made the post and completely forgot where I put it! All I have tried so far has been to use a doStop on all the units for a scene where they will talk for a bit, the attackers are set to each target one of the men I want to die, then I change the side of the attackers to OPFOR from INDEPENDENT, give them a fire order and doStop false. All they do is take cover or run away. If I use a doStop False on the men I want to die, they immediately open fire on the attackers and win, often without even taking casualties. Actually looks a little like sarogahtyp's suggested script for the bit where I tell the attackers to take aim and fire, just not as clean since it's in a radio trigger instead of a script (for debugging atm). I was wondering if there was a way to force them to detect one another because it feels like the attackers are just not seeing the guys I want them to kill despite them being directly ahead of them. I assume that's what "reveal" does? -
Converting "Game Over" to "Game On" problems...
thecoolsideofthepillow replied to Hardly's topic in ARMA 3 - MISSION EDITING & SCRIPTING
You don't need to mod the mission to do what you want. Simply change the difficulty settings from the options so you can save infinite times. -
If it's an escape I must make, then one I shall do. I just hope I don't run right into them because it's night again. Or I'll just install that CQC mod so I can sneak around and break their necks. >:)
-
Is it *supposed* to spawn me with a .45 pistol, but the ammo on the dead body is 9mm? I keep dying right when I start because I have no useable ammo and am surrounded by bandits.
-
BIS_fnc_spawnGroup not working from Debug Console?
thecoolsideofthepillow posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Whilst testing ideas to try and create markers randomly, I was trying to use BIS_fnc_spawnGroup to just place a single unit instead of a trigger; just to see if I have the correct method to get the positions I need. What I found, however, was that the spawngroup function itself is not working, even when I just copy and paste the examples from the BIKI ([getMarkerPos "Marker", EAST, 5] call BIS_fnc_spawnGroup OR _grp = [getMarkerPos "Marker", EAST, 5] call BIS_fnc_spawnGroup). It simply will not create any units. Just to make sure it wasn't from not having a center or from using it in the debug console, I also tried using createCenter as well as going back into the editor and placing down 1 unit of each side and also tried from the init line of the player's unit. Still nada. EDIT: It seems I have to use the config method (_group1 = [getPos player, side player, (configfile >> "CfgGroups" >> "West" >> "BLU_F" >> "Infantry" >> "BUS_InfSquad")] call BIS_fnc_spawnGroup;) and I had to restart the game for even that to work. Maybe it just didn't load the function/configs properly (been happening a lot where weapons show up in the incorrect place, like handguns being used as primary weapons). -
How to limit weapons in the Arsenal of a box?
thecoolsideofthepillow replied to gummybear_qc's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Just my two cents on the issue of Arsenal configuration: Instead of just a WHITElist, like it uses now, a BLACKlist would make it a lot more flexible and less tedious. That way instead of telling it what to use, you can tell it what not to use and use far less space to just remove launchers and rockets (for example). -
Can I Prevent a Player from Placing/Touching Off a Bomb?
thecoolsideofthepillow replied to thecoolsideofthepillow's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Weird. You'd think the scripted satchel would let me run an addAction script to it. It still recognizes it as an object, though, and it does call the correct item from the variable name I gave it, and knows it's position. So instead of making a new object, I just made a new trigger that gives the correct side's players an addaction while they are in range of the bomb. I am wondering now if, using one of the intersecting line commands I could incorporate a condition that requires the player to not only be in range, but also be looking at the object. This would have been no problem with the addAction on the bomb itself, since when using a condition (such as only showing up for one side) on the addAction itself, it forces you to be in a smaller range *and* to look at the object. I am not exactly sure what the result of setting the condition for the player's side on an addAction that would be on the players themselves. They can't look at themselves. -
Can I Prevent a Player from Placing/Touching Off a Bomb?
thecoolsideofthepillow posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
I am wanting to know if it would be possible to give a player a satchel charge, but prevent them from arming it until a condition is met. If they meet the condition and arm the device, I want it to automatically set the timer (bonus if I can change it from 40 seconds to something else) and not give them the option of detonating remotely. I am not sure how to even start, if removing those actions is even possible. -
Requesting 'mission.sqm' guidance.
thecoolsideofthepillow replied to JaykePC's topic in ARMA 3 - MISSION EDITING & SCRIPTING
You should have the server files for Exile. You need to de-PBO the mission, then edit it from the editor like anything else. Copy the items from that map, and then load your new map in the editor and place them down. Copy all the other files from the unpacked PBO into the new mission folder, and repack it. Put the Exile.Altis folder from unpacking the PBO in C:\Users\<user>\Documents\Arma 3\missions\ (or C:\Users\<user>\Documents\Arma 3 - Other Profiles\<profile>\missions\) to load it like any other user mission. There is no need to manually edit the .SQM file. -
Can I Prevent a Player from Placing/Touching Off a Bomb?
thecoolsideofthepillow replied to thecoolsideofthepillow's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Problem: While everything works for the item in terms of placing and detonating, I can't get the defusal part to work. c4 = "SatchelCharge_Remote_Ammo_Scripted" createVehicle position bCarrier; c4 addAction ["Defuse Bomb", "de_nuke.sqf"]; The action does not appear on the bomb at all. If I ask for a hint str of c4, I get the item. If I do a hint str for the planted bomb (using cursorTarget and looking at it) it gives <NULL-OBJECT>. I have a feeling it's related to the problem. It should work like any other vehicle, right? I can do a similar thing to add an action to a car. Why is it not working for the satchel? -
Can I Prevent a Player from Placing/Touching Off a Bomb?
thecoolsideofthepillow replied to thecoolsideofthepillow's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Thanks guys. :) -
Something I've put a few days of work into after being unimpressed with how the End Game modules worked in their current state. It's basically full-map End Game with Alive for added background sim made for 1-4 players. It wouldn't be a lot of work to make it PvP-oriented, either. The gameplay is fully-functional; the tasking system is a bit of a problem though with the first set of tasks, but other than notifications and what-not, everything is peachy. Feedback/Suggestions would be helpful, especially with the dialogue/plot. I just slapped that stuff together off-the-cuff and it sounds corny as hell, even to me. Observe & Report http://steamcommunity.com/sharedfiles/filedetails/?id=507073879 ​
-
Um... RHS already has ammo boxes. Both Russian style and US style (though the US ones are just retextured default NATO boxes). They even come in virtual ammobox flavors.
-
Help with Understanding SimpleTasks
thecoolsideofthepillow replied to thecoolsideofthepillow's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Thanks Larrow. I have another question, though: Since my tasks are randomized (and they can be anywhere from 1 to 25 tasks), I am now in a bit of a pickle with how I end the *right* task. Background: For the first set of tasks, the positions are picked at random from a player parameter in the lobby. From there, it creates a group of guys of random size and then selects one of those guys to give a Killed event handler that drops a small object (document file) on the ground. These groups are marked as tasks. However, when the player(s) kill the one with the file, I want it to succeed the child task that they actually succeeded, but I am having trouble finding the right way of getting the right name of the task. After that it should create a new child task that points toward the dropped document (because it's quite small sometimes it's under a body) and then once the file is picked up, succeed that new task. I have figured out how to use the missionNamespace to give variables a random name and call back that random name. It was working just fine up until the addAction that picks up the document is ran; it seems at that point, my use of "_x" in the big forEach loop stops being defined or it's just not defined inside the scope of the addAction. Here's my script (before I start changing to the function you gave me to get the tasks to display the way I want since they work how I have them in the other ways): _grpSelect = enemyGroupTypes call BIS_fnc_selectRandom; StartTask = player createSimpleTask ["Intel"]; StartTask setSimpleTaskDescription ["We have reports of some Molatian pirates operating on the Afrenian side of the border. Sounds like they're planning something big this time. Go in, sweep the area, and collect anything you find.", "Gather Intel", "Sweep & Clear Area"]; StartTask setTaskState "Assigned"; player setCurrentTask StartTask; if (intelCount >= 3) then { { _resgrp1 = [getMarkerPos _x, EAST, (_grpSelect)] call BIS_fnc_spawngroup; _holder = (units _resgrp1) call bis_fnc_selectRandom; _tskName = format ["taskObj_%1", _x]; childName = format ["StartChild_1%", _x]; _StartChild = player createSimpleTask [_tskName, StartTask]; missionNamespace setVariable [childName, _StartChild]; _childNameRnd = missionNameSpace getVariable childName; _childNameRnd setSimpleTaskDescription ["Find and collect the intelligence in the area. Be prepared for hostile contact.", "Gather Intel", "Search Area for Intel"]; _childNameRnd setSimpleTaskDestination (getMarkerPos _x); _childNameRnd setTaskState "Assigned"; _holder addEventHandler ["killed", { _unit = (_this select 0); _dropPos = [_unit, 1, (random 360)] call bis_fnc_relpos; _droppedIntel = "EvKobalt" createVehicle _dropPos; _droppedIntel allowDamage false; _droppedIntel enableSimulation false; player sideChat "I think that one dropped something."; childName1 = format ["StartChild1_%1", _x]; _startChild1 = player createSimpleTask ["Pick Up Intel", StartTask]; missionNamespace setVariable [childName1, _startChild1]; _childName1Rnd = missionNameSpace getVariable childName1; _childName1Rnd setSimpleTaskTarget [_droppedIntel, true]; player setCurrentTask _startChild1; _childTask1 setTaskState "Assigned"; _droppedIntel addAction ["Gather Intelligence", { _del = _this select 0; deleteVehicle _del; gatheredIntel = gatheredIntel + 1; if (gatheredIntel < intelCount) then { player sideChat "SPEARHEAD to PHALANX. We have neutralized an insurgent team and gathered some documents, over."; sleep 3; PHALANX sideChat "Excellent work, SPEARHEAD. Proceed to locate the rest of the files. PHALANX out."; _childNameRnd = missionNameSpace getVariable childName; _childName1Rnd = missionNameSpace getVariable childName1; _childNameRnd setTaskState "Succeeded"; _childName1Rnd setTaskState "Succeeded"; } else { if (gatheredIntel >= intelCount) then { player sideChat "SPEARHEAD to PHALANX. We have collected all the files. Sending details now. How copy? Over."; sleep 5; PHALANX sideChat "Roger, SPEARHEAD. After going over the documents, we've discovered a Molatian officer we need you to arrest."; sleep 5; PHALANX sideChat "Do not kill the officer. Repeat DO NOT KILL THE MOLATIAN OFFICER. We need to interrogate him to find out what he may know."; sleep 5; PHALANX sideChat "How copy, SPEARHEAD? Over."; sleep 5; player sideChat "Copy, PHALANX. Capture, not kill, the HVT. SPEARHEAD out."; StartTask setTaskState "Succeeded"; _childTaskRnd = missionNamespace getVariable childName; _startChildRnd setTaskState "Succeeded"; _childTask1Rnd = missionNamespace getVariable childName1; _startChild1Rnd setTaskState "Succeeded"; _tsk2 = player createSimpleTask ["HVT"]; _tsk2 setSimpleTaskDescription ["Capture the officer for interrogation in Bolabongo. Beforewarned, Captain, the Molatians are swarming all over the city, and the target is without doubt accompanied by guards.", "Arrest HVTs", "Capture the Officer"]; _tsk2 setSimpleTaskDestination (getMarkerPos "mkrHvt"); _tsk2 setTaskState "Assigned"; Task2 = _tsk2; _nil = execVM "midgame.sqf"; }; }; }]; }]; } forEach selectedStart; } else { _resgrp1 = [getMarkerPos selectedStart, EAST, (_grpSelect)] call BIS_fnc_spawngroup; _holder = (units _resgrp1) call bis_fnc_selectRandom; _tskName = format ["taskObj_%1", _x]; _startChild = player createSimpleTask [_tskName, StartTask]; _childName = format ["StartChild_%1", _x]; missionNamespace setVariable [_childName, _startChild]; _childTask = missionNamespace getVariable (format ["StartChild_1%", _x]); _childTask setSimpleTaskDescription ["Find and collect the intelligence in the area. Be prepared for hostile contact.", "Gather Intel", "Search Area for Intel"]; _childTask setSimpleTaskDestination (getMarkerPos _x); _childTask setTaskState "Assigned"; _holder addEventHandler ["killed", { _unit = (_this select 0); _dropPos = [_unit, 1, (random 360)] call bis_fnc_relpos; _droppedIntel = "EvKobalt" createVehicle _dropPos; _droppedIntel allowDamage false; _droppedIntel enableSimulation false; player sideChat "I think that one dropped something."; _startChild1 = player createSimpleTask ["Pick Up Intel", StartTask]; childName1 = [format "StartChild1_%1", _x]; missionNamespace set [childName1, _startChild1]; _childTask1 = missionNamespace getVariable (format ["StartChild1_1%", _x]); _childTask1 setSimpleTaskTarget [_droppedIntel, true]; player setCurrentTask _startChild1; _childTask1 setTaskState "Assigned"; _droppedIntel addAction ["Gather Intelligence", { _del = _this select 0; deleteVehicle _del; gatheredIntel = gatheredIntel + 1; if (gatheredIntel < intelCount) then { player sideChat "SPEARHEAD to PHALANX. We have neutralized an insurgent team and gathered some documents, over."; sleep 3; PHALANX sideChat "Excellent work, SPEARHEAD. Proceed to locate the rest of the files. PHALANX out."; _childTask = missionNamespace getVariable (format ["StartChild_1%", _x]); _childTask1 = missionNamespace getVariable (format ["StartChild_1%", _x]); _childTask setTaskState "Succeeded"; _childTask1 setTaskState "Succeeded"; } else { if (gatheredIntel >= intelCount) then { player sideChat "SPEARHEAD to PHALANX. We have collected all the files. Sending details now. How copy? Over."; sleep 5; PHALANX sideChat "Roger, SPEARHEAD. After going over the documents, we've discovered a Molatian officer we need you to arrest."; sleep 5; PHALANX sideChat "Do not kill the officer. Repeat DO NOT KILL THE MOLATIAN OFFICER. We need to interrogate him to find out what he may know."; sleep 5; PHALANX sideChat "How copy, SPEARHEAD? Over."; sleep 5; player sideChat "Copy, PHALANX. Capture, not kill, the HVT. SPEARHEAD out."; _childTask = missionNamespace getVariable (format ["StartChild_1%", _x]); _childTask1 = missionNamespace getVariable (format ["StartChild_1%", _x]); _childTask setTaskState "Succeeded"; _childTask1 setTaskState "Succeeded"; Task1 setTaskState "Succeeded"; _tsk2 = player createSimpleTask ["HVT"]; _tsk2 setSimpleTaskDescription ["Capture the officer for interrogation in Bolabongo. Beforewarned, Captain, the Molatians are swarming all over the city, and the target is without doubt accompanied by guards.", "Arrest HVTs", "Capture the Officer"]; _tsk2 setSimpleTaskDestination (getMarkerPos "mkrHvt"); _tsk2 setTaskState "Assigned"; Task2 = _tsk2; _nil = execVM "midgame.sqf"; }; }; }]; }]; }; -
Help with Understanding SimpleTasks
thecoolsideofthepillow posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
I have a really minor problem with my marked tasks. I needed to create them with a script which I have never done before (I usually just use the modules), and while they work to show up in the map and mark the area, they don't pop up the little box telling the player they have a mission, and setting their state, while working, doesn't show this state to the player. The way I've worked around it for now is to simple delete the task once its complete. I'd like to have the GUI stuff there pop up and everything, though. I feel like I am missing something, I just do not know what. I've created a task with createSimpleTask. I've given it a description with setSimpleTaskDescription. I've given it a waypoint marker with setSimpleTaskDestination. and for those that need it since they were created based on random variable data, I've got a little clean up using simpleTasks to pushBack their names into an array. In the tasks menu, they show up, have the description and can be set to follow or not follow as they should. The only thing that doesn't happen is the little markers next to them letting you know if they are failed or succeeded, and the map markers do not go away when the task is "succeeded," "cancelled," or "failed," hence why I am, right now, simply using removeSimpleTask to delete them once the conditions of success are done. The only thing I think I might need to change is creating a child task for the parents; though I am not sure that's the right solution. Block of code for creating the first set of tasks: { _tskName = format ["taskObj_%1", _x]; _tsk = player createSimpleTask [_tskName]; _tsk setSimpleTaskDescription ["Find and collect the intelligence in the area. Be prepared for hostile contact.", "Gather Intel", "Search Area for Intel"]; _tsk setSimpleTaskDestination (getMarkerPos _x); _tsk setTaskState "Assigned"; startTasks pushBack _tsk; } forEach selectedStart; Code to succeed (and delete) those tasks: if (gatheredIntel >= intelCount) then { { _x setTaskState "Succeeded"; player removeSimpleTask _x; } forEach startTasks; -
Defined a Variable in one line, use it in the next; says undefined?
thecoolsideofthepillow posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
_droppedIntel = "Intel_File1_F" createVehicle (_this select 1); systemChat str _droppedIntel;​ These are lines 4 and 5 of my script. Line 5 throws up an error saying that the "_droppedIntel" variable is undefined, when I am literally defining it in the previous line. What gives?! -
Defined a Variable in one line, use it in the next; says undefined?
thecoolsideofthepillow replied to thecoolsideofthepillow's topic in ARMA 3 - MISSION EDITING & SCRIPTING
What would I change there? I mean, I've tried having no _holderPos and just sending this (and _this; not at the same time) as an argument for execVM, I've also tried no arguments for execVM. I've tried every combination of this/_this select 0/1. They all have similar problems with either undefined variables or expecting the wrong thing for the position of the createVehicle command for the intel. EDIT: OMG. I don't know why that worked, Silent, but it did. I thought arguments for execVM had to be in [] brackets. Is this just a quirk of the event handler thing, or have I been using it wrong the whole time and only by coincidence has my stuff worked? EDIT 2: Well, creating the intel works... Picking it up doesn't work 100%. It adds to your total, sends the radio message, but does not delete the thing, citing an undefined variable in _droppedIntel again. EDIT 3: Ironically, it was the same issue as before. Got it working now. *whew* -
Defined a Variable in one line, use it in the next; says undefined?
thecoolsideofthepillow replied to thecoolsideofthepillow's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I see now... The vehicle isn't being created. No wonder. How do I properly pass a created unit's name to a script through an event handler? What seems to be happening is when I pass "this" to my script played on a unit's death, "this" is an array with the unit's name and some other name. Even if I select 1 (the unit's name), the selection still comes out to the same array as just "this." If I use the 0 selection, it gives me an error saying it was given an array and not a unit. I figured when it stopped giving me errors for creating the vehicle it was working. What I am trying to do is have my random groups have one unit in them to carry some intel. That unit gets an event handler that, when killed, is *supposed* to drop a thing of documents at his corpse. I've been able to get the documents to drop once; but it was dropping at the same unit for every guy who held the documents because I was naming them without the underscore, so it would just make it appear on the last unit the random selection thing landed on after giving them the event handler.\ Here are my scripts as I currently have them written: taskSetup.sqf _grpSelect = enemyGroupTypes call BIS_fnc_selectRandom; if (intelCount >= 3) then { { _resgrp1 = [getMarkerPos _x, EAST, (_grpSelect)] call BIS_fnc_spawngroup; _holder = (units _resgrp1) call bis_fnc_selectRandom; _holderPos = getPos _holder; _holder addEventHandler ["killed", {_nil = [_holderPos] execVM "IntelStuff.sqf"}]; } forEach selectedStart; } else { }; { _tskName = format ["taskObj_%1", _x]; _tsk = player createSimpleTask [_tskName]; _tsk setSimpleTaskDescription ["Find and collect the intelligence in the area. Be prepared for hostile contact.", "Gather Intel", "Search Area for Intel"]; _tsk setSimpleTaskDestination (getMarkerPos _x); _tsk setTaskState "Assigned"; startTasks pushBack _tsk; } forEach selectedStart; IntelStuff.sqf systemChat str _this; _droppedIntel = "Intel_File1_F" createVehicle getPos _this; _droppedIntel addAction ["Gather Intelligence", { deleteVehicle _droppedIntel; gatheredIntel = gatheredIntel + 1; if (gatheredIntel <= intelCount) then { player sideChat "SPEARHEAD to PHALANX. We have neutralized an insurgent team and gathered some documents, over."; sleep 3; PHALANX sideChat "Excellent work, SPEARHEAD. Proceed to locate the rest of the files. PHALANX out." } else { if (gatheredIntel >= intelCount) then { player sideChat "SPEARHEAD to PHALANX. We have collected all the files. Sending details now. How copy? Over."; sleep 10; PHALANX sideChat "Roger, SPEARHEAD. After going over the documents, we've discovered a Molatian officer we need you to arrest."; sleep 3; PHALANX sideChat "Do not kill the officer. Repeat DO NOT KILL THE MOLATIAN OFFICER. We need to interrogate him to find out what he may know."; sleep 3; PHALANX sideChat "How copy, SPEARHEAD? Over."; sleep 3; player sideChat "Copy, PHALANX. Capture, not kill, the HVT. SPEARHEAD out."; _tsk = player createSimpleTask ["HVT"]; _tsk setSimpleTaskDescription ["Capture the officer for interrogation in Bolabongo. Beforewarned, Captain, the Molatians are swarming all over the city, and the target is without doubt accompanied by guards.", "Arrest HVTs", "Capture the Officer"]; _tsk setSimpleTaskDestination (getMarkerPos "mkrHvt"); _tsk setTaskState "Assigned"; }; }; }];​ ​ -
Can I Detect Units in Shadow/Shade?
thecoolsideofthepillow posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Probably a stupid question: Can I detect any/all units being in the shade/a shadow? My gut says no, but maybe my gut is wrong. I searched but didn't find anything, though I often get told later something that would work that just didn't match my search query. -
Help with timing of script execution
thecoolsideofthepillow replied to thecoolsideofthepillow's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Sweet! That worked. Much thanks :D -
Help with timing of script execution
thecoolsideofthepillow posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
I want to select a random group of things and delete those not selected. I made a script to put everything I wanted deleted in an array, and then delete the things. It works just fine... Just not if ran from init. If I run it again after I am in control of a player character, it works fine. It puts everything in the array and does everything else I want except for deleting the things, including things told to be done after the deletion of the things, like marking the remaining things on the map. I am not sure where I should move the bit that deletes the things or how to check if it's okay to delete the things I want to delete. I am assuming maybe some kind of wait until/for something else happens, but am not sure. -
Help with timing of script execution
thecoolsideofthepillow replied to thecoolsideofthepillow's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Here is the script in question: //Variables objectiveStart = [Obj1Area, Obj1Area_1, Obj1Area_2, Obj1Area_3, Obj1Area_4, Obj1Area_5, Obj1Area_6, Obj1Area_7, Obj1Area_8, Obj1Area_9, Obj1Area_10, Obj1Area_11, Obj1Area_12, Obj1Area_13, Obj1Area_14, Obj1Area_15, Obj1Area_16, Obj1Area_17, Obj1Area_18, Obj1Area_19, Obj1Area_20, Obj1Area_21, Obj1Area_22, Obj1Area_23, Obj1Area_24, Obj1Area_25, Obj1Area_26, Obj1Area_27, Obj1Area_28]; objectiveMid = [Obj2Area, Obj2Area_1, Obj2Area_2, Obj2Area_3, Obj2Area_4, Obj2Area_5, Obj2Area_6, Obj2Area_7]; selectedStart = []; selectedMid = objectiveMid call BIS_fnc_selectRandom; cleanup = []; //Code for "_i" from 1 to 3 do {_rndObj1 = objectiveStart call BIS_fnc_selectRandom; selectedStart pushBack _rndObj1}; { if !(_x in selectedStart) then { cleanup pushBack _x; }; } forEach objectiveStart; { if !(_x isEqualTo selectedMid) then { cleanup pushBack _x; }; } forEach objectiveMid; { { deleteVehicle _x; } forEach list _x; } forEach cleanup; { _tskName = format ["taskObj_%1", _x]; _tsk = player createSimpleTask [_tskName]; _tsk setSimpleTaskDescription ["Find and collect the intelligence in the area. Be prepared for hostile contact.", "Gather Intel", "Search Area for Intel"]; _tsk setSimpleTaskDestination (getPos _x); _tsk setTaskState "Assigned"; } forEach selectedStart; //Comment/Uncomment for Debugging { _mkrName = format ["taskMkr_%1", _x]; _mkr = createMarker [_mkrName, getPos _x]; _mkrName setMarkerShape "ICON"; _mkrName setMarkerType "mil_dot"; _mkrName setMarkerColor "colorRed"; _mkrName setMarkerAlpha 1; } forEach selectedStart; _mkr2 = createMarker ["mkrNameMid", getPos selectedMid]; _mkr2 setMarkerShape "ICON"; _mkr2 setMarkerType "mil_dot"; _mkr2 setMarkerColor "colorRed"; _mkr2 setMarkerAlpha 1; hint str cleanup; systemChat str objectiveStart; player sideChat str selectedStart; ​ I am trying to delete the units within the trigger areas of the zones not selected to keep, and I want to do this at the beginning of the mission since it's tied to how I am setting up tasks. Normally I would just spawn what I needed instead of deleting what I don't, but I need the units I want to keep in very specific spots (on/in buildings) so I used MCC to place them in Zeus and save to the .SQM so they'd be in the right position at every instance, every time. All the things I want to delete are already on the map (in the editor, anyway). I don't know exactly when the init.sqf runs compared to when the units are actually available to be played with, but I have also tried executing the script from a game logic object's init line with the theory that if that is ready to run its init, then surely the units are there to be deleted, but it didn't work either.