Habu_69 Posted March 31, 2014 Posted March 31, 2014 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?
Sabre-TLA Posted March 31, 2014 Posted March 31, 2014 (edited) I wouldn't use the Advance WP actions. Create a Zone at WP 1 and then use a normal trigger: UNIT IN ZONE to set flag 90. I always try for KISS (Keep It Simple Sally) first and then make it more complex if I need to. Link to Scripting Engine wiki. Edited March 31, 2014 by Sabre-TLA MapleFlagMissions - Read Our Blog for Updates
Habu_69 Posted March 31, 2014 Author Posted March 31, 2014 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.
Sabre-TLA Posted March 31, 2014 Posted March 31, 2014 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) MapleFlagMissions - Read Our Blog for Updates
Zayets Posted March 31, 2014 Posted March 31, 2014 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]
Habu_69 Posted March 31, 2014 Author Posted March 31, 2014 Success! Thanks for the help. Baby steps. Where is a reference that lists all the DCSW lua functions, syntax, and action description?
Sabre-TLA Posted March 31, 2014 Posted March 31, 2014 I started with this page. This page has lots of good info. This link is useful if you are using MIST. MapleFlagMissions - Read Our Blog for Updates
Habu_69 Posted March 31, 2014 Author Posted March 31, 2014 Thanks for info. I had browse the Eagle Wiki, but somehow failed to recognize the function lists.
Recommended Posts