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.

Program Announcements / Unity - The Lua Scripting Pack

Author
Message
The Nerd
20
Years of Service
User Offline
Joined: 5th Jun 2004
Location: Denmark
Posted: 8th Jan 2006 21:59 Edited at: 8th Jan 2006 22:00
Hey David! I'm sitting planning the engine and just stumpled over a thing. I want the whole engine to be controlled through scripts, that will be readed by a pre-compiled exe file. You can say that these scripts decide how the game should look

Now lets say that the user would need to make a Unity script that would decide what the player model should be etc... You could write a Unity script that looked something in this direction:


Then in DarkBasic Pro you would read the script and use the data something like this:


Wouldn't that idea work? Because this idea would be used to many of the things in the engine then.

-The Nerd

Free Particle Engine for DarkBasic Pro:
http://forum.thegamecreators.com/?m=forum_view&t=60141&b=5
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 8th Jan 2006 22:05
Exactly

Darkbasic MADPSP
19
Years of Service
User Offline
Joined: 15th Jun 2005
Location: Uk
Posted: 8th Jan 2006 22:30
The Nerd Unity is great i need to learn c++ to give this so competition

http://www.users.zetnet.co.uk/csimon/spain03/days2_3.htm << where i went for my holiday or www.portaventura.es
The Nerd
20
Years of Service
User Offline
Joined: 5th Jun 2004
Location: Denmark
Posted: 9th Jan 2006 15:14
Quote: "The Nerd Unity is great i need to learn c++ to give this so competition "


lol! I've been into c++ for some while now.... If you make a script system for dbpro in the near future..... You're good!

Free Particle Engine for DarkBasic Pro:
http://forum.thegamecreators.com/?m=forum_view&t=60141&b=5
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 9th Jan 2006 17:42
Just replied to your email Nerd.

The Nerd
20
Years of Service
User Offline
Joined: 5th Jun 2004
Location: Denmark
Posted: 9th Jan 2006 18:12
Quote: " Just replied to your email Nerd."


Got it and replied back...

Thanks for the help yet again

-The Nerd

Free Particle Engine for DarkBasic Pro:
http://forum.thegamecreators.com/?m=forum_view&t=60141&b=5
Darkbasic MADPSP
19
Years of Service
User Offline
Joined: 15th Jun 2005
Location: Uk
Posted: 9th Jan 2006 18:19 Edited at: 9th Jan 2006 18:19
Quote: "lol! I've been into c++ for some while now.... If you make a script system for dbpro in the near future..... You're good! "


What if i make one in delphi lol anyway back on topic David i'm still looking for the warehouse thing

http://www.users.zetnet.co.uk/csimon/spain03/days2_3.htm << where i went for my holiday or www.portaventura.es
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 9th Jan 2006 22:01 Edited at: 9th Jan 2006 22:02
Just before people start scratching their heads and gnashing their teeth, there's a couple of script exanmples up above along the lines of:

if x = 1
do something
endif


This should read:

if x == 1
do something
endif


In Lua, the comparator is "==", not "=".
To set the value, you use "=".

David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 9th Jan 2006 23:47 Edited at: 9th Jan 2006 23:49
Aah, yes sorry for that. I've written a lot of code this topic away from the dev PC. Thanks for pointing that out Steve

[edit] Just had a read through the page - those examples were actually DBPro code and so were valid, but thanks for posting anyway, I had forgotten that .

BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 11th Jan 2006 09:52
David: It was The Nerds example (7th Jan 2006 15:14) that was using the wrong syntax. I couldn't possibly fault your code, could I!

French gui
20
Years of Service
User Offline
Joined: 11th May 2004
Location: France
Posted: 11th Jan 2006 14:01 Edited at: 11th Jan 2006 14:04
Ok, I've purchased it, it's cool! Congrats David! I'm just so noob that I spend an hour trying to get a sendmessage("hello world") command working. I've forgotten that lua is case sensitive, so SendMessage("hello world") works better...

[edit] Maybe there's a lua IDE somewhere, to avoid syntax error like mine?

David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 11th Jan 2006 17:46
Quote: "Maybe there's a lua IDE somewhere, to avoid syntax error like mine?"


I have one called Lua Edit.

Yeah, the case sensitivity is hard to remember sometimes - if you want you can just do

Quote: "sendmessage = SendMessage"


at the top of your code and in future you can use "sendmessage".

Nack
21
Years of Service
User Offline
Joined: 29th Jul 2003
Location:
Posted: 11th Jan 2006 18:03
@David T

Havent been on the forum for awhile, didnt realize this thing exist! LOL. I got a question about this...i dun feel like reading 5 pages of threads...^__^"

Is this script possible to do custom commands? I am thinking if this script can be used in DreamCreator. I mean, rite now, i am coding the scripts and its takin a long time, not to mention pain in the ass. If this script can do custom commands, then it be awesome lol.

Nack


I have NOT abandon these ^......^_^V hehe
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 11th Jan 2006 18:09
If by custom commands you mean people can write their own commands, then yes, just as you would with DBPro:



The Nerd
20
Years of Service
User Offline
Joined: 5th Jun 2004
Location: Denmark
Posted: 14th Jan 2006 23:38 Edited at: 14th Jan 2006 23:40
Quote: " If by custom commands you mean people can write their own commands, then yes, just as you would with DBPro"


I would guess he ment that he could make commands for the scripting system... Like if you wrote something like this in a Unity script:



You would be able to somehow read the script in DarkBasic Pro and then if the script contained the "objectSetting" command, it would go in and read the object number and size... Then after that eventually use that data to make and object in DarkBasic Pro like:



etc... That would be my guess of what he ment... Thought if that's not possible you could always make functions in Unity script to go with the software... So when the user should write a new script, he just copied the pre-written functions into hes script and then would be able to use those functions as commands etc...

But it was just a guess

-The Nerd

Free Particle Engine for DarkBasic Pro:
http://forum.thegamecreators.com/?m=forum_view&t=60141&b=5
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 15th Jan 2006 10:52
You can use the message queue if you want to pass lots of data back to DBPro:

Say you have this Lua function:



and, in DBPro each game loop:



While that gives a slight delay in the creation of the object, it shouldn't matter too much as its generally recommended to leave the 3d stuff to DBPro, and the logic to Lua.

If you want you could also do some nice multithreading meaning that as far as your script is concerned the object is created straight away. I've seen some fantastic scripts running with multithreading on Unity doing wonderful stuff. Can't say what though I'm afraid

And the next version of Unity will hopefully have dbpro function calling.

Darkbasic MADPSP
19
Years of Service
User Offline
Joined: 15th Jun 2005
Location: Uk
Posted: 15th Jan 2006 19:24
still using dbp any chance i can getb this to work with online code?

http://www.users.zetnet.co.uk/csimon/spain03/days2_3.htm << where i went for my holiday or www.portaventura.es
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 20th Jan 2006 19:21
Just received word that a very large order has been placed today, tripling the monthly total! Thanks very much to all customers!

Hopefully with this momentum, in the next few weeks work can begin on closer integration with DBPro.

Peter H
20
Years of Service
User Offline
Joined: 20th Feb 2004
Location: Witness Protection Program
Posted: 21st Jan 2006 00:37
Quote: "Just received word that a very large order has been placed today, tripling the monthly total!"



did somebody decide they needed 100 backup copies of an electronic product????

"We make the worst games in the universe..."
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 21st Jan 2006 01:45
Not quite

BiggAdd
Retired Moderator
20
Years of Service
User Offline
Joined: 6th Aug 2004
Location: != null
Posted: 21st Jan 2006 02:30
David. Bet you wished u bought the 60Gb ipod now. You could have afforded it.

David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 23rd Jan 2006 17:23
Haha. Nah, the 30gb one is fine

David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 3rd Feb 2006 19:42
Wow. Been ages. Sosorry if this is a bit like a bump, but got some more good news.

Case Western University, Ohio (http://www.case.edu) has chosen Unity to be used as a teaching product, and has equipped a computing lab with it along with making it a recommended purchase!

Soon I'll email some students and find out what it's being used for.

The Nerd
20
Years of Service
User Offline
Joined: 5th Jun 2004
Location: Denmark
Posted: 3rd Feb 2006 20:31 Edited at: 3rd Feb 2006 20:32
Glad to hear that it's going so well for you mate!
Looks like Unity got a bright future infront of it.

I haven't got Unity yet... But should get it very soon thought. Can't wait to start playing around with it!

-The Nerd

Free Particle Engine for DarkBasic Pro:
http://forum.thegamecreators.com/?m=forum_view&t=60141&b=5
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 12th Feb 2006 20:11 Edited at: 12th Feb 2006 20:12
Thanks Nerd! (sorry forgot about the topic)

An update on what's going on:

- it's probable that a new TPC will be 'Unity Compatible' meaning that when used on a copy of DBPro lots of new possibilities arise. Although that's a long way from completion

- I've started developing an extension for Unity.

The way I plan to work is have update for Unity split into two categories. Extensions add new features and are separate DLL files (I plane to release most for free) while actual updates to the internal Unity workings will still be released as updates. Next planned is Unity 1.1.

My extension adds a brilliant new feature to the plugin, will be useful to almost every serious developer and will more than likely be free.

Once I progress further I'll post updates...

jrowe
22
Years of Service
User Offline
Joined: 12th Oct 2002
Location: Here
Posted: 15th Feb 2006 12:57
Looking great . I'm considering buying. I'm just wonering what in the way of tutorials/examples we get with unity? Is there a list that I can look at?

Tinnedhead Productions

For Fathers and Sons who enjoy wholy spirits.
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 15th Feb 2006 17:27
I posted the set of manuals a while ago I think - try a search for "lua" on the DarkBASIC Pro board.

You get

- 30 page manual that talks about principles, examples, in depth explanation for each command plus example code.

- Getting Started with Unity guide, which is a series of tutorials culminating in you scripting some simple AI with Unity + Lua.

- 3 examples. A butterfly one where demonstrates a dynamic waypointing system, a warehouse one where security guards are scripted with Lua and a full mini RPG where you can walk around and the entitie's behaviours are scripted with Lua.

Hope it helps. Batvink has also written a tutorial on Unity too for one of the newsletters (Jan 06 I think).

The Nerd
20
Years of Service
User Offline
Joined: 5th Jun 2004
Location: Denmark
Posted: 21st Feb 2006 12:10 Edited at: 21st Feb 2006 12:12
Hi

I've tried to look for the Lua Compiler for some time now... But I just can't seem to find it I've searched google too... And looked trough this thread to eventually find the luac.exe. I though the lua compiler was included in LUA so I tried downloading it from loa.org.

Well... It seemed like the source code for it was there... So I tried to compile it using c++. But for some odd reason I get a fatal error when trying to compile. It says that it wasn't able to open one of the included header files. I could not find the header file, and I had no idea why it isn't able to open it... So I dind't got much further there. I was just wondering if anyone had the compiler or maybe know where to download it?

Thanks!

And by the way... David T, you've made an awsome plugin! I already love Unity And I will definately use it for my next project!

-The Nerd

Free Particle Engine for DarkBasic Pro:
http://forum.thegamecreators.com/?m=forum_view&t=60141&b=5
Torrey
20
Years of Service
User Offline
Joined: 20th Aug 2004
Location: New Jersey
Posted: 21st Feb 2006 12:27 Edited at: 21st Feb 2006 12:39
Here's Luac.exe from the 5.0.2 distro. The most recent Lua binaries can always be found here.

Attachments

Login to view attachments
The Nerd
20
Years of Service
User Offline
Joined: 5th Jun 2004
Location: Denmark
Posted: 21st Feb 2006 12:52
Thanks! It works perfect!

-The Nerd

Free Particle Engine for DarkBasic Pro:
http://forum.thegamecreators.com/?m=forum_view&t=60141&b=5
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 24th Feb 2006 19:47
Cool, there's also a thread in DLL talk where some people posted it up.

The Nerd
20
Years of Service
User Offline
Joined: 5th Jun 2004
Location: Denmark
Posted: 24th Feb 2006 19:52
Quote: " Cool, there's also a thread in DLL talk where some people posted it up."


Yeah... I discovered that a little time after I got the compiler from this thread

But thanks for telling!

-The Nerd

Free Particle Engine for DarkBasic Pro:
http://forum.thegamecreators.com/?m=forum_view&t=60141&b=5
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 2nd Mar 2006 17:49
Hi All

Just to let you know, today I got an email from CryTek - makers of Far Cry. Their lead level designer congratulating me on Unity!

Sorry no updates recently. I've been busy with work - although I have two snow days (today and tomorrow) - I might put aside part of tomorrow to work on Unity.

Chris Franklin
19
Years of Service
User Offline
Joined: 2nd Aug 2005
Location: UK
Posted: 2nd Mar 2006 18:39
Deadwords
19
Years of Service
User Offline
Joined: 2nd Feb 2005
Location: Canada
Posted: 2nd Mar 2006 19:35
Quote: "Just to let you know, today I got an email from CryTek - makers of Far Cry. Their lead level designer congratulating me on Unity!"

Wow an email from CryTek? This is something.

Nobody can hear you scream ... you're on a forum!
The Nerd
20
Years of Service
User Offline
Joined: 5th Jun 2004
Location: Denmark
Posted: 3rd Mar 2006 23:39 Edited at: 3rd Mar 2006 23:44
Unity Tutorial

Okay David... I got this small tutorial done... It will teach you how to make a text system... It's explained a lot better in the tutorial Hehe, The folder includes the source code, the scripts, and the tutorial.

You need to have some basic knowlegde of DarkBasic Pro to get through it easy. Because it's not the most friendly explained tutorial out there. It's a fairly simple system... But maybe it inspires you to ideas on how to use Unity!

-The Nerd

Free Particle Engine for DarkBasic Pro:
Here

Attachments

Login to view attachments
Philip
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 5th Mar 2006 14:41 Edited at: 5th Mar 2006 14:41
Quote: "Just to let you know, today I got an email from CryTek - makers of Far Cry. Their lead level designer congratulating me on Unity!"


The congratulations are well deserved. Its a very nice DLL indeed. One of the best ways I've ever spent £12 ... and you can quote me on that!

Its interesting that CryTrek would write about the DLL too - it means they must be using DBP or the SDK for something. Possibly prototyping? Did they say why? If they were, it'd be the sort of thing I guess Lee, Rick and RichD would be interested in as it'd be a great marketing advert for TGC.

Phil

Cheer if you like bears! Cheer if you like jam sandwiches!
Quote of the week: "... I started learning DBP while I was a Satellite Network Controller for the US Army Space Command ... "
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 5th Mar 2006 17:59
Quote: "The congratulations are well deserved. Its a very nice DLL indeed. One of the best ways I've ever spent £12 ... and you can quote me on that!"


Thanks alot! Hopefully over the next few months more interestings ways of using it will be popping up.

I don't think it's corporate, more personal, he's learning programming and said it was nice to see Lua - a familiar face - integrated into DBPro. Just goes to show what a professional pedigree Lua has!

(btw, thanks for the quote, I'm going to ask the CryTek guy if I can quote him too, Rich D said it'll make a nice addtion to the TGC site!)

Segan
19
Years of Service
User Offline
Joined: 28th Aug 2005
Location: Canada
Posted: 8th Mar 2006 20:02 Edited at: 8th Mar 2006 20:03
Wow, looks like this thread is heating up. I'm definately putting on mailback.
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 10th Mar 2006 23:28
Thanks - let me be the first to test it

Segan
19
Years of Service
User Offline
Joined: 28th Aug 2005
Location: Canada
Posted: 11th Mar 2006 02:39
It works!
The Nerd
20
Years of Service
User Offline
Joined: 5th Jun 2004
Location: Denmark
Posted: 16th Mar 2006 19:34
I got a small question that I couldn't seem to find the answer to in the manuals.

In my project, I would like to be able to change a variable from a LUA script within DarkBasic Pro. Like... Say a script called "Cheese.lua" contains this:


Right... Now in a DarkBasic Program, a user changes that amount to lets say "7". Now when the user have decided the amount, is there any possibility to send that change back to our LUA script "Cheese" and then change the variable? So when we open the script again there will stand:


Thanks,

The Nerd

David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 16th Mar 2006 19:51
Do you

a) want to change the value of the variable "cheesecount" in memory

or

b) want to change it permanently, so every time you load it up in future it will be 1 instead of 7

If a), then use the command LUA SET INT "cheeseCount",number.

If b), use the file writing commands to echo out a new script file with the new value in.

Hope it helps.

The Nerd
20
Years of Service
User Offline
Joined: 5th Jun 2004
Location: Denmark
Posted: 16th Mar 2006 19:54
Thanks for the help! I can move on now. So it helped

Thanks yet again.

Regards,

-The Nerd

The Nerd
20
Years of Service
User Offline
Joined: 5th Jun 2004
Location: Denmark
Posted: 18th Mar 2006 23:36
Right... I've searched this thread and the manuals that comes with Unity, and then I tried searching on google, but I didn't really find what I was looking for. I was just wondering if there exist any good Lua IDE's out there? Would be a bit nicer to write your lua scripts if you had some kind of lua IDE With syntax highlight and stuff like that.

Thanks,

-The Nerd

Barnski
18
Years of Service
User Offline
Joined: 26th Jan 2006
Location: Switzerland, Zurich
Posted: 19th Mar 2006 00:13 Edited at: 19th Mar 2006 00:14
You can use Scintilla (SciTE) to edit your lua script files.
http://gisdeveloper.tripod.com/scite.html

The Nerd
20
Years of Service
User Offline
Joined: 5th Jun 2004
Location: Denmark
Posted: 19th Mar 2006 01:12
Thanks for the help Barnski

-The Nerd

David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 19th Mar 2006 19:37
I use Lua Edit... I found it by typing "lua ide" into google

The Nerd
20
Years of Service
User Offline
Joined: 5th Jun 2004
Location: Denmark
Posted: 19th Mar 2006 19:42 Edited at: 19th Mar 2006 19:48
Quote: "I use Lua Edit... I found it by typing "lua ide" into google"


That was the same searchname that I used Strange...

Well I like LuaEdit alot better... So I'm gonna stick with it Thanks.

-The Nerd

David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 19th Mar 2006 21:04
It has a pretty nifty debugger...

Login to post a reply

Server time is: 2024-11-23 04:27:12
Your offset time is: 2024-11-23 04:27:12