Pinefang Posted June 5, 2014 Posted June 5, 2014 Anyone want to take this on. Probably easy for someone with Mission editor knowledge. So I am flying the OPStarvation mission and I get the following Mission Script Error [string "trigger.SetUserFlag(3,True)"]:1:attempt to call field 'set UserFlag ' (a nil value) Stack Trace back: [c] : in function ' set UserFlag ' [string " trigger.set UserFlag (3, true)" ] :1: in main chunck It will clear for a few seconds and it happens again the only difference is that the script error reads the same except where the number 3 is it is replaced by number 4. If someone has the knowledge to correct this or tell me what I need to do I would appreciate it very much. Thanks in advance
Pinefang Posted June 5, 2014 Author Posted June 5, 2014 Thank you for the reply ajax but I don't know the first place to look to change this. Can you elaborate for someone that hasn't gotten that deep into the mechanics of it all yet.
ajax Posted June 5, 2014 Posted June 5, 2014 Basically, what I am saying is that there is an error in the script based on the error message. (Obviously, right? :)) Is it one you created yourself, one you downloaded, or one built into the mission? If you are comfortable doing so, you can edit the script yourself; but it would be better for the author make the change. The error message says 'trigger.SetUserFlag(3,True)'. If the script is written like that then you will get this error. The reason is that it should be 'trigger.action.setUserFlag('3',true)'. There is more than one problem with the script statement. (1) The Lua programming language is case sensitive so 'SetUserFlag' will not work -- it needs a lower case 's' in 'Set'. (2) This function requires that the flag number is sent as a string, that is as text not a number. So the 3 needs to be enclosed in quotes, like this: '3' . (Note that either single or double quotes will work.) (3) It looks like maybe a space was inserted between 'Set' and 'UserFlag', too. If so, it needs to be removed. I hope this helps.
etcher Posted June 5, 2014 Posted June 5, 2014 (edited) [edit]sniped by Ajax[/edit] If you'd like to dive into lua scripting for DCS, http://wiki.hoggit.us/view/Simulator_Scripting_Engine_Documentation is as good a place as any. http://wiki.hoggit.us/view/Part_1#trigger is a direct reference to the subject on hand. Have fun with the scripting :beer: Edited June 5, 2014 by etcher sniped by Ajax [sIGPIC][/sIGPIC]
Pinefang Posted June 5, 2014 Author Posted June 5, 2014 Thanks for all the info. No I did not make the mission I downloaded it off of the DCS website. I had a whole different idea as to how missions were built using the mission editor but you have shown me that it takes a lot more than just clicking on commands within the editor. I will see if I can contact the author and see if he is willing to fix it. Thanks again for you in depth knowledge.
Pinefang Posted June 5, 2014 Author Posted June 5, 2014 Well that's unfortunate the author Jus2410 is not listed in the DCS forum members list so I guess the mission stays broken. Too bad it seemed like a cool mission with 4 AI jets flying Cap and SEAD for you. But never got far enough to really find out how well it worked. It was built in an earlier version of DCS world with 1024 downloads but probably isn't compatable with 1.2.8. Thanks again
ajax Posted June 6, 2014 Posted June 6, 2014 (edited) I just downloaded the OP Starvation mission from the ED site. There are no scripts in that mission. I think maybe you are seeing a version mismatch problem. Unfortunately, with these older missions you sometimes have to rebuild them from scratch to get them to work in the newer versions of DCS World. Edited June 6, 2014 by ajax 1
Pinefang Posted June 6, 2014 Author Posted June 6, 2014 Thank you for taking a look as it is Greek to me. Rep coming your way
Pinefang Posted June 6, 2014 Author Posted June 6, 2014 I just hate when something bugs me. I figured that if the sim was stopping and showing me the mission script error that it must be commanded from somewhere within the Mission Editor and thanks to you for showing me how the script should have been written I was able to not only find the two instances of it but I also corrected as you described. Flew the mission with no stops or errors. Thank you again for your help. Wish I could give more Rep.
Recommended Posts