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: 20th Mar 2006 13:54
Quote: "It has a pretty nifty debugger..."


Yeah, just ran some tests with it... Seems nice! Ummm... I actually got another question for you David... If I make a project which uses the Unity system(LUA scripts), am I able to sell that project? I admit that I haven't read the Lua license

Thanks,

The Nerd

David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 21st Mar 2006 17:41
Yep sure.

Philip
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 21st Mar 2006 18:47
What I don't really understand is why Barnski is writing another LUA pluging. Its obviously up to anyone what they want to do with their time, but I've always been against trying to reinvent the wheel. Oh well.

Cheer if you like bears! Cheer if you like jam sandwiches!
Quote of the week: "I highly recommend Philip's Vector Tutorials" (RiiDii)
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 21st Mar 2006 19:03
I don't quite understand either, but I'm not that bothered. You can of course do whatever you want, but rewriting something that's already available did strike me as odd at first.

I'm not too bothered - a sizeable chunk of sales come from universities and external (ie non forum) customers.

Found any uses yet Phil? I'm emailing you about something.

Barnski
18
Years of Service
User Offline
Joined: 26th Jan 2006
Location: Switzerland, Zurich
Posted: 21st Mar 2006 19:50 Edited at: 21st Mar 2006 19:53
I did this mainly for myself, firstly to learn about LUA (what I already wanted for a year) and secondly to make it suit my needs (e.g. using dbpro commands from within my scripts). I am also making a C++ library (actually it already is).

I made it available for free because I wanted to share my work with the community.

The Nerd
20
Years of Service
User Offline
Joined: 5th Jun 2004
Location: Denmark
Posted: 25th Mar 2006 23:55 Edited at: 25th Mar 2006 23:57
SpaceBattle Shootout is finally done!

It's the first finished DarkBasic Pro game that uses Unity in it. I use LUA for the training level. So you can mod something like the instruction text that appears on the screen... Or changing the media for it!

Also it is used for a script that controls the players turn speed. And in the next update, it will be used for a script that will control different game settings etc...

Thanks to DavidT for creating Unity! It's awsome!

-The Nerd

Chenak
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 18th Apr 2006 20:31
Hrmm any chance of some new features? I think the ability to compile/encrypt LUA files from within dbpro would be a nice feature, if it is possible to do.
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 20th Apr 2006 14:43 Edited at: 20th Apr 2006 14:45
Hi,

I was working on a few new commands and features that I think really add something to the product. Unfortunately, exams have got in the way. Over the new couple of months I'm taking my A Levels and, to those outside of the UK, they sorta decide your life (ah, the perils of being a full time student and part time software developer ). I've had to dramatically downsize the time spent on anything programming related recently (you may have noticed I've sort of disappeared from the forums recently).

Unity is still a relatively new product and I think if I can get an update out after 6 months of being on sale that's a pretty good turnaround time.

If anybody has any feature requests don't hesitate to reply with them, no matter how specialist they might be to you.

I'll post up any more developments as they appear

Chenak
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 20th Apr 2006 14:45
yeash... A-Levels, say no more good luck!
Prime_8
21
Years of Service
User Offline
Joined: 10th Apr 2003
Location: Canada
Posted: 21st Apr 2006 19:38
Unity is soo perfect
. man . .it has taken me days to justto learn the most basic of lua .hehe
but man all i wanted was the tables and got so much more.

I sort of with ther was a way ofr us to expose our DBP functions into lua directly .. but hey it's not all that hard to do it with send message and just write some wrapper functions.

best 20 i spent on coding this year .

Habatar
20
Years of Service
User Offline
Joined: 9th Aug 2004
Location: Madrid (Spain)
Posted: 23rd Jun 2006 13:35
Hello David T.
Any news of uncomming Lua features?

Currently I use Lua for load data, due to the potential Array sistem.
I think that the Script possibilities of Lua are very great, but are not full covered.

Ok, you can use the Send Message to create "functions" managed in DBP. The problem is that you can't run a Script and, at the same time, check the Message, executin actions and returning values (to the Script), and continue whit the Script.

If there any possible to improve the Script system? Probably adding the possibility to add your own functions for a user DLL?

2 Moths later, but Good Luck in your Exmans

David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 25th Jun 2006 13:39
Hi!

Just finished my exams marathon. The strange feeling is, once you've finished them you value spare time much more and so feel guilty about doing anything - anybody who's done exams will know the feeling!

As for upcoming Lua features, I've been tinkering with a few things for a while. I'm working on a third party extensions framework so

a) anybody can add new features to Unity themselves via DBPro TPC DLLS
b) existing DBPro TPC authors can add Unity functionality to their DLLs

