Jump to content

Recommended Posts

Posted

Can a unit have a waypoint set to true or given a value when passing a waypoint? It seems like something that would be possible, but I am not seeing a way to do it. 

Posted

Maybe you are approaching it slightly wrong, or mixing some tools.

Waypoints can't be set to true, but flags can. 

Flags can be set to true when certain conditions are met.

So, you probably can set up a trigger zone, and if the unit in question is inside that trigger zone, you can then as, action on that trigger, set a flag to true.

Does that work for you?

Posted

Hello,

Could be useful to have listed in the conditions of the trigger page something like 'unit reaches WP nr.' or 'unit passing WP nr.' to trigger some actions instead creating trigger zones at the WPs.

Settings would be the unit name, the WP and the radius around the WP.

Kind of "automated" trigger zone.

I guess it is what Paladin1cd is asking.

It would reduce the numbers of trigger zones that could be quite significant in some scenarii.

Posted

Here is a solution --

--- Stop Condition when a flag is true
-- use to stop an orbit..

if trigger.misc.getUserFlag(90115) == 1 then 
 return true
end

--- end of Stop Condition when a flag is true


--- set a flag at a waypoint

'Perform Command', Run Script

trigger.action.setUserFlag(71007, 1)

--- end of set a flag at a waypoint

One thing about setting a flag at a waypoint, if you forget where the code is, it will be tough to find it again!   

Visit the Hollo Pointe DCS World server -- an open server with a variety of COOP & H2H missions including Combined Arms. All released missions are available for free download, modification and public hosting, from my Wrecking Crew Projects site.

Posted (edited)
6 hours ago, Paladin1cd said:

What is the 71007, 1? is the first the value of flag 1?

It's old-school scripting, with trigger.misc.setUserFlag() (see great online doc here) being the Lua equivalent to setting a flag in ME. The first parameter designates the flag and today can be a string, not just a number; today it would be best practice to use something with at least a character to better differentiate flag name from value, e.g. 

tigger.misc.setUserFlag('someObscureFlag', 12)

 

 

Edited by cfrag
Posted

You can, at a waypoint, set a command to do a script and paste this as the script:

 

env.setErrorMessageBoxEnabled(false) -- Prevent error popup

trigger.action.setUserFlag(1, true)

To set flag 1 to true for example.

 

To fix the issue mentioned by Wrecking Crew about finding the flag later, you can use a trigger condition with a text field in your trigger list to make a note of where the flag is triggered.

I like to do this by using the message to unit trigger action. The message is set up to be sent to an AI and the text is a note detailing how the trigger is supposed to work.

  • Like 1
  • Thanks 1

Awaiting: DCS F-15C

Win 10 i5-9600KF 4.6 GHz 64 GB RAM RTX2080Ti 11GB -- Win 7 64 i5-6600K 3.6 GHz 32 GB RAM GTX970 4GB -- A-10C, F-5E, Su-27, F-15C, F-14B, F-16C missions in User Files

 

Posted (edited)
On 10/28/2023 at 4:07 PM, Exorcet said:

I like to do this by using the message to unit trigger action. The message is set up to be sent to an AI and the text is a note detailing how the trigger is supposed to work.

It would be a nice feature IMO if the Message Time could be set to Zero so that it would be like a Comment.  I'll add that to the Wish List

 

Edited by Wrecking Crew

Visit the Hollo Pointe DCS World server -- an open server with a variety of COOP & H2H missions including Combined Arms. All released missions are available for free download, modification and public hosting, from my Wrecking Crew Projects site.

  • 8 months later...
Posted
On 10/28/2023 at 5:07 PM, Exorcet said:

You can, at a waypoint, set a command to do a script and paste this as the script:

 

env.setErrorMessageBoxEnabled(false) -- Prevent error popup

trigger.action.setUserFlag(1, true)

To set flag 1 to true for example.

 

To fix the issue mentioned by Wrecking Crew about finding the flag later, you can use a trigger condition with a text field in your trigger list to make a note of where the flag is triggered.

I like to do this by using the message to unit trigger action. The message is set up to be sent to an AI and the text is a note detailing how the trigger is supposed to work.

Thanks for posting this, Exorcet.  Just the thing I was looking for today.  Most appreciated!

  • Like 1

System Specs:

Spoiler

📻Callsign:Kandy  💻Processor:13th Gen Intel(R) Core(TM) i9-13900K - 🧠RAM: 64GB - 🎥Video Card: NVIDIA RTX 4090 - 🥽 Display: Pimax 8kx VR Headset - 🕹️Accessories:  VKB Gunfighter III MCG Ultimate, VKB STECS Standard, Thrustmaster TPR Pedals, Simshaker JetPad, Predator HOTAS Mounts, 3D Printed Flight Button Box 

📹 Video Capture Software:  Open Broadcaster Software (OBS), 🎞️ Video Editing Software:  PowerDirector 365

Into The Jungle Apache Campaign - Griffins  Kiowa Campaign - Assassins  Thrustmaster TWCS Mod

 

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...