Attempting to replicate user_script.lvl support
Posted: Thu Mar 10, 2016 4:04 am
Zerted informed me that the script game_interface.lua inside of ingame.lvl is what detects and runs user_script.lvl files, if they are detected. Since he is not so active I must bring this to open forum and see about getting help elsewhere.
I have tried two things in my game_interface.lua but none are working.
The first attempt is to see if the game can find user_script_1.lvl and attempt to run it. It did not work.
The second code I tried is just directly reading the file, also did not work.
My contents of user_script_1.lvl are
So if everything were to be working, the game should skip to victory as soon as player spawns, but it's not happening. Thanks for any help!
I have tried two things in my game_interface.lua but none are working.
The first attempt is to see if the game can find user_script_1.lvl and attempt to run it. It did not work.
Code: Select all
if ScriptCB_IsFileExist("user_script_1.lvl") then
ReadDataFile("user_script_1.lvl")
endCode: Select all
ReadDataFile("user_script_1.lvl")Code: Select all
OnCharacterSpawn(
function(character)
if IsCharacterHuman(character) then
MissionVictory(1,2)
end
end
)