xcom Posted October 13, 2012 Posted October 13, 2012 Hi, I'm trying to make my units move to the next WP only by a trigger, and then return to the 1st WP again only by a trigger. I've been trying 2 things that i could think of - 1. AI Task - Triggered Actions - Switch Waypoint - WP of my selection (the line in the Triggered Actions is red for some reason). This does not work, i know my conditoin is met and that other actions are performed because there is smoke popping. 2. WP 1 - 1) hold > stop condition - is user (1) WP 2 - 1) hold > stop condition - is user (1), 2) Switch WP This does not work either, I don't really know what does stop condition - is user (1/2/...) does, can anyone explain? couldn't find it in the manual. I'd love any suggestions and obviously fixes or explanations to why what i was trying to do didn't work. Thanks. [sIGPIC][/sIGPIC] BuddySpike Website | Live Map & Statistics BuddySpike Twitch Channel Buddyspike Discord Buddyspike Facebook
Speed Posted October 13, 2012 Posted October 13, 2012 Well, keep in mind, I don't have access to the actual game right now, but I'm a little confused here- how do you have both hold and switch waypoint actions on the same group?! Last I checked, switch waypoint is only available to air groups, and hold position is only available to ground groups. So are you using a airplane, helo, ship, or ground group? Makes a big difference, and you don't mention. I had thought you were using an plane or helicopter group until you mentioned the hold position task. The rough equivalent of the hold position task for air groups is orbit. Anyway, still need more info, but based off your description for your first part of the question, it seems like you might not understand that triggered actions are triggered actions- the only way a triggered action ever runs is by telling it to run with the AI TASK trigger action. The conditions part of a triggered action specifies any additional conditions you place on the triggered action- so basically, when the AI TASK trigger action is called on the triggered action, these additional extra conditions must be true for the triggered action to run. So the condition on triggered actions is only rarely useful. However the stop conditions for triggered actions/waypoint actions are frequently useful. They work just like you think they should- when the triggered action begins running, then the stop conditions are continuously evaluated, and, if they become true, the triggered action ends immediately. Intelligent discourse can only begin with the honest admission of your own fallibility. Member of the Virtual Tactical Air Group: http://vtacticalairgroup.com/ Lua scripts and mods: MIssion Scripting Tools (Mist): http://forums.eagle.ru/showthread.php?t=98616 Slmod version 7.0 for DCS: World: http://forums.eagle.ru/showthread.php?t=80979 Now includes remote server administration tools for kicking, banning, loading missions, etc.
xcom Posted October 13, 2012 Author Posted October 13, 2012 Hi Speed, Thanks for your response, I'm aware of how it works, I was just trying to be creative and make it work for what I need. I found a way to make it work, the ground units now go to a specified WP after being engaged, here are my triggers and conditions. Waypoint Actions - WP 0 WP 1 Triggered Actions - Triggers - Units engaged and move to WP 1 - Units return to WP 0 - Everything works but the return of the units to WP 0, the switch waypoint does not work for some reason and the units just continue to WP 2 after the resume action. Any suggestions on how to solve this problem, or is there anything wrong with my setup of the triggers? BTW - I still didn't understand how to use the "is user" stop condition, i managed to use all the others but this one, can anyone explain how it works? Thanks! [sIGPIC][/sIGPIC] BuddySpike Website | Live Map & Statistics BuddySpike Twitch Channel Buddyspike Discord Buddyspike Facebook
MadTommy Posted October 13, 2012 Posted October 13, 2012 The Switch Waypoint only works on Air units. It should not be possible to select it from Perform Command .. I have no idea how you have done that.. it certainly is not available for me. i5-3570K @ 4.5 Ghz, Asus P8Z77-V, 8 GB DDR3, 1.5GB GTX 480 (EVGA, superclocked), SSD, 2 x 1680x1050, x-fi extreme music. TM Warthog, Saitek combat pro pedals, TrackIR 4
xcom Posted October 13, 2012 Author Posted October 13, 2012 That options is sometimes available and sometimes unavailable, I got no idea why... bug? So this means there is no way to tell the units to go back and forth if they are engaged without doing many WPs? There must be a way to do this... [sIGPIC][/sIGPIC] BuddySpike Website | Live Map & Statistics BuddySpike Twitch Channel Buddyspike Discord Buddyspike Facebook
MadTommy Posted October 13, 2012 Posted October 13, 2012 That options is sometimes available and sometimes unavailable, I got no idea why... bug? So this means there is no way to tell the units to go back and forth if they are engaged without doing many WPs? There must be a way to do this... Must be a bug.. i've never seen it for a ground unit. The only possible way might be with 'Stop and Deploy to Template' with but that is a bit of a minefield. Not a route i'd advise. Have a look here. http://forums.eagle.ru/showthread.php?t=69024&highlight=Stop+Deploy+Template i5-3570K @ 4.5 Ghz, Asus P8Z77-V, 8 GB DDR3, 1.5GB GTX 480 (EVGA, superclocked), SSD, 2 x 1680x1050, x-fi extreme music. TM Warthog, Saitek combat pro pedals, TrackIR 4
Speed Posted October 13, 2012 Posted October 13, 2012 Yea, definitely a bug- switch waypoint is not supposed to be available to ground units. They cannot do it. Intelligent discourse can only begin with the honest admission of your own fallibility. Member of the Virtual Tactical Air Group: http://vtacticalairgroup.com/ Lua scripts and mods: MIssion Scripting Tools (Mist): http://forums.eagle.ru/showthread.php?t=98616 Slmod version 7.0 for DCS: World: http://forums.eagle.ru/showthread.php?t=80979 Now includes remote server administration tools for kicking, banning, loading missions, etc.
xcom Posted October 13, 2012 Author Posted October 13, 2012 OK, what Grimes says in that link you gave should work, but ofcourse it's not bullet proof as he wrote, therefore I'm still thinking of making many WPs. Just 1 more thing, if I make many WPs will the trigger i entered work each time? like for under 95% of group and then under 75% of group or should there be a different trigger each time? [sIGPIC][/sIGPIC] BuddySpike Website | Live Map & Statistics BuddySpike Twitch Channel Buddyspike Discord Buddyspike Facebook
MadTommy Posted October 13, 2012 Posted October 13, 2012 Not 100% sure what you mean, but a trigger will work on any group still alive, so if you have one unit from a group of a 100 it will still work. AI tasks can be reused numerous times. i5-3570K @ 4.5 Ghz, Asus P8Z77-V, 8 GB DDR3, 1.5GB GTX 480 (EVGA, superclocked), SSD, 2 x 1680x1050, x-fi extreme music. TM Warthog, Saitek combat pro pedals, TrackIR 4
xcom Posted October 13, 2012 Author Posted October 13, 2012 Sorry for not clarifing - units go to WP1 after condition under 95%, then units return to WP2 (WP0 again) after 5 minutes. My question is will my condition work again only after they go under 75% of the group alive to resume to WP3 (WP1 again)? [sIGPIC][/sIGPIC] BuddySpike Website | Live Map & Statistics BuddySpike Twitch Channel Buddyspike Discord Buddyspike Facebook
Speed Posted October 14, 2012 Posted October 14, 2012 (edited) Sorry for not clarifing - units go to WP1 after condition under 95%, then units return to WP2 (WP0 again) after 5 minutes. My question is will my condition work again only after they go under 75% of the group alive to resume to WP3 (WP1 again)? No, that's faulty logic. What you have is: IF (previous evaluation of trigger conditions was false) AND (condtion1 OR condition2 OR condition3 OR condition4) THEN (Do trigger actions) The problem is, your condition1, group alive less than 95%, once it becomes true it will always be true. So your trigger will only execute once, ever, because of the switched condition requirement. Logically, a switched condition adds the bolded part below to your trigger: IF (previous evaluation of trigger conditions was false) AND (trigger conditions) THEN (trigger actions) So basically, what you need to do to make that logic work the way you want it to work is to split it up into four separate triggers: Switched->Group Alive Less than 95% -> (actions) Switched->Group Alive Less than 65% -> (actions) Switched->Group Alive Less than 45% -> (actions) Switched->Group Alive Less than 25% -> (actions) Edited October 14, 2012 by Speed Intelligent discourse can only begin with the honest admission of your own fallibility. Member of the Virtual Tactical Air Group: http://vtacticalairgroup.com/ Lua scripts and mods: MIssion Scripting Tools (Mist): http://forums.eagle.ru/showthread.php?t=98616 Slmod version 7.0 for DCS: World: http://forums.eagle.ru/showthread.php?t=80979 Now includes remote server administration tools for kicking, banning, loading missions, etc.
xcom Posted October 14, 2012 Author Posted October 14, 2012 Thanks! Btw, still wondering on the stop condition - is user... what does it do exactly? couldn't find anything about it. [sIGPIC][/sIGPIC] BuddySpike Website | Live Map & Statistics BuddySpike Twitch Channel Buddyspike Discord Buddyspike Facebook
EvilBivol-1 Posted October 14, 2012 Posted October 14, 2012 Thanks! Btw, still wondering on the stop condition - is user... what does it do exactly? couldn't find anything about it. Executes the condition if set flag is true (when box on the right is checked) or false (when box on the right us unchecked). - EB [sIGPIC][/sIGPIC] Nothing is easy. Everything takes much longer. The Parable of Jane's A-10 Forum Rules
Grimes Posted October 14, 2012 Posted October 14, 2012 "Is user" is the same as "is flag" So if "flag is true" or "flag is false". Which depends on whether or not the little tick-box is checked. Checked == true, unchecked == false. In other words. If flag x is true (or false) then stop doing the action. The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
xcom Posted October 14, 2012 Author Posted October 14, 2012 Thanks for the explanation. So as I understand the 2nd try I did should also work - 2. WP 1 - 1) hold > stop condition - is user (1) WP 2 - 1) hold > stop condition - is user (1), 2) Switch WP with the correct triggers ofcrouse and with no Switch WP obviously. [sIGPIC][/sIGPIC] BuddySpike Website | Live Map & Statistics BuddySpike Twitch Channel Buddyspike Discord Buddyspike Facebook
Speed Posted October 14, 2012 Posted October 14, 2012 (edited) Thanks for the explanation. So as I understand the 2nd try I did should also work - 2. WP 1 - 1) hold > stop condition - is user (1) WP 2 - 1) hold > stop condition - is user (1), 2) Switch WP with the correct triggers ofcrouse and with no Switch WP obviously. :huh: What? What's this "WP 1-1", "WP 2-1", "is user (1), 2" (bolded parts I don't understand). So if you want a ground group to hold at a waypoint, then move to the next on a trigger, you use Hold action on waypoint 1, stop condition: IS USER (1) Hold action on waypoint 2, stop condition: IS USER (2) Hold action on waypoint 3, stop condition: IS USER (3) You CAN reuse the same flag for these stop conditions, but only if you reset the flag to false before the ground group reaches the next waypoint- otherwise, they'll just sail right on through the waypoint without stopping because the stop condition is true. That is easy to do, for example, if you flag you are using to end the hold is flag 1, then SWITCHED -> TIME SINCE FLAG (1, 10) -> FLAG OFF (1) However, the problem is, in most situations, it will be possible for this flag to become true before the ground group reaches the waypoint, and that will probably not be what you desire. You can best handle this situation with a LUA CONDITION stop condition on your hold condition instead of a IS USER stop condition: if next_wypnt then next_wypnt = false return true end Now, instead of a FLAG ON (X) trigger action to stop your hold, you use a DO SCRIPT: DO SCRIPT ( next_wypnt = true ) Edited October 14, 2012 by Speed Intelligent discourse can only begin with the honest admission of your own fallibility. Member of the Virtual Tactical Air Group: http://vtacticalairgroup.com/ Lua scripts and mods: MIssion Scripting Tools (Mist): http://forums.eagle.ru/showthread.php?t=98616 Slmod version 7.0 for DCS: World: http://forums.eagle.ru/showthread.php?t=80979 Now includes remote server administration tools for kicking, banning, loading missions, etc.
xcom Posted October 14, 2012 Author Posted October 14, 2012 Thanks for the answer Speed. What I wrote is exactly as you did, I just used the same flag each time. (obviously gotta work on my technical writing skills :doh:) does next_waypoint only get True/False? where can i see more lua scripts like that? I found the Wiki - http://en.wiki.eagle.ru/wiki/Drafts/Simulator_Scripting_Engine But the scripts look diffrent there. btw, will this work? SwitchWaypoint = { id = 'SwitchWaypoint', params = { fromWaypointIndex = number, goToWaypointIndex = number, } } [sIGPIC][/sIGPIC] BuddySpike Website | Live Map & Statistics BuddySpike Twitch Channel Buddyspike Discord Buddyspike Facebook
Speed Posted October 14, 2012 Posted October 14, 2012 Thanks for the answer Speed. What I wrote is exactly as you did, I just used the same flag each time. (obviously gotta work on my technical writing skills :doh:) does next_waypoint only get True/False? next_wypnt is just a variable name in the stop condition. I called it "next_wypnt" because it signifies to the ground group that it should move on to the next waypoint. btw, will this work? No, the AI of ground groups cannot possibly do switch waypoint. Switch waypoint only exists for aircraft AI, that you can even select it in the ME for a ground group is a bug. Also, you have to assign the action with the Controller.pushTask function. Intelligent discourse can only begin with the honest admission of your own fallibility. Member of the Virtual Tactical Air Group: http://vtacticalairgroup.com/ Lua scripts and mods: MIssion Scripting Tools (Mist): http://forums.eagle.ru/showthread.php?t=98616 Slmod version 7.0 for DCS: World: http://forums.eagle.ru/showthread.php?t=80979 Now includes remote server administration tools for kicking, banning, loading missions, etc.
xcom Posted October 16, 2012 Author Posted October 16, 2012 (edited) Speed, Thanks for that script... works like a charm :D I've set few groups to respond to each other, the scenario is an engaging force is ambushed, when the ambushed force is hit it retreats to a secondery and third holding areas and alerting the coalition by a message and by popping smoke. Meanwhile the engaging units proceed after few minutes of regrouping. Ambush units - Triggers: run once - if group alive less 90% - send message,pop smoke,do script (next_wypnt = true),flag(1) on. run once - if group alive less 65% - send message,pop smoke,do script (next_wypnt = true),flag(1) on. run once - if group alive less 30% - send message,pop smoke,do script (next_wypnt = true),flag(1) on. Waypoint advanced triggers - WP1 - hold - stop condition ( if next_wypnt then next_wypnt = false return true end ) WP2 - hold - stop condition ( if next_wypnt then next_wypnt = false return true end ) WP3 - hold - stop condition ( if next_wypnt then next_wypnt = false return true end ) Engaging units - Triggers: Switched Condition - Flag(1) on, Time more since flag (300) - do script (next_wypnt_engaging = true), Flag(1) off. Waypoint advanced triggers - WP1 - hold - stop condition( if next_wypnt_engaging then next_wypnt_engaging = false return true end ) WP2 - hold - stop condition( if next_wypnt_engaging then next_wypnt_engaging = false return true end ) WP3 - hold - stop condition( if next_wypnt_engaging then next_wypnt_engaging = false return true end ) Still testing, but this seems to be working, obviously needs some tweeking. Thanks for your help! Edited October 16, 2012 by xcom [sIGPIC][/sIGPIC] BuddySpike Website | Live Map & Statistics BuddySpike Twitch Channel Buddyspike Discord Buddyspike Facebook
Recommended Posts