Jump to content

Recommended Posts

Posted

I know it's a noobish question, but went through the manual and the forums without being able to find a definite answer. I'm trying to set-up a simple mission in which one flag gets switched between true and false every a given, fixed time of elapsed seconds, when the player units stays inside a trigger zone. I get that the "Time More" and "Time Less" conditions count seconds in an "absolute" way,from mission start, and don't seem to be practical in this situation.

Any ideas?

 

Thanks in advance

[sIGPIC][/sIGPIC]

 

Intel i7 6700K @ 4.2, MSI M5 Z170A Gaming, NZXT X61 Kraken liquid cooler, PNY Nvidia GTX 1080 Founders Edition, 16GB Corsair Vengeance 3000 Mhz C15, samsung 840 evo SSD, CoolerMaster 1000W Gold rated PSU, NZXT Noctis 450 cabinet, Samsung S240SW 24' 1920x1200 LED panel, X-52 Pro Flight stick. W10 Pro x64 1809, NO antivirus EVER

Posted (edited)

Several regular events can accomplish this.

 

Flag 10 is the zone detection. Flag 11 is your True/False flag.

 

Switched Condition Event, Condition Unit In Zone, Action Flag On 10 & Flag On 11

 

Switched Condition Event, Condition Unit Out Of Zone & Flag Is True 10, Action Flag Off 10 & Flag Off 11

 

Switched Condition Event, Condition Time Since Flag (10, interval seconds) & Flag Is False 11, Action Flag On 10 & Flag On 11

 

Switched Condition Event, Condition Time Since Flag (10, seconds) & Flag Is True 11, Action Flag On 10 & Flag Off 11

 

^^^ I think this will work :-)

 

If you want to display your flag values do this in a Do Script action -- (MIST not required) --

local msg = {}

