mattyfo 10 Posted September 22, 2011 I'm trying to create a dynamic mission I can play a hundred times over and have it very different each time. I would like to have units retreat from the battlefield given certain conditions. One of those conditions is, if the group leader is killed, the rest of the group retreats. I tried setting all the group's waypoints then the last waypoint is a full-speed, careless, never fire move waypoint. I have a !alive trigger with the group leaders name synced to that groups waypoint before the final "retreat" waypoint. However, in all my tests thus far, I snipe the group leader and kill him yet the group goes into combat mode searches for me and engages when they spot my location. I figure either the trigger is not being activated, or the group wants to continue it's path until the final retreat waypoint. I always thought that once a trigger is synced to a waypoint, when it is activated it will skip all waypoints and proceed with the next waypoint immediatly after the synced one, am I wrong? If you still feel like reading... The other retreat condition would be for a group to retreat once it losses or has a certain number of combatants remaining. I know I did this succesfully in OFP:R but cannot remember the script or find the tutorial that showed me how. From what I remember i think it have to be in the condition field of the "retreat" waypoint. I'm not sure how or even if it would work with the group leader killed option as the would be completely seperate conditions and both will be linked to the same waypoint. It would be great if anyone can help me out with either of these problem. As for me it's time to launch the game and see if I can't figure this out. I'll try tinkering with the setfleeing init command and see how that works for me as I have never dabbled with that one yet. P.S Sorry for my reckless use of the word "waypoint" Share this post Link to post Share on other sites
jakerod 254 Posted September 22, 2011 (edited) You need to make it so that the trigger is of the Switch type or else it won't work. Additionally, it has to be synced to the waypoint before the one that you want them to retreat to. So if your last waypoint is waypoint 8, it has to be synced to waypoint 7. The way I have been doing retreating lately is this way: Create a Trigger and : area1 Set the radius to cover the area that the enemy is in and set it to their side. Make another Trigger and put in the following: Condition: {alive _x} count list area1 <= 5 Activation: {_x domove (getMarkerPos "fallback")} forEach list area1; This counts the numbers of enemies in the area and if it is less than or equal to five the enemies in the area will run to a marker called fallback. You could easily just set the trigger to a switch type and sync it to the second to last waypoint. If you do that you can ignore the stuff in the activation field. Edited September 22, 2011 by Jakerod Share this post Link to post Share on other sites
mattyfo 10 Posted September 22, 2011 thanks for your help but neither of these methods give the results i'm looking for. I tried the !alive method by instead of using a Move waypoint for the retreat, I use a guard waypoint instead. The AI seems to fall back a little but just to position themselves a few meters back then they engage again despite being set to NEVER FIRE!!! they do this consistently and even without my lone sniper shooting at them it still took them about 15 minutes to get only a few hundred meters. All the while they were just beautiful targets. I'm looking to have the AI drop everything they are doing and sprint as fast as they can back to where they came from. Surely this can't be impossible. I tried tinkering with numbers in the command: this allowfleeing 50, or w/e number I chose. Still the AI, in this case, has that ever so annoying habit of wanting to shoot at his enemies. Share this post Link to post Share on other sites
jakerod 254 Posted September 22, 2011 allowfleeing I believe only goes up to 1. Two Ideas: DisableAI enableAttack Share this post Link to post Share on other sites
Kommiekat 12 Posted September 22, 2011 I hope this is still on topic: What is the SWITCH for anyways? I tried looking it up. Very little on it. When would I want to use it? KK Share this post Link to post Share on other sites
jakerod 254 Posted September 22, 2011 I hope this is still on topic:What is the SWITCH for anyways? I tried looking it up. Very little on it. When would I want to use it? KK From the Biki Switch - A switch trigger is very useful for "breaking" a group out of a Cycle waypoint loop, or moving the group away from a Hold or Guard waypoint. When the trigger is synchronized with a waypoint, activating the trigger will instantly change the group's current waypoint to the first waypoint after the synchronized one. Note the synchronized waypoint's On Activation block is not executed. I commonly use it when I have units patrolling using two or more waypoints with a cycle waypoint. If you put a waypoint after the cycle one and sync the trigger to the cycle waypoint the group will go to the waypoint after the cycle waypoint once the trigger is activated. So if BLUFOR was detected by OPFOR you might have an OPFOR squad that is patrolling suddenly stop patrolling and move towards the BLUFOR group. Share this post Link to post Share on other sites
st_dux 26 Posted September 22, 2011 If you're using the beta, add the following line to your trigger's activation field: {_x disableAI "FSM"} forEach units <group> (replace <group> with the group name of the AI units you want to retreat) If you're not using the beta, you're pretty much out of luck until 1.60, because once the AI know there's an enemy in the area they go into danger FSM mode, and they are basically unresponsive until they feel it is safe. Share this post Link to post Share on other sites
AZCoder 921 Posted September 22, 2011 Nice one, St_Dux, I like the idea of disabling the fsm in certain cases. Share this post Link to post Share on other sites
sixt 26 Posted September 22, 2011 this could be cool as an addon :-) Share this post Link to post Share on other sites
mattyfo 10 Posted September 22, 2011 (edited) OK, I use ACE2 mod and some parts of the SLX mod. The only PBOs in SLX I think would affect the AI's retreat would be findcover and suppresioneffects. I've never really tried scripting behavioral commands before, mostly just to change unit load-outs, put them in vehicles etc. I'll try disabling the FSM and see if that works for me, as soon as I figure out how to name groups. I'm sure i'll find my answer to that anywhere on the biki or with a quick google search, even youtube can be very helpful these days. Just a thought though, if it turns out that say, slx_findcover.pbo is causing this problem, would it be possible to disable it, then possibly re-enable a pbo by use of code? Of course this could go for any pbo that may have a conflict or cause an issue with some aspect of the game. EDIT: after disabling the FSM, enemy units just stood there and did absolutly nothing, not quite the results I wanted. Literally nothing. Using my !alive waypoint method: Aswell as using my lone sniper, i added a AIgroup of independant guerillas to help persuade the OPfor to retreat. That seemed to work, the AI is smarter then I thought. My original test was a lone sniper in a open field, making a full fledged retreat a suicide attempt. When I added the guerillas, I took one shot to kill the leader amidst the firefight. The Opfor fell back much faster than normal, but still returned fire to cover their backs. I think if I incorporate this method into a large scale battle in a more wooded hilly map, Capraia Island, as oppose to the open green fields of MGB's Cindercity, I may get better responses. Although, I would still like to find a way to make the AI run as faster than Hussein Bolt off the battlefield. Any thoughts? Edited September 23, 2011 by mattyfo did more tinkering Share this post Link to post Share on other sites
jakerod 254 Posted September 23, 2011 Did you try using either and or both of these: DisableAI enableAttack With disableAI it may be better to disable Target and AutoTarget rather than FSM. And then enableAttack false. I normally do {_x enableattack false} foreach units groupnamehere. I've never been sure if only using it on the leader works so I use it on every member. Share this post Link to post Share on other sites
st_dux 26 Posted September 23, 2011 EDIT: after disabling the FSM, enemy units just stood there and did absolutly nothing, not quite the results I wanted. Literally nothing. This was when they had active waypoints? That's odd. Share this post Link to post Share on other sites