Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DLL Talk / Lua help needed please.

Author
Message
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 27th Jun 2007 01:26 Edited at: 27th Jun 2007 01:28
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.)

And


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)
GatorHex
19
Years of Service
User Offline
Joined: 5th Apr 2005
Location: Gunchester, UK
Posted: 27th Jun 2007 22:47 Edited at: 27th Jun 2007 23:03
Which LUA are you using?

The official Unity lua is restriced in the commands it can use and I don't recognise any of them. Was restricted due to legal reasons stopping people cloning DBP with it's own commands!

The commands availalble are listed in the help file which you should be able to find in "Crogram FilesThe Game CreatorsDark Basic ProfessionalHelpUnityunity Manual.pdf"

Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 27th Jun 2007 23:16
I'm only using commands which came with the DBPro version. Didn't know there was other versions used by dbpro

3700+ Athlon 64 - Geforce 7600 Gs - 512MbDDR RAM - 40Gb + 250Gb Hdd - Windows XP (SP2)
GatorHex
19
Years of Service
User Offline
Joined: 5th Apr 2005
Location: Gunchester, UK
Posted: 27th Jun 2007 23:39 Edited at: 27th Jun 2007 23:43
If you are using the Barnski free lua you will need read his thread / ask Barnski.

If you're using the official Unity LUA version then what I said above is true the DBP commands are very limited to stop you making your own version of DBP. Most commands seem to be to do with moving objects I can't see any sound commands unless they released a new version i don't know about

Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 27th Jun 2007 23:51
I am using the purchased version. But regardless of the version i'm using, lua execute() should work regardless. I've read the manuals. the commands do not work as they say they will and I don't know how to make them work correctly!

i'm now quite desporate as I have a job interview with a big company tomorrow morning and I NEED these commands working! I feel so helpless! Ha ha, oh well!

I hope you can help!

3700+ Athlon 64 - Geforce 7600 Gs - 512MbDDR RAM - 40Gb + 250Gb Hdd - Windows XP (SP2)
GatorHex
19
Years of Service
User Offline
Joined: 5th Apr 2005
Location: Gunchester, UK
Posted: 28th Jun 2007 00:57
Sorry never felt the need to use it I just use push and lua return.

if input$ = "/pay 500gp" then lua push int 500
lua call
GoldLeft = lua return int()
endif

I might have to read up on the execute command and see what it's all about but I think i prefered push and return for some reason but I forget it

Eevil Weevil
17
Years of Service
User Offline
Joined: 1st Aug 2007
Location: Wherever you are, I wil follow
Posted: 14th Oct 2007 15:44
Quote: "The first script gives the error: [string "exit"]:1: `=' expected near `<eof>'"

Ooh a computer's telling you to e off

Your signature has been erased by a forum-hacke - I mean, a mod.

Cave Man
18
Years of Service
User Offline
Joined: 22nd Aug 2006
Location: North Carolina, US
Posted: 25th Oct 2007 22:37 Edited at: 25th Oct 2007 22:38
Quote: "function Lua_Load_Audio(MusicID, Filename, MaxVolume)

attempt to call global `lua_load_audio'
"


Big bump
But just in case you still need help; It looks like your calling it without capital letters.

Lua is case sensitive. Just try using "Lua_Load_Audio" instead.

Login to post a reply

Server time is: 2024-11-22 22:03:04
Your offset time is: 2024-11-22 22:03:04