I'm also working on a database extension as a code example of this that will take full advantage of Unity's PHP like syntax (imagine the ease of MySQL + PHP in DBPro).

Also working on some examples to show multithreading to you (I've got a rough, and brilliant, example here with a flashing lihtbulb. Imagine a script that goes

TurnLightOn()
Wait(1000)
TurnLightOff()
Wait(1000)

controlling a flashing light in real time. No need to worry about loops and syncs, the threading does it for you.

As for DBPro user functions, not yet. I'm going to wait until I find a satisfactory and easy way of hooking functions up - I find function numbers fiddly and hard to mess up.

Habatar
20
Years of Service
User Offline
Joined: 9th Aug 2004
Location: Madrid (Spain)
Posted: 25th Jun 2006 17:45
Quote: "
Just finished my exams marathon. The strange feeling is, once you've finished them you value spare time much more and so feel guilty about doing anything - anybody who's done exams will know the feeling!"

Yeah, is a very extrange feeling. But is a very good feeling .

Quote: "a) anybody can add new features to Unity themselves via DBPro TPC DLLS"

Very good. This will be very good for me.

Quote: "I'm also working on a database extension as a code example of this that will take full advantage of Unity's PHP like syntax (imagine the ease of MySQL + PHP in DBPro)."

Wow. This is fantastic.

Quote: "Also working on some examples to show multithreading to you (I've got a rough, and brilliant, example here with a flashing lihtbulb. Imagine a script that goes"

This open a lot of possibilities. For example: the possibility to use Script system for the games, like maps tiggers, etc...


Thanks for your work David T. This feeatures will make Unity and DBP better.

Steve J
18
Years of Service
User Offline
Joined: 22nd Apr 2006
Location: Vancouver, Washington
Posted: 25th Jun 2006 21:06
@David: You mean the feeling where you value time more, and when you waste time, you feel bad about it?

In other news, I am buying unity in that big gamecreators pack, as it sounds great. My use would be to contain events that should happen randomly...



Need php coding? Need your design to be coded? Will code for graphics:-( Contact me at: webmaster@programmer-scripts.com
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 25th Jun 2006 21:23
Quote: "@David: You mean the feeling where you value time more, and when you waste time, you feel bad about it?"


Well... I just don't feel up to much! Before exams I could go on day long coding sprees to get things finished, now my concentration doesn't hold that long. And then I think should I be revising?

I'm sure it'll come in time...

David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 4th Jul 2006 22:39
Hi All,

Progress report: just fixed a few bugs that have been brought up about strings, and I've added two new commands:



Thus eliminating the need for luac.exe.

DaveC9000
18
Years of Service
User Offline
Joined: 15th Jan 2006
Location:
Posted: 4th Jul 2006 23:45
We can compile the scripts right from out DBPro app? That's the best news I've heard all week!
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 5th Jul 2006 00:11
Yes, that's right

The Nerd
20
Years of Service
User Offline
Joined: 5th Jun 2004
Location: Denmark
Posted: 11th Jul 2006 00:06 Edited at: 11th Jul 2006 00:07
Hi David,

Just got to read those news now. I've been on vacation for 2 weeks without any internet. All sounds very good Glad to see that you can now compile scripts from your dbpro app! And third party extension framework... Yummy.

Keep up the good work!

Cheers.

David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 11th Jul 2006 00:20
Hi

Thanks for the kind words.

One new command, as requested...



entomophobiac
22
Years of Service
User Offline
Joined: 1st Nov 2002
Location: United States
Posted: 11th Jul 2006 05:07
What happened to the whole "calling DBPro functions with Lua" thing? I've been looking forward to that since my Unity purchase, and am actually beginning to consider DarkScript instead as it is a piece of functionality that I truly and - almost desperately - need.
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 11th Jul 2006 23:10
Hi,

At the moment it doesn't look likely for the next update.

I was told by somebody that when they did some work on the DBPro comiler they'd look at adding some modifications so external TPCs could call DBPro functions conveniently. At the moment there's no proper protocol. However, unfortunately plans changed as they do and they got wrapped up working on something else, and the compiler became Lee's domand. He's keen to just fix bugs at the moment and add new features later - which I understand and think is sensible.

Darkscript has DBPro function calling by way of a little 'hack' - a very clever one I admit and I admire Torrey for his work on it, where you can only refer to a function by the order in which it appears. I would prefer to use a more robust, usable and convenient solution in Unity.

Hope it helps

entomophobiac
22
Years of Service
User Offline
Joined: 1st Nov 2002
Location: United States
Posted: 11th Jul 2006 23:56
In all honesty, I'd prefer to use Lua in the future and it wasn't my intention to sound threatening, which I realized I kind of did. Sorry for that.

But do you believe that such a feature would be possible in the near future? I mean, the functions must exist before they can be called by a Lua script, anyway, so in case the update will appear in a not too distant future, I'm still your friend
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 12th Jul 2006 00:03
Hi,

Yep, Lua is a nice language and its accessibility is one great plus. That's why im so keen to get as much out of it as possible.

To quote Lee:

Quote: " It would be almost impossible for TPC commands to get at the functions created inside DBPro as they are simply a block of memory located quite deep and anonymously inside the ASM."


My idea was for some sort of modification to the compiler to be done so that either the addresses of the functions, or the functions, are somehow exposed to TPCs.

In future I anticipate it may be possible. I may email him again soon and ask very nicely how, theoretically, it could be done.

Another thing that looks promising is getting at DBpro's variables. There's a promising struct in globstruct.h called something like DBProVariables but aside from that its blank at the moment... perhaps making space for the future? If I did get access to DBPro's variables I could add some sort of LUA LOCK VARIABLE command which makes sure a dbpro variable and the lua variable of the same name are kept persistant.

entomophobiac
22
Years of Service
User Offline
Joined: 1st Nov 2002
Location: United States
Posted: 12th Jul 2006 00:43
That sounds great! Actually, what I always hoped for to do, as Lua is extremely fast and accessible, was to just create a simple framework of functions in DBPro so that I don't have to learn DirectX and then apply it using Lua. Functions are more important than variables, as I see it, as long as you can send Lua variables with the functions when you call them from Lua... Retarded sentence, but I think you know what I'm getting at.

Also, I'd most definitely like you to send that friendly e-mail. In fact, I'd personally be glad to pay a few $ for a Unity extension in case this kind of functionality would be implemented. Truly. Not sure anyone else would, though...

But keep us posted. I'd even stick with some ad hoc solution to calling functions from Lua... no matter how it's done, I'd pay for it
Zaika
18
Years of Service
User Offline
Joined: 1st Aug 2006
Location:
Posted: 1st Aug 2006 18:11
I just tried to compile the RPG demo included with the LUA Unity pack, and I keep getting the following error:

"Command out of place at line 219"

At 219, there is simply an "endwhile" command which looks in place with the "while lua next()" at line 202. I tried just a simple do/loop which compiles so I don't think there is a missing end of loop anywhere. Also, if I comment out line 219, the program compiles and runs but basically kills the UpdateEnts: routine.

Any ideas?

Thanks!
Zaika
18
Years of Service
User Offline
Joined: 1st Aug 2006
Location:
Posted: 1st Aug 2006 18:14
I just tried to compile the RPG demo included with the LUA Unity pack, and I keep getting the following error:

"Command out of place at line 219"

At 219, there is simply an "endwhile" command which looks in place with the "while lua next()" at line 202. I tried just a simple do/loop which compiles so I don't think there is a missing end of loop anywhere. Also, if I comment out line 219, the program compiles and runs but basically kills the UpdateEnts: routine.

Any ideas?
Zaika
18
Years of Service
User Offline
Joined: 1st Aug 2006
Location:
Posted: 1st Aug 2006 18:45
I figured out how to fix it. It seems that the "rem" statement above the while line "continues" to basically rem out the entire while line. The way to fix it is to remove the "..." at the end (or just make it ".." instead). I am not sure why this would happen, but it looks like this represents a bug in DBPro.
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 2nd Aug 2006 11:59
Hi,

Turn off line concacentation in the editor. The "--" makes the editor run that line into the next, messing it all up.

Sorry for the delayed reply. Been in Antigua. Just been able to get to a pc now (gatwick airport).

David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 8th Aug 2006 00:38
Hi all,

Just sent the 1.1 update to Mike now - look out for it soon!

The Nerd
20
Years of Service
User Offline
Joined: 5th Jun 2004
Location: Denmark
Posted: 8th Aug 2006 00:57
Quote: "Just sent the 1.1 update to Mike now - look out for it soon!"




Didn't expect this one coming! That's awesome!

Do you have a list of changes/fixes from the new update?

Cheers.

Habatar
20
Years of Service
User Offline
Joined: 9th Aug 2004
Location: Madrid (Spain)
Posted: 14th Aug 2006 13:46
Wow. Very good.
Thanks.

David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 14th Aug 2006 14:07
Sorry Nerd, forgot to reply to this after you asked me on MSN!

Included are a few new commands, a fix to that annoying string bug, and documentation updates.

Install should be fixed this week.

For the next update things I want to work on are actual new features, plus a console type thing as requested for debugging.

The Nerd
20
Years of Service
User Offline
Joined: 5th Jun 2004
Location: Denmark
Posted: 14th Aug 2006 14:50
Quote: "Sorry Nerd, forgot to reply to this after you asked me on MSN!"


Hehe, sorry. I was just a bit impatient...

Quote: "For the next update things I want to work on are actual new features, plus a console type thing as requested for debugging."


Sounds awesome!

Cash Curtis II
19
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Corpus Christi Texas
Posted: 14th Aug 2006 17:22
David T, wait! You know what we need? An easy, instant way to interrogate an array and get back the number of elements that are contained within.

I know, we have "LUA ITERATE ARRAY", but I don't like that command. I like to iterate through the array directly with my For...Next loops. We need something like "LUA GET ARRAY SIZE", with an integer returned with the number of elements. As it is now, I specify the number of elements inside of each array, which can be a bit annoying at times.

One other request - I'd like an option to halt program execution if I attempt to access a variable that doesn't exist. That, combined with that console window, will make debugging LUA DBP code a breeze.

Thanks!


Come see the WIP!
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 14th Aug 2006 20:00 Edited at: 14th Aug 2006 20:02
Cash,

I will add the halt option in the next update.

Quote: "David T, wait! You know what we need? An easy, instant way to interrogate an array and get back the number of elements that are contained within."


You can do it with standard Lua code using table.getn()



and this DBPro wrapper



This is what I like about Unity. You can write your own extensions for most things directly.

[edit] not even that actually, you can just call table.getn() directly from DBPro. silly me.

Cash Curtis II
19
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Corpus Christi Texas
Posted: 15th Aug 2006 08:16
Ah! I appreciate it, David. I'll promptly make use of that.


Come see the WIP!
MatriX
21
Years of Service
User Offline
Joined: 19th Oct 2003
Location: Deer Park, New York
Posted: 23rd Aug 2006 06:50
Once Unity is purchased does one need to purchase a " Lua scripting language " license as well?

It doesn't say that but the wording sounds like there are two products needed to get into the scripting...

Thank you TGC for creating such amazing products!

Success does not come with meeting the minimum requirements.
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 23rd Aug 2006 16:34
Nope. You don't need any other licenses or software.

Habatar
20
Years of Service
User Offline
Joined: 9th Aug 2004
Location: Madrid (Spain)
Posted: 2nd Sep 2006 01:43
Thanks David T.
I see that the new version are avaible now. I download it.

Only one extrange think. The file is called Unity_v2, but in the manual say that is v1.1


Cave Man
18
Years of Service
User Offline
Joined: 22nd Aug 2006
Location: North Carolina, US
Posted: 2nd Sep 2006 01:56
Hey everyone. Where do i download the new version?


Language: DBP 6.2
Cream cheese is your enemy. Sweet tea is your freind.
Habatar
20
Years of Service
User Offline
Joined: 9th Aug 2004
Location: Madrid (Spain)
Posted: 2nd Sep 2006 09:34
Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 2nd Sep 2006 10:59
Sorry for posting here, but how do you get those icons in the bar in your signature? (I mean, how do you make your plug-in do that, if you know).

I dont own any official tgc dll's so i wouldnt know.

David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 2nd Sep 2006 11:45
Quote: "Only one extrange think. The file is called Unity_v2, but in the manual say that is v1.1 "


lol. Seems like Mike wasn't paying attention...

Quote: "Sorry for posting here, but how do you get those icons in the bar in your signature? (I mean, how do you make your plug-in do that, if you know)."


Which icons? Which bar?

Habatar
20
Years of Service
User Offline
Joined: 9th Aug 2004
Location: Madrid (Spain)
Posted: 2nd Sep 2006 12:44
Quote: "Sorry for posting here, but how do you get those icons in the bar in your signature? (I mean, how do you make your plug-in do that, if you know)."

This icons are only for official licensed plugin.
User plugins cant have icons.

David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 2nd Sep 2006 13:15
Ooh, are you talking about the product activation? Yes only TPCs that need to be activated (ie official) get shown in that program. My signature is just a png file with the icon in...

David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 3rd Sep 2006 11:52
Hi,

Can I check, have any of you installed and used the new commands?

Habatar
20
Years of Service
User Offline
Joined: 9th Aug 2004
Location: Madrid (Spain)
Posted: 3rd Sep 2006 13:14
Hello David T.

The new commands not work for me. I recive a "Could not undestand command at line X" error when compiling.


I think that I have the good version because the commands are Blue Highlight in the IDE, but I see that error when compiling.

The first version commands works well.

David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 3rd Sep 2006 14:51 Edited at: 3rd Sep 2006 14:53
Very odd - somebody else has reported this too. I've opened the plugin DLl I sent to Mike in Notepad, and voila there are the new commands in the stringtable. Additionally, the new plugin works fine here. I can only think that somehow the update distributes the old DLL with all the new keyword and help files. I will be greatly irritated if so. Apologies in advance for the problems, I'll get onto Mike (who builds the installer) now.

Habatar
20
Years of Service
User Offline
Joined: 9th Aug 2004
Location: Madrid (Spain)
Posted: 3rd Sep 2006 15:17
The commands have been escaped.

If this can help you. I have opened the DLL whit NotePad and the new commands not appear in the String Table.
Also, the date info of the DLL is:
-Created: 02 september 2006
-Modified: 29 agoust 2006



Login to post a reply

Server time is: 2024-11-26 20:44:30
Your offset time is: 2024-11-26 20:44:30