Jump to content

Recommended Posts

Posted

Hello,

I'm now playing for some Months DCS, but i have no clue what flags should be. The only thing i could imagine is, it works like battlefield 3 that you have an area, and you can capture a flag. But in this case i have no clue how to place one and how to work with it. I already looked up in the Manual but i didnt found any explanation to it. Sorry for that beginners Questions. But What are flags, how can i use them, how do i place them?

 

Thanks

GottHold

Have a nice day!

Posted

A "flag" is a status, exactly an instance of a status. A flag can basically have the value "true" or "false".

You can use it in the Mission editor to let special things happen based on other actions.

 

For example:

If the player aircraft has left a special zone you set flag number 1 from false to true.

An other trigger is set, so that a special AI group has to be activates, as soon as flag with number 1 is set to true.

"Sieh nur, wie majestätisch du durch die Luft segelst. Wie ein Adler. Ein fetter Adler."

http://www.space-view.net

Posted

So, how what is then Ment by "Flag is more then"? And what are the number of the flags about is it just sth like an ID of a flag? thanks for your short explanation!

Have a nice day!

Posted

You can assign a value to a flag.

 

For example. A group of tanks enter zone. Flag 1 is now true.

For every tank destroyed, 1 is added to flag 1.

When 5 tanks are destroyed, flag 1 =5

You can then make a trigger that says when flag 1=5, (or flag is more than 4) message appear that tanks request help.

[sIGPIC][/sIGPIC]

Posted

Flags use two types of values. One is a "boolean" which is true or false, while the other is a number value, generally 0 to 100000. However both types can be evaluated by all of the triggers.

 

For instance a flag that is "true" can be either:

A. Flag value = true

B. Flag value > 0 (1 or more)

 

A flag that is false will be:

A. Flag value = false

B. Flag value = 0

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

The flag number is needed to select it when you create a new trigger to set "what will happen when my flag reaches this value"...

Question : What will happen if I've set the same number for a flag but the trigger and/or conditions is different?

 

About the "flag is more than", you set it as a limit, for example :

 

Trigger 1

Conditions : UNIT dead (select blabla)

Actions : Flag increase (flag 1; value 1)

So, now when your unit is killed the flag has 1 point in the pocket :) and you can clone the condition for that flag 1 if you want, here 3 times...

 

Trigger 2 :

Conditions : Flag is more (FLAG 1; Value 3 e.g)

Actions : Sound to all ( file : muhahayou'redone.ogg) :lol:

So here, if you kill 5 units or more, the sound file will play :noexpression:...

 

Is it clear?

 

Edit : I'm late, seems you got it. Hope this clarify even more?

Strike Posture Set CAS Center of Excellence

Intel Core i5 4690k @4,6Ghz, Gigabyte GTX 970 OC, Gigabyte Z97-X, 16GB G Skill Sniper @2400, Samsung 860/850 EVO , Win 10 64 bits, Dual monitors 27"@144"Opentrack + TM Warthog + Saitek pro flight combat 

 

Posted

Hey got another questions to flags!

 

If my flag 50 with Value 50:

 

get affected by the action: "Flag decrease value:1" will the new Value be 49 or 1?

Have a nice day!

Posted

Okay Many thanks for your patience. But i still got some questions. Is it possible to read out a value of a flag and put it into a message without making 100 hundred Triggers with flag equals?

 

Maaaany thanks :)

Have a nice day!

Posted

trigger.action.outText(trigger.misc.getUserFlag(1) )

 

That will simply print the value of flag 1 to all.

Playing: DCS World

Intel i7-13700KF, 64GB DDR5 @5600MHz, RTX 4080 ZOTAC Trinity, WIN 11 64Bit Prof.

Squadron "Serious Uglies" / Discord-Server: https://discord.gg/2WccwBh

Ghost0815

Posted (edited)

So i have a flagbase system build with triggers like in Battlefield. is it possible to

 

 

trigger.action.outText("US Army: " + trigger.misc.getUserFlag(1) + " Russian Army: " + trigger.misc.getUserFlag(2))

 

??

Edited by GottHold

Have a nice day!

Posted (edited)

I tested is as a trigger in action with "do script" and i got that Error: "[string "trigger.action.outText("US ARMY: " +trigge..."]1: attempt to perform arithmetic on a string value

 

 

EDIT: i just tried to do the first command that were given to me stand alone with the do script function but another Error appeared :

 

"[string "trigger.action.outText(trigger.misc.getUser..."]:1: Parameter #2 (delay) missed"

 

Please help

Edited by GottHold

Have a nice day!

Posted

Oh duh, I should have corrected your syntax error. Replace + with ..

 

Use:

trigger.action.outText('US Army: ' .. trigger.misc.getUserFlag(1) .. ' Russian Army: ' .. trigger.misc.getUserFlag(2))

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

Thanks for your fast answer. But it still but out ERRORs. This time:

 

[string "trigger.action.outText('Us Army: ' .. trigg..."]:1: Parameter #2 (delay) missed

 

whats wrong here

Have a nice day!

Posted

Its missing the time the message should display for. The full command is like this.

trigger.action.outText(string text, Time delay)

 

trigger.action.outText('US Army: ' .. trigger.misc.getUserFlag(1) .. ' Russian Army: ' .. trigger.misc.getUserFlag(2), 10)

 

The above message will display for 10 seconds. If you have it on a continuous trigger it will just keep overwriting the old message box.

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

Many thanks! One final question for you pro lua skills. I want to end the round latestly after 3 hours. then the 2 values of flags should be compared to each other if the first flag got higher value , a third flag will be true. If the flag is not higher the flag is false. Is that possible in lua. Grimes you saved my day! Thanks :)

Have a nice day!

Posted

Yeah, you can do it via triggers also using the "flag is less than flag" condition. In LUA it would be something like:

 

if trigger.misc.getUserFlag(1) > trigger.misc.getUserFlag(2) then

trigger.action.setUserFlag(3, true)

else

trigger.action.setUserFlag(3, false) -- its already false so this probably isn't needed

end

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

  • 4 months later...
Posted

Hi there

 

I want a certain action like a flare to be activated when a unit is in Zone, the unit then leaves the zone and when the unit returns to that zone I would like to have the flare activate again.

 

How would I do this using flags? thx

Midnite Signature.jpg

Posted
Hi there

 

I want a certain action like a flare to be activated when a unit is in Zone, the unit then leaves the zone and when the unit returns to that zone I would like to have the flare activate again.

 

How would I do this using flags? thx

 

Use "SWITCHED CONDITION" as the trigger type.

  • Recently Browsing   0 members

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