pbpullman Posted June 27, 2012 Posted June 27, 2012 What I want to do is have an enemy AAA platoon and a couple APC platoons to each relocate to a random location on the battlefield, say to one of 3 or 4 locations. They will relocate once any other enemy group has been hit by friendly fire, such as the enemy's command base or an infantry unit. Does anyone know how I would set up my triggers for this? I don't yet know how to write lua scripts, but I have a descent grasp on the main GUI features. I was thinking a basic way to do it would be creating separate trigger events for each group/unit on the battlefield, and once any unit was hit, it would set 3 or 4 flags to random value. Now I just need to know how to take those values and match them to corresponding destinations on the battlefield.
Erforce Posted June 29, 2012 Posted June 29, 2012 A bit harsh to read, but you can create triggers for this. LUA is not my cup of tea so good luck with that. small example (Quick and dirty btw): IF: group X alive less than 99% OR Unit "Command center" damaged OR whatever you want THEN : DEACTIVATE Group Y Flag set random value : 1 - 10 to 13 ---- If : Flag 1 equals 10 Then: Activate group 1 --- If : Flag 1 equals 11 Then : Acitvate group 2 ..... --- If: Group 1 alive less than 99% OR Group 2 alive less than 99% OR ... Then : AI TASK : OMG let's get outta here ! ahh coding, coding... easy coding, so many possibilities.. so many lines to write, so many FPS lost :) TASK / ROLES acronyms guide Black Shark A.I. datalink guide illustrated (v1.2.4 Available on Wiki) DCS World Codex 1.1 : full units list (Speed/Weapons/Armor thickness/Threat zone/Weapon damage...) (Oct 2013) BlackShark 2 1.2.x Bug and glitches thread (v1.2.7)
pbpullman Posted July 2, 2012 Author Posted July 2, 2012 Thanks, Erforce! I understand the logic in your script perfectly. This will work. But, it really makes a unit disappear and then reappear somewhere else. Maybe this is the limit of the mission editor, unless of course it can be done with lua. And that's an undertaking that I'm not up for at the moment.
Grimes Posted July 2, 2012 Posted July 2, 2012 Ground forces can't really have customized waypoints in terms of randomly going to A, B, C, or D. That said there are options to get the same sort of results. A: Use Advanced Waypoints and the "Hold" Command. Basically have all vehicles stopped at the start of the mission by using "hold' on their first waypoint. When you want them to move simply use 'group resume' and at each point where you want them to stop use the hold command with a probability to stop at the waypoint. Their paths aren't randomized, but where they stop would be. You could also randomly spawn in the groups with different directions. For example use triggers similar to Once> Flag 1 is False And Random 10% > Spawn Group A1, Set Flag 1 to True Once> Flag 1 is False And Random 10% > Spawn Group A2, Set Flag 1 to True A1 and A2 would be identical, and only one will spawn. However A1 could have WPs moving north while A2 would go south. B: You can also use "Stop and Form to Template" to randomly move vehicles around. Templates are based on the location of the first unit in a group. So you can make a templates where unit 2+ are south of the first unit, and another where they are located north of the first unit. If you switch between the two templates the 1st unit will stay stationary while the rest of the group moves to the relevant position. 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
Recommended Posts