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 noobie with two questions: 1) DB UDT and LUA? 2) World Editors and Scripting?

Author
Message
pdq
18
Years of Service
User Offline
Joined: 20th Jul 2006
Location:
Posted: 22nd Aug 2007 20:52
1) Let's say I have the following DB code:



Now let's say I have the following LUA script called "Player.lua"



My question is the following:

Is there a function or one line command that I can use that will set the 3 variables of the new Player to the values stored in the lua script without having to iterate thru each variable; in otherwords, in one command line or a function call:
Player = "Player.lua"


2) My second question is how have you integrated a world editor with scripting? For example, do you import an object's initial position values from a script or from a world editor?

THX
entomophobiac
22
Years of Service
User Offline
Joined: 1st Nov 2002
Location: United States
Posted: 24th Aug 2007 11:20
You would have to write your own functions, probably.

What I've done, using DarkSCRIPT (Game Monkey) is create a messaging system that refers to the functions in my game.

For example, I have an objLoad() function with a few different parameters(an ID parameter to identify the object for other messages and functions and an OBJECT parameter to tell the function what object to load). What I write in the script is basically a table containing all the functions I need to cull, within a separate script function, that can then be called by a function in turn.

I.e., a table might look like this:


test = table(
"objLoad;idChar;character.x;",
"objLoad;idEnemy1;enemy.x;",
"objLoad;idEnemy2;enemy2.x;"
)


The message handler within the game system will then use this table, when you call it, which can also be done by script.

The theory works well, but I've recently realized that I'll probably have to rework the entire system, because most of it was done ad hoc for a specific project. This means that the code is a mess... And that the messages used are also a mess.
pdq
18
Years of Service
User Offline
Joined: 20th Jul 2006
Location:
Posted: 26th Aug 2007 20:35
Thanks entomorphobiac for responding.

I think I just have to play with the scripting.

Let me know how you make out with your new system.

Login to post a reply

Server time is: 2024-11-22 22:43:02
Your offset time is: 2024-11-22 22:43:02