horus0129 Posted March 19, 2015 Share Posted March 19, 2015 Hi, I have a question about MIST getavgpos script. http://wiki.hoggit.us/view/GetAvgPos I've done the script exactly same with the example in this manual, but no joy. It always shows mission script error. Something is wrong with this manual? Could you let me know how to do that script properly? I'm using MISTv3.5. Thanks in advance. Link to comment Share on other sites More sharing options...
FSFIan Posted March 19, 2015 Share Posted March 19, 2015 Which error message are you getting? DCS-BIOS | How to export CMSP, RWR, etc. through MonitorSetup.lua Link to comment Share on other sites More sharing options...
horus0129 Posted March 19, 2015 Author Share Posted March 19, 2015 Ian;2354586']Which error message are you getting? It says [string "trigger.action.smoke(mist.getAvgPos(mist.makeUnitTable({'[g]myG..."]:1: ')' expected near '<eof>' I don't understand what this means... Link to comment Share on other sites More sharing options...
FSFIan Posted March 19, 2015 Share Posted March 19, 2015 Lua is telling you that it encountered an error in line 1. The error was ")" expected near <eof> which means Lua was expecting to see a closing parenthesis but reached the "end of file" without finding it. Count the parenthesis in the code example. Note that the number of open and close parens does not match. Add a close parens to the end, problem solved :) trigger.action.smoke[b]([/b]mist.getAvgPos(mist.makeUnitTable({'[g]myGroup'}), "Orange")[b][color="red"])[/color][/b] EDIT: relevant xkcd (see what you did to that poor parser? DCS-BIOS | How to export CMSP, RWR, etc. through MonitorSetup.lua Link to comment Share on other sites More sharing options...
horus0129 Posted March 19, 2015 Author Share Posted March 19, 2015 Ian;2354624']Lua is telling you that it encountered an error in line 1. The error was which means Lua was expecting to see a closing parenthesis but reached the "end of file" without finding it. Count the parenthesis in the code example. Note that the number of open and close parens does not match. Add a close parens to the end, problem solved :) trigger.action.smoke[b]([/b]mist.getAvgPos(mist.makeUnitTable({'[g]myGroup'}), "Orange")[b][color="red"])[/color][/b] EDIT: relevant xkcd (see what you did to that poor parser? Thanks Ian! Now I get it. For someone who suffers from the same thing : trigger.action.smoke(mist.getAvgPos(mist.makeUnitTable({'[g]myGroup'})), trigger.smokeColor.Green) this works. Link to comment Share on other sites More sharing options...
FSFIan Posted March 19, 2015 Share Posted March 19, 2015 You are right, the close parens needs to close the call to mist.getAvgPos instead of trigger.action.smoke. I need more caffeine. DCS-BIOS | How to export CMSP, RWR, etc. through MonitorSetup.lua Link to comment Share on other sites More sharing options...
Recommended Posts