msg[#msg + 1]='Blue bridge points = '

msg[#msg + 1]=trigger.misc.getUserFlag('50007')

msg[#msg + 1]='. \n'

msg[#msg + 1]='Blue damage points = '

msg[#msg + 1]=trigger.misc.getUserFlag('50008')

msg[#msg + 1]='. \n'

msg[#msg + 1]='Blue score = '

msg[#msg + 1]=trigger.misc.getUserFlag('50000')

msg[#msg + 1]='. \n'

msg[#msg + 1]='\n'

msg[#msg + 1]='Red bridge points = '

msg[#msg + 1]=trigger.misc.getUserFlag('10007')

msg[#msg + 1]='. \n'

msg[#msg + 1]='Red damage points = '

msg[#msg + 1]=trigger.misc.getUserFlag('10008')

msg[#msg + 1]='. \n'

msg[#msg + 1]='Red score = '

msg[#msg + 1]=trigger.misc.getUserFlag('10000')

msg[#msg + 1]='. \n'

trigger.action.outText(table.concat(msg),6)

 

(I happen to be working on this ^^^ right now.)

 

 

Nothin' noobish about that!

 

WC

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.

Posted
Several regular events can accomplish this.

 

Flag 10 is the zone detection. Flag 11 is your True/False flag.

 

Switched Condition Event, Condition Unit In Zone, Action Flag On 10 & Flag On 11

 

Switched Condition Event, Condition Unit Out Of Zone & Flag Is True 10, Action Flag Off 10 & Flag Off 11

 

Switched Condition Event, Condition Time Since Flag (10, interval seconds) & Flag Is False 11, Action Flag On 10 & Flag On 11

 

Switched Condition Event, Condition Time Since Flag (10, seconds) & Flag Is True 11, Action Flag On 10 & Flag Off 11

 

^^^ I think this will work :-)

 

WC

 

Thanks for the reply, the above works! I just have to adapt the times a little it to fit the scenario being considered.

 

ENO, the idea for the mission is the following. It's night and an Abrams tank has had an accident or a breakdown. Its crew fear that the tank may fall into insurgents hands or something and for some reason its not possible to destroy it with an airstrike and all. So the local commander decides to dispatch a couple of technicians with spare parts aboard a Chicken to assist and repair the unit, maybe also to fend off some insurgent patrol approaching the area. The player, that pilots the Huey, only knows the general location of the tank.

 

So basically i wanted the infantry near the tank (its crew) to start popping flares to guide the heli only when the Huey is at a certain distance from them. No problem with that, but the way I did it, the crew shoots flares in endless bursts, as long as the Huey is in the trigger area. Being that unrealistic, and dangerous, I was looking for a way to pop one flare every 10 seconds or more. I had figured that the "time since flag" condition could be useful, but couldnt get around the fact that it checks only since the flag is set to true.

[sIGPIC][/sIGPIC]

 

Intel i7 6700K @ 4.2, MSI M5 Z170A Gaming, NZXT X61 Kraken liquid cooler, PNY Nvidia GTX 1080 Founders Edition, 16GB Corsair Vengeance 3000 Mhz C15, samsung 840 evo SSD, CoolerMaster 1000W Gold rated PSU, NZXT Noctis 450 cabinet, Samsung S240SW 24' 1920x1200 LED panel, X-52 Pro Flight stick. W10 Pro x64 1809, NO antivirus EVER

Posted

Sounds like a very nice mission. It reminds me of the German campaign in Heroes (of WW2) when the Tiger was heavily wounded and the troops had to abandon it and come back to it after that. Very nice.

[sIGPIC]OK[/sIGPIC]

Posted

Yes I read a similar story from the 91 gulf war involving an Abrams that was immobilized and had to fend off Iraqis until help arrived. Can't remember the backdrop but its a good story.

 

I'll have to look into the me and look at the flare setup again. Thought it was easier to just release one flare.

"ENO"

Type in anger and you will make the greatest post you will ever regret.

 

"Sweetest's" Military Aviation Art

  • 2 weeks later...
Posted

I want to do something similar to the OP, but the difference is that I want two flags to alternate True/False at a desired interval.

 

Say I have Flags 30 and 31... at 'x' seconds I want to toggle the states of these two flags between True and False so that when 30 is True then 31 is False and vis-a-versa. I started writing regular events to accomplish this but it was messy.

 

Looking for input.

 

TIA!

 

---

 

I need this to control artillery Fire At Point actions. If Flag 30 is True then I want to fire at point 1, versus if Flag 31 is True I want the arty to fire at point 2. I thought about using a single flag and setting it from 1 to 2 to 1 to 2, etc., and checking its value; this would be a better approach in the case where the arty groups had three or more Fire At Point targets, and the single flag would step through 1-2-3-n.

 

WC

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

I need this to control artillery Fire At Point actions. If Flag 30 is True then I want to fire at point 1, versus if Flag 31 is True I want the arty to fire at point 2. I thought about using a single flag and setting it from 1 to 2 to 1 to 2, etc., and checking its value; this would be a better approach in the case where the arty groups had three or more Fire At Point targets, and the single flag would step through 1-2-3-n.

 

No need to start a new thread...

 

Fire at point would need to be a triggered action, not a waypoint action. For each fire at point set a duration.

 

Once> Time More> Flag 1 On

Switched Condition> Time Since Flag 1 is 15 minutes> Flag 1 Increase 1

Switched Condition> Flag 1 Equals 1> Push AI task (Fire at point A)

Switched Condition> Flag 1 Equals 2> Push AI task (Fire at point B)

Switched Condition> Flag 1 Equals 3> Push AI task (Fire at point C), Flag Set Random Value (1, 1, 1) -- Resets it back to 1 to loop back

The right man in the wrong place makes all the difference in the world.

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

Posted

Hey,,, thanks, Grimes,

I did open a new thread, because it will help me to understand a For Loop and a function exit.

 

The Flag in focus needs to cycle around, so it could be a 1, 2, 3, n at anytime in the mission, but not stay at n after reaching it. I want to use this flag to control many groups.

 

http://forums.eagle.ru/showthread.php?t=117784

 

WC

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

Eno corrupted my mind when he said something like 'hundreds of events can be replaced by a few lines of script'.

 

 

...it's ^^^ around here , somewhere.

 

 

WC

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.

  • Recently Browsing   0 members

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