Jump to content

Recommended Posts

Posted

I confess to being a complete coding ignoramous, and yet people generally find me teachable.

 

When group X reaches WP1, I want to set user flag 90 to true. Then I can set trigger actions based on the flag. Should be easy, peasy. Simple...

 

and yet can not find any simple layman's explanation or "how to" for such a basic task. I have read for hours the sticky tutorial and the Wiki on lua scripting. I have read about classes and variables and "do scripts" ad nauseum, all of which seem way beyond, in coding terms, what I am trying to achieve.

 

At the group's Advance WP Actions window, I have selected the Perform Command \ Run Script and entered:

 

setUserFlag(90, true)

also tried

trigger.action.setUserFlag(90, true)

also tried

setUserFlag(90, 0)

 

None of these seemed to set flag 90 to true. Can anyone advise me here?

 

While we are on the subject, where can one find the complete reference of the special DCSW lua functions and correct syntax, such as setUserFlag?

Posted

Yes, I am proficient using most of the trigger functions like group in zone, etc.; but one of my goals here is to expand my knowledge of the ME and try to learn some basic scripting stuff. I am, therefore, still interested in leaning how to accomplish my goal using the advance waypoint scripting.

Posted

Here is an example that should work:

 

trigger.action.setUserFlag('1', 0)

sets flag 1 to off!

 

So try your flag in single quotes. True or 1 should work to set the flag on. First value is a string so needs to be in quotes.

 

function trigger.action.setUserFlag(string userFlagName, boolean or number userFlagValue)

F-15C-User-Bar-ACM.v2.jpg

MapleFlagMissions - Read Our Blog for Updates

Posted

Sabre is right. Use the best tool for what do you try to achieve. If you want to become more proficient in scripting maybe you should think of some other types of missions/events.

[sIGPIC]OK[/sIGPIC]

  • Recently Browsing   0 members

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