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.

DarkBASIC Professional Discussion / [LUA] Get a variable from inside the program

Author
Message
jeffhuys
20
Years of Service
User Offline
Joined: 24th May 2006
Location: No cheesy line here.
Posted: 13th Mar 2010 15:36
Hi!

Is there a way (using Barnski's LUA plugin) to get a variable from inside the program?

Example:
DBPro.Call("DeleteObject", MapObject(i).ID)

That doesn't work.

Neither does
DBPro.Call("DeleteObject", "MapObject(i).ID")

Any ideas?

Thanks!

Jeff

You're the 'th to view this signature!
Brendy boy
21
Years of Service
User Offline
Joined: 17th Jul 2005
Location: Croatia
Posted: 13th Mar 2010 20:38
you need to make function iside your program that returns values from MapObject.id
Something like this:

function Return_MapObjectID(index)
r=MapObject(index).ID
return r

that function you also need to register with lua and then you write a lua script like this:
DBPro.Call("DeleteObject", DBPro.Call("Return_MapObjectID",i))

God is real unless declared integer.

Login to post a reply

Server time is: 2026-07-26 23:40:13
Your offset time is: 2026-07-26 23:40:13