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 tables are cool!

Author
Message
dononeton
19
Years of Service
User Offline
Joined: 12th Jun 2004
Location: Tusaloosa, AL : USA
Posted: 1st Apr 2007 21:04 Edited at: 1st Apr 2007 21:04
lua


DBPro



I know that is very simple. But imagine you go into a shop and select a weapon. You can get the name,cost,power, and if it uses mana.Test it and just edit the script file for changes. Lua tables are cool

AMD Athlon 64 x2 Dual Core Processor 3800+,MMX 3DNOW (2CPUs)
1024 MB RAM
GeForce 7300 GT 512 MB
Jack
19
Years of Service
User Offline
Joined: 4th Oct 2004
Location: [Germany]
Posted: 3rd Apr 2007 23:25 Edited at: 3rd Apr 2007 23:26
DBPro


DBPro

...

[/center]
The Nerd
19
Years of Service
User Offline
Joined: 5th Jun 2004
Location: Denmark
Posted: 4th Apr 2007 00:41 Edited at: 4th Apr 2007 00:46
@Jack:

What's your point?

Milkman
18
Years of Service
User Offline
Joined: 30th Nov 2005
Location: United States
Posted: 4th Apr 2007 01:29 Edited at: 4th Apr 2007 01:30
I think his point was that dbp can do the same thing natively (although to really get the same effect you'd have to load the values from a file obviously).

Who needs a signature?
The Nerd
19
Years of Service
User Offline
Joined: 5th Jun 2004
Location: Denmark
Posted: 4th Apr 2007 01:40 Edited at: 4th Apr 2007 01:56
Quote: "I think his point was that dbp can do the same thing natively (although to really get the same effect you'd have to load the values from a file obviously)."


Yes, but I had to question it because he's example (DBpro - DBpro) has nothing to do with scripting. The LUA example is much more effective. Even if it does require you to go through all the hard work of creating and setting up an external file hehe. That's why I don't see the point. All it does is creating some hard-coded values in arrays.

But nevermind, was just wondering

Milkman
18
Years of Service
User Offline
Joined: 30th Nov 2005
Location: United States
Posted: 4th Apr 2007 02:34 Edited at: 4th Apr 2007 02:35
... his point still stands. And i did say, "(although to really get the same effect you'd have to load the values from a file obviously)", so then you wouldn't have hard coded values.

Who needs a signature?
Escaped Ape
17
Years of Service
User Offline
Joined: 25th Jul 2006
Location: Germany
Posted: 4th Apr 2007 02:51
yes they are cool. damn cool to say the truth
i have never seen such a flexible array-like system.
but hey, as we are at the topic lua:
dononeton - please test this snippet of calling a function in your dbp editor

and post the return results here
Since my bug-thread didn't helped me at all i'm trying to post "bug-advertisement" in this lol
Thanks!

GatorHex
19
Years of Service
User Offline
Joined: 5th Apr 2005
Location: Gunchester, UK
Posted: 5th Apr 2007 12:13 Edited at: 5th Apr 2007 12:25
Yes I've been telling ppl LUA is cool for ages

Try putting AI code in an external file with DBP

The realy cool thing about LUA, and why the games industry uses it, is that it allows the level designers to get on with tweaking monsters and objects without having to have the coder recompile the source code.

I wrote a little example back in this thread. The monster and player details can be changed in notepad, re-run the exe and it behaves differently. Look a little further down the thread and it gives you code to reprogram the monster so it only comes after you when it is in range of seeing you.
http://forum.thegamecreators.com/?m=forum_view&t=76205&b=1

Congratulations! You just recoded the AI without recompiling!

http://www.KumKie.com http://bulldog.servegame.com
Escaped Ape
17
Years of Service
User Offline
Joined: 25th Jul 2006
Location: Germany
Posted: 5th Apr 2007 13:59
nice example gatorhex
have you tried my codesnippet? actually i didn't got anyone to test it till this day.

Cash Curtis II
19
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Corpus Christi Texas
Posted: 5th Apr 2007 21:09
You can't have arrays inside of DBP UDTs, you can with LUA. I do some fancy stuff with LUA data structures that simply isn't possible with DBP.


Come see the WIP!
Milkman
18
Years of Service
User Offline
Joined: 30th Nov 2005
Location: United States
Posted: 6th Apr 2007 02:55
As far as i can see, a fancy scripting system such as lua is only really useful for ai and similar tasks in games, as gatorhex said. Allowing someone to tweak levels and objects can easily be done natively in dbp by creating a parsing system. I know you currently aren't able to have arrays withing arrays in dbp, but you soon will be able to with the release of oodbp.

Who needs a signature?
dononeton
19
Years of Service
User Offline
Joined: 12th Jun 2004
Location: Tusaloosa, AL : USA
Posted: 6th Apr 2007 05:20
@Escaped Ape

0
1.10000002384
1

Thats what I get. I know you could do the samething in native DBPro code. I thing Lua tables are easier to read and write. Anyway it would be a pain to hunt down that UDT in DBPro compile repeat to tweak the code. It wouldn't be so bad with a small code but with thousands of lines of code, that could hurt

AMD Athlon 64 x2 Dual Core Processor 3800+,MMX 3DNOW (2CPUs)
1024 MB RAM
GeForce 7300 GT 512 MB
Escaped Ape
17
Years of Service
User Offline
Joined: 25th Jul 2006
Location: Germany
Posted: 6th Apr 2007 15:34 Edited at: 6th Apr 2007 15:36
thank you dononeton, don't you have problems by getting those results?
Or don't you use the lua function commands?

@discussion:
I think lua is very usfull for programming adventures or roleplaying games.
You can easily script dialogs and handle items, whose attributes you can store in lua files as well.
You would only have to create a small level editor, in which you place items and set which scripts belong to them.
This way you can create new adventures without having to code anything in dbp (if your engine is powerfull).
I, for one would handle it this way (and will soon ).

dononeton
19
Years of Service
User Offline
Joined: 12th Jun 2004
Location: Tusaloosa, AL : USA
Posted: 7th Apr 2007 03:55 Edited at: 7th Apr 2007 03:59
well it compiles fine but I thought it would output

1
1.1
test

I could be wrong just bought unity this week

AMD Athlon 64 x2 Dual Core Processor 3800+,MMX 3DNOW (2CPUs)
1024 MB RAM
GeForce 7300 GT 512 MB
Escaped Ape
17
Years of Service
User Offline
Joined: 25th Jul 2006
Location: Germany
Posted: 7th Apr 2007 14:32 Edited at: 7th Apr 2007 14:33
That's exactly what i thought as well, I'm getting the same results and I'm not very happy with it
If you are interested in this topic, it's discussed i this thread http://forum.thegamecreators.com/?m=forum_view&t=103119&b=15
at the moment.

Login to post a reply

Server time is: 2024-05-20 18:19:42
Your offset time is: 2024-05-20 18:19:42