I've been trying to get a console command system into my game which directly calls Lua commands by using the r = Lua Execute("") command. thing is, it wont work. I have two short scripts; (Shown Below.)
function Exit()
SendMessageS("Exit", "Exit")
end
And
function Lua_Load_Audio(MusicID, Filename, MaxVolume)
SendMessageS("CreateAudio:", MusicID)
SendMessageS("Filename:", Filename)
SendMessageI("MaxVolume:", MaxVolume)
SendMessage("End")
end
Called from within a lua script, they work. Not a problem. When called from lua execute(), they dont.
The first script gives the error: [string "exit"]:1: `=' expected near `<eof>'
The second script gives the error: [string "Lua_Load_Audio("Main", "Sunday Afternoon.mp.."]:1: attempt to call global `lua_load_audio' (A nil value)
Hope someone can help me, or tell me i'm doing it wrong!
Thanks in advance.
3700+ Athlon 64 - Geforce 7600 Gs - 512MbDDR RAM - 40Gb + 250Gb Hdd - Windows XP (SP2)