Broken Dimension (OScoder's Worklog)
LUA.dll almost done
Hi,
Work with my dll that allows use of LUA scripts in dlls is going along quite nicely. I can now write a script that loads NPCs, writes stuff to the screen and gets a string from fenix. I just need to add a little functionality (like letting the fenix game call LUA functions), fix a bug (see below), and tidy up/document the code (almost no comments atm!). Also, here's a screenshot:
You can see the bug there: it ought to write "int test good", not what it does! Can anyone suggest where to start looking to fix?
Anyways, here's the script that did it:
OScoder out
Work with my dll that allows use of LUA scripts in dlls is going along quite nicely. I can now write a script that loads NPCs, writes stuff to the screen and gets a string from fenix. I just need to add a little functionality (like letting the fenix game call LUA functions), fix a bug (see below), and tidy up/document the code (almost no comments atm!). Also, here's a screenshot:
You can see the bug there: it ought to write "int test good", not what it does! Can anyone suggest where to start looking to fix?
Anyways, here's the script that did it:
Code:
-- script.lua
fenix_write(0,10, get_game_name())
if(get_some_int() == 23) then
fenix_write(0,20,"int test good")
end
if(get_some_number() == 1337) then
fenix_write(0,30,"number test good")
end
add_NPC(2,50,100)
add_NPC(2,100,100)
return 1337
-- TODO:
-- BUG - write function not working right
fenix_write(0,10, get_game_name())
if(get_some_int() == 23) then
fenix_write(0,20,"int test good")
end
if(get_some_number() == 1337) then
fenix_write(0,30,"number test good")
end
add_NPC(2,50,100)
add_NPC(2,100,100)
return 1337
-- TODO:
-- BUG - write function not working right
OScoder out
(Posted on November, 17th 2007, 14:31)