automag928 Posted June 24, 2011 Posted June 24, 2011 On my way to making my first mission, and I thought I had it figured out, but its not working. I'm sure its easy for most of you pros in here, but I just cant get it. I'm trying to make a unit stop at a waypoint if another unit is destroyed. I've got the unit selected, goto the waypoint I want him to stop at, hit advanced options, add , perform task -> hold, then condition, the IS USER is checked, and the number 1 in the box, and a check mark in the box to the right of that. So this should mean at waypoint 1, hold if flag 1 is true? Then in my triggers, I have a ONCE (event ON DESTROY), Condition is UNIT DEAD, unit #5, and then Action is FLAG ON, 1. So if I destroy unit 5, then flag 1 should go on right? The unit I want to stop is defintely not making to the way point before I destroy unit 5, so I wouldnt think it would be a timing issue?
Grimes Posted June 24, 2011 Posted June 24, 2011 Add a text message to the trigger to verify that it is indeed setting flag 1 to true. 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
automag928 Posted June 24, 2011 Author Posted June 24, 2011 Add a text message to the trigger to verify that it is indeed setting flag 1 to true. Geesh that is a simple test! I will try that and let you know. Thanks!!
automag928 Posted June 25, 2011 Author Posted June 25, 2011 Ok, so that worked...I get the msg when the unit is destroyed. So that would mean my problem lies with my unit commands... It would be a start condition and not a stop condition right? Also, is there a way to take screen shots of the mission editor, I tried for the life of me and all I get when I do a print screen is a capture of my desktop. I tried in windowed and full screen mode, no change.
nomdeplume Posted June 25, 2011 Posted June 25, 2011 (edited) When you hit printscreen, the game should save a screenshot into your 'ScreenShots' directory, which on Vista/Win7 will be C:\Users\username\Saved Games\DCS Warthog\ScreenShots. It does sound like you're doing it properly, it should definitely be a 'hold' task with a start condition of 'is user flag 1'. Make sure you don't have any 'stop conditions' checked. Bear in mind that waypoint actions are only run once, when the unit arrives at the waypoint. So if it's already past the waypoint, the 'hold' action would've already been processed (and ignored, since the flag wasn't set) and it won't be processed again. Also, ground units, upon arriving at a waypoint, will re-orient themselves to face in the direction of the next waypoint in their path, even if they've been told to hold. This is useful because it lets you point the group in a particular direction, but can involve a bit of shuffling around which might make you think they've ignored your command to stop. Attached is an example mission, with a stationary tank as the target, and another tank running a series of waypoints (with smoke markers at the ends of each segment). If you kill the tank (or use the radio menu option to explode it) then flag 1 will be set, and the moving unit will stop when it reaches its next waypoint.HoldOnFlag.miz Edited June 25, 2011 by nomdeplume
Grimes Posted June 25, 2011 Posted June 25, 2011 A workaround would be, Part of group in zone and flag 1 is true-> Stop and deploy to template (or a triggered action of "hold") With the zone being the area of the waypoint. Probably a little bit more realistic so they wont be in a nice orderly line waiting to be killed :D. 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
automag928 Posted June 25, 2011 Author Posted June 25, 2011 (edited) When you hit printscreen, the game should save a screenshot into your 'ScreenShots' directory, which on Vista/Win7 will be C:\Users\username\Saved Games\DCS Warthog\ScreenShots. Perfect! Thank you! Completely forgot to check the DCS screenshots folder! Doh! :doh: Bear in mind that waypoint actions are only run once, when the unit arrives at the waypoint. So if it's already past the waypoint, the 'hold' action would've already been processed (and ignored, since the flag wasn't set) and it won't be processed again. I'm definitely destroying the "cmdr" unit before the other unit makes it to the waypoint. Attached is an example mission, with a stationary tank as the target, and another tank running a series of waypoints (with smoke markers at the ends of each segment). If you kill the tank (or use the radio menu option to explode it) then flag 1 will be set, and the moving unit will stop when it reaches its next waypoint. I could swear I've got mine setup exactly like yours, but mine isnt working, so I must be doing something wrong. Heres the setup - The "cmdr" unit is the one sitting right on the bridge. I'm trying to blow the bridge to prevent other units from crossing, using the cmdr unit as the trigger, since I couldnt show the bridge blowing in a trigger. The waypoint I want the truck to stop at is the 1, right before the bridge. The reason for all this silliness is that even with the bridge blown, the trucks drive right over the water and cross anyways, hence me generating this trigger to stop them once the bridge is blown. And the trigger - When you blow up the cmdr unit, I get the msg so I know the trigger is working. I've changed the flag number to 5 to make sure I wasn't using 1, and no change. I've attached the mission, hopefully someone can take a quick peek and tell me what I'm screwing up!quick_CSAR.miz Edited June 25, 2011 by automag928 spelling
Ripcord Posted June 25, 2011 Posted June 25, 2011 I was going to suggest that maybe you might need to use the SWITCHED CONDITION type trigger vs the 1 ONCE type that you have use here for your Stop Trucks trigger. Then I read NPD's reply again.... "in my triggers, I have a ONCE (event ON DESTROY), Condition is UNIT DEAD, unit #5, and then Action is FLAG ON, 1." So try that, go in to that trigger and change your NO EVENT to ON DESTROY. See if it make a difference. What makes you think the mission is not working? Are you in fact hearing/seeing that bombs away message? Ripcord [sIGPIC][/sIGPIC]
nomdeplume Posted June 25, 2011 Posted June 25, 2011 What happens if you move the waypoint you want the unit to stop at further from the bridge? The AI will re-route around unpassable terrain (such as, the bridge when it's broken) - maybe it's repositioning that waypoint or otherwise is no longer actually reaching that waypoint?
automag928 Posted June 25, 2011 Author Posted June 25, 2011 I was going to suggest that maybe you might need to use the SWITCHED CONDITION type trigger vs the 1 ONCE type that you have use here for your Stop Trucks trigger. Then I read NPD's reply again.... "in my triggers, I have a ONCE (event ON DESTROY), Condition is UNIT DEAD, unit #5, and then Action is FLAG ON, 1." So try that, go in to that trigger and change your NO EVENT to ON DESTROY. See if it make a difference. What makes you think the mission is not working? Are you in fact hearing/seeing that bombs away message? Ripcord I've tried changing the NO EVENT to ON DESTROY, no change. The trigger is not working on the trucks, they should stop at the waypoint if the cmdr unit is dead, but they dont. But I do get the message "bombs away" so the trigger/flag is being initiated the unit is just not responding to it.
automag928 Posted June 25, 2011 Author Posted June 25, 2011 What happens if you move the waypoint you want the unit to stop at further from the bridge? The AI will re-route around unpassable terrain (such as, the bridge when it's broken) - maybe it's repositioning that waypoint or otherwise is no longer actually reaching that waypoint? Good point, let me try.
nomdeplume Posted June 25, 2011 Posted June 25, 2011 Delete the 'hold' task and re-add it. That seems to fix it. Not sure what the issue really is, but it's clearly not saved it out correctly in the original mission. I experimented with it for a while and that was what I found fixed it. There's a surprising amount of stuff that's changed in the mission file just from re-saving it, although most of it's just reordering parameters. I think that some part of the logic is looking for the flag to be false when the vehicle arrives. In fact, I just re-ran it without setting that flag true, and the vehicle stops. So it's that simple: the actual mission logic is only activating that 'Hold' statement when the flag is false. Note that the checkbox next to the flag number (to decide whether the flag needs to be true or false) doesn't work properly. It kind of does (in that it'll save the mission file with the correct logic), but the GUI doesn't reflect it properly (re-open the task and the checkbox will be selected, indicating true, even if the actual logic is false). So my recommendation is to not ever use that (at least, until/unless ED fix it) and only use 'flag is true' conditions in that dialog.
automag928 Posted June 25, 2011 Author Posted June 25, 2011 What happens if you move the waypoint you want the unit to stop at further from the bridge? The AI will re-route around unpassable terrain (such as, the bridge when it's broken) - maybe it's repositioning that waypoint or otherwise is no longer actually reaching that waypoint? Ok, I moved the waypoint a considerable ways before the bridge, the truck blows right through the waypoint. Also, since i originally created that mission a patch or two ago, I decided to start over new, on 1.1.0.8. Created a new mission, same setup, but made another unit ROE's Weapons free on flag 1. So, I'm getting the msg when the truck is blown up, I'm getting the change in ROE, and however the truck is ignoring it...
automag928 Posted June 25, 2011 Author Posted June 25, 2011 (edited) So my recommendation is to not ever use that (at least, until/unless ED fix it) and only use 'flag is true' conditions in that dialog. Ok, I sort of understand what you are saying...but what do you mean only use 'flag is true' conditions? Are you talking about the IS USER then # field, then check mark? Don't every check/uncheck the check mark? I also tried deleting the hold and re-adding as you suggested - no change...? My truck keeps going past the waypoint. I'm wondering if I should do a clean install of 1.1.0.8, I think I patched from a full install of 1.1.0.7. Edited June 25, 2011 by automag928
nomdeplume Posted June 26, 2011 Posted June 26, 2011 Are you talking about the IS USER then # field, then check mark? Don't ever check/uncheck the check mark? Yep, that's what I mean. It does seem to change the logic for the field, but it's not reflected in the GUI which makes it a real pain to tell what it's actually checking for. It's also kind of tricky to fix, as we've seen! I also tried deleting the hold and re-adding as you suggested - no change...? Okay I've just re-tested, and it seems the way that actually fixes it is to delete the hold command, save the mission, re-load the mission in the editor, and then add the hold command again. That seems to properly clear up the errant logic that's being saved, and makes it start behaving as the GUI indicates it should. I guess the editor doesn't remove all the logic for the task when you delete it - you need to re-load with a fresh mission to get it properly removed.
Sleem Posted June 26, 2011 Posted June 26, 2011 I've been having similar problems with flags sometimes working and then not. Flags not working properly when being edited makes the Mission Editor even more tricky to learn. If save and then reload the mission works, that's a great find. Thanks!
automag928 Posted June 26, 2011 Author Posted June 26, 2011 Okay I've just re-tested, and it seems the way that actually fixes it is to delete the hold command, save the mission, re-load the mission in the editor, and then add the hold command again. That seems to properly clear up the errant logic that's being saved, and makes it start behaving as the GUI indicates it should. I guess the editor doesn't remove all the logic for the task when you delete it - you need to re-load with a fresh mission to get it properly removed. You nailed it, works beautifully now! Deleted the hold, saved the mission, exiting the ME, went back in, edited the hold back in, and flew it and it works. You can't understand how happy I am now! :lol: Im wondering if I'm the only one having these issues or if others are as well? I also am curious if this is a case of patching, versus full install? Regardless, thank you for your help!!!!
automag928 Posted June 26, 2011 Author Posted June 26, 2011 Ok this sucks...Everytime I save, I have to delete the hold command for EVERY unit, then readd and resave...I just tried adding a new vehicle, saved, added the hold, saved, deleted the hold, saved, readded, saved, and it worked for THAT unit, but not the original unit that WAS working.
Sleem Posted June 26, 2011 Posted June 26, 2011 I am running latest full install and it happens here also. Needs a fix from ED or workaround using a trigger zone I think. :(
automag928 Posted June 26, 2011 Author Posted June 26, 2011 I am running latest full install and it happens here also. Needs a fix from ED or workaround using a trigger zone I think. :( Ok, glad to see I'm not the only one... This is so frustrating...
Speed Posted June 27, 2011 Posted June 27, 2011 (edited) I've always had troubles getting the hold command working correctly. A lot of times, the ground units wouldn't stop despite the stop command clearly being called. I usually can get them working after a very long while though. Thanks for the experiments and suggestions, nomdeplume. Could come in handy next time I build a mission :noexpression: I'll have to try deleting and re-creating the stop command if I get issues. Edited June 27, 2011 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.
Recommended Posts