Q1:
Note that this does not reset the entire lua state. It just runs main.lua again, but it's fine in most situations.
Q2: As the luaGuide says, main.lua will get executed at startup, nothing else. There you can set triggers and so on. It will also try to load all the constants and opcodes from msfiles/ so that you can use them directly.
Q3: Yes it's normal, you can put
in wse_settings.ini to get rid of it. It just means that wse doesn't fully understand some line - I haven't implemented full parsing
For calling lua scripts with an integer, the simplest way off the top of my head would be like so:
And just call call_index with an integer. But there are certainly prettier ways to do what you want.
Hope this helps, don't be shy to ask more questions
Code:
("wse_console_command_received", [ #this is a script that WSE adds
(store_script_param, ":command_type", 1),
(str_equals, s0, "@reloadMain"),
(lua_push_str, "@main.lua"),
(lua_call, "@dofile", 1), #one param, the string we pushed
(set_trigger_result, 1),
]),
Q2: As the luaGuide says, main.lua will get executed at startup, nothing else. There you can set triggers and so on. It will also try to load all the constants and opcodes from msfiles/ so that you can use them directly.
Q3: Yes it's normal, you can put
Code:
[lua]
disable_game_const_warnings = 1
For calling lua scripts with an integer, the simplest way off the top of my head would be like so:
Code:
funcTable = {
function(...) ... end, --remember this is [1] in lua
function(...) ... end,
...
}
function call_index(index, ...)
funcTable[index](...)
end
Hope this helps, don't be shy to ask more questions