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.

Work in Progress / DarkScript (plugin) for DarkBASIC Pro

Author
Message
PowerSoft
20
Years of Service
User Offline
Joined: 10th Oct 2004
Location: United Kingdom
Posted: 14th Nov 2005 18:50
Probably wouldn't use it, nothing personal but i've been making one on and off and I like having the feeling of entirly or semi-entirly home-homebrew in my games and applications

Torrey
20
Years of Service
User Offline
Joined: 20th Aug 2004
Location: New Jersey
Posted: 15th Nov 2005 08:27 Edited at: 15th Nov 2005 14:49
I think everyone will like this little speed test!

Using only DarkBASIC Pro with this source I achieved 7 fps.


Using DarkBASIC Pro with DarkScript I achieved 194 fps! That's way more then what DGSDK and only DarkBASIC put out.

DBP Source:


DarkScript Source:


Compiled files and source attached to this post. The way I used the 'for' statement above in the DarkScript source is an alternative way of using that keyword as documented in the GameMonkey reference.

[edit]

Here's an alternate way to do the same thing I did above in the DarkScript:


One of my home pc's that I tested this on gets on avg 280 fps with my script version.


Check out my site!

Attachments

Login to view attachments
Scilynt
22
Years of Service
User Offline
Joined: 13th Nov 2002
Location: .-#-.
Posted: 15th Nov 2005 15:40 Edited at: 15th Nov 2005 15:45
Not a bad performance boost

Without Script: 10 FPS
With Script (Original): 2600 FPS
With Script (The Edit): 2700 FPS

Good work.
Torrey
20
Years of Service
User Offline
Joined: 20th Aug 2004
Location: New Jersey
Posted: 16th Nov 2005 00:10 Edited at: 16th Nov 2005 00:11
Quote: "Not a bad performance boost

Without Script: 10 FPS
With Script (Original): 2600 FPS
With Script (The Edit): 2700 FPS

Good work."

Thanks, I've done quite a few more speed tests and all have done very well. And because of this tonight I've started testing high amounts of polys to see the results of using darkscript with dbp vs only using darkbasic pro.


Check out my site!
Torrey
20
Years of Service
User Offline
Joined: 20th Aug 2004
Location: New Jersey
Posted: 16th Nov 2005 12:42
Several code updates were made throughout the night, and the link above has been updated with the newest release.

Changes made (that I still remember):

- Repaired the MakeCube script command. Interally it was passing the size value as an integer when it needed to be a float.
- Changed the conversion from float to long to the proper name. (internal)
- Added CameraAngleX,CameraAngleY,CameraAngleZ script commands. Currently those work with camera 0 and do not take params. Example:

xangle = CameraAngleX();

- Other misc changes and minor bug fixes...


Check out my site!
Kenjar
19
Years of Service
User Offline
Joined: 17th Jun 2005
Location: TGC
Posted: 16th Nov 2005 13:15
What will be the licence agreement for this plugin when it's finished? Will it be released under GPL or will it go commerical?

I have an interest in this for the OpenMMORPG project, the ability to add scripts externally would be very useful, as is the MySQL database support. That would solve some of the online problems we'll be facing in the future.


Run before you can walk, always raise the stakes higher, always keep moving, because you never know who's catching up.
Torrey
20
Years of Service
User Offline
Joined: 20th Aug 2004
Location: New Jersey
Posted: 16th Nov 2005 15:18
Quote: "What will be the licence agreement for this plugin when it's finished? Will it be released under GPL or will it go commerical?

I have an interest in this for the OpenMMORPG project, the ability to add scripts externally would be very useful, as is the MySQL database support. That would solve some of the online problems we'll be facing in the future."

There will be a free version and a commerical version. You should be more then fine to use this with your OpenMMORPG project. Don't forget that the databases created are in SQLite format.

If you need help with what commands are available or how to use them, or even the syntax of the scripting language feel free to ask anytime.


Check out my site!
Peter H
20
Years of Service
User Offline
Joined: 20th Feb 2004
Location: Witness Protection Program
Posted: 16th Nov 2005 20:02
Well, the speed improvements are impressive...

but that was calculating random numbers right?

would be interesting to see if there's a speed increase with 3D operations...

"We make the worst games in the universe..."
Torrey
20
Years of Service
User Offline
Joined: 20th Aug 2004
Location: New Jersey
Posted: 17th Nov 2005 12:07 Edited at: 18th Nov 2005 05:31
Here's an example I put together during the night. It shows off how to use DarkScript without using a script file, and also two system commands for files (there are more!). The file commands were used to grab the texture files names for the use of loading and displaying the texture name once loaded.

Here's the screenie:


The controls are:

p = pause auto rotation or unpause rotation
t = change fighter texture
a = move fighter left
f = move fighter right
e = move fighter up
d = move fighter down
w = move fighter away from the camera
s = move fighter toward the camera
up, down, left, and right arrowkeys = rotate the fighter plane

[edit]
DBP Source is included in the download.


Check out my site!

Attachments

Login to view attachments
Torrey
20
Years of Service
User Offline
Joined: 20th Aug 2004
Location: New Jersey
Posted: 21st Nov 2005 11:21
I need some help deciding something, currently this scripting language uses static datatypes for various commands when it comes to darkbasic pro calls. For example the command NewXValue uses all integers for input params.

Should I change functions to check the variable input type so that users can alternate between the type they'd want to use, even though this could cause a very small slow down since it's running through more code?

Note: As of current distributed DarkScript release, the command NewXValue is not included. An updated release of DarkScript is due out in 1-2 days.

Mikey P
19
Years of Service
User Offline
Joined: 23rd May 2005
Location: Manchester, UK
Posted: 25th Nov 2005 22:27
Have to say, it's looking very nice

I've decided to use this for my project, but from stuff I've tried, it doesn't seem to have Sprite commands... any chance of them being adding in the near future? *flutters eyelids* heh

But still, It's a nice syntax, it's a shame these new scripting thingies for DBP can't let the scripts call the User's DBP Functions...

Torrey
20
Years of Service
User Offline
Joined: 20th Aug 2004
Location: New Jersey
Posted: 25th Nov 2005 23:22
Quote: "Have to say, it's looking very nice

I've decided to use this for my project, but from stuff I've tried, it doesn't seem to have Sprite commands... any chance of them being adding in the near future? *flutters eyelids* heh

But still, It's a nice syntax, it's a shame these new scripting thingies for DBP can't let the scripts call the User's DBP Functions..."

Thanks for the good words, I have nothing to do at work today for the next 6 hours, so I'll start adding in the sprite commands for you. Remember that you'll need to use at least one sprite command in your dbpro code so that the sprite plugin loads.

Mikey P
19
Years of Service
User Offline
Joined: 23rd May 2005
Location: Manchester, UK
Posted: 25th Nov 2005 23:58 Edited at: 25th Nov 2005 23:59
Awesome, I'm sure I'm using atleast one before I need scripting, I'll check later ^.^

Thanks alot

Torrey
20
Years of Service
User Offline
Joined: 20th Aug 2004
Location: New Jersey
Posted: 26th Nov 2005 01:13 Edited at: 26th Nov 2005 01:14
The setup file link up top has been updated, and here's the script commands added so far dealing with sprites:

Sprite
SetSprite
SizeSprite
ScaleSprite
StretchSprite
OffsetSprite
MirrorSprite
FlipSprite
DeleteSprite
PasteSprite
HideSprite
ShowSprite
HideAllSprites
ShowAllSprites
SpriteExist

Each of these commands uses the same inputs as the dbpro commands, so use the dbpro help file if you need to know what the params are. Also each of the params for these sprite commands are integers only.

Mikey, is there any other sprite commands you need right away?

Mikey P
19
Years of Service
User Offline
Joined: 23rd May 2005
Location: Manchester, UK
Posted: 26th Nov 2005 11:35
Nope, thats perfect ^.^ That's all I need plus a whole lot more, thanks a bundle

Hamish McHaggis
21
Years of Service
User Offline
Joined: 13th Dec 2002
Location: Modgnik Detinu
Posted: 26th Nov 2005 14:32
Excellent stuff! Just be careful not to step into dangerous territory when it comes to DBPro commands.

Torrey
20
Years of Service
User Offline
Joined: 20th Aug 2004
Location: New Jersey
Posted: 30th Nov 2005 19:57
Quote: "Nope, thats perfect ^.^ That's all I need plus a whole lot more, thanks a bundle."

Awesome! Any further questions feel free to ask.

Quote: "Excellent stuff! Just be careful not to step into dangerous territory when it comes to DBPro commands."

Thanks, I'm still impressed at how fast you learned the scripting language with just me replying to you. That must say something about the language. The DBPro command set will be fairly limited to prevent people creating wrappers.

Torrey
20
Years of Service
User Offline
Joined: 20th Aug 2004
Location: New Jersey
Posted: 3rd Dec 2005 17:32 Edited at: 4th Dec 2005 03:12
Here's a nice update you won't find anywhere else.

I've created two layers of error protection and output. The first layer is the parsing. Example of that layer would be if you forgot to put the ; at the end of a line. The second layer goes to the code level when the script is running. If there is an error with your code, let's say you misspelled a command, when the command is executed a debug report message box will appear with complete information on the error, line number, and which script file it occured in (if any).

Below I pasted the image showing two example error messages.



The link at the beginning of this thread has been updated for this new change.

Attachments

Login to view attachments
Torrey
20
Years of Service
User Offline
Joined: 20th Aug 2004
Location: New Jersey
Posted: 7th Dec 2005 09:52 Edited at: 7th Dec 2005 11:01
Updates:

- Beefed up the multithreading with a new timer.

- Changed the setup file to delete old copies of the plugin before installation (if any are installed).

- Worked on 7 new projects for the commerical version. You really have to take your hat off to the guys that take time to create commerical products, it takes one heck of a long time to create quality examples, demos, and documentation.

- Started writing an example script with threading using a security camera monitoring for the player. Will upload that example soon. Attached is a picture of it in its current state. [edit] Sorry the picture turned out dark.

Download the update here.

Attachments

Login to view attachments
CPU
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Carlsbad, CA
Posted: 7th Dec 2005 16:47
Torry - A commercial version or is the commercial version just for if someone wants to sell their game? I thought you were going to try to compeate with David T and unity? or did you decide to, er, go the same route as he did and sell?

CPU

[center]K-OS Battlefields
IS
///---///---///---UNDER CONSTRUCTION---\\\---\\\---\\\
[center]
Torrey
20
Years of Service
User Offline
Joined: 20th Aug 2004
Location: New Jersey
Posted: 7th Dec 2005 20:33
Quote: "Torry - A commercial version or is the commercial version just for if someone wants to sell their game? I thought you were going to try to compeate with David T and unity? or did you decide to, er, go the same route as he did and sell?

CPU"


The commerical version is optimized, has documentation, tutorial examples, and help files so people have reference for the commands. This plugin really challenges David T's Unity plugin. The problem I have is one of my own, and it's lack of right brained creativity with creating "cute" demo's with DBP to show off the plugin. I'm more of a technical guy.

Torrey
20
Years of Service
User Offline
Joined: 20th Aug 2004
Location: New Jersey
Posted: 13th Dec 2005 10:12
Here goes a script that I put together for loading m3u playlist files. It contains functions for populating the playlist array, returning a random song, and a function for returning the total number of songs.

If you use my audio plugin this would work great with it, especially if you're creating a media player, or a game that has multiple audio tracks during gameplay.

DarkScript Source:


If you have questions about the script logic, or how to use this with dbpro, just ask!

FXTC
20
Years of Service
User Offline
Joined: 3rd Jul 2004
Location: CzechRepublic
Posted: 14th Dec 2005 00:15
this scripting language looks good

AMD 2,4 512MB RAM,2x200GB hdd,GforceFX5700GT128MB
Torrey
20
Years of Service
User Offline
Joined: 20th Aug 2004
Location: New Jersey
Posted: 18th Dec 2005 17:41
Quote: "this scripting language looks good"


Thanks for checking it out and leaving a comment! I wish more people would put it to the test like they have with my audio plugin.

Torrey
20
Years of Service
User Offline
Joined: 20th Aug 2004
Location: New Jersey
Posted: 19th Dec 2005 08:15 Edited at: 19th Dec 2005 09:23
Tonight I decided to take a bold attempt at something that is always of topic with plugins, especially scripting ones. This involves the usage of dbpro functions from a plugin.

I ended up using inline asm to achieve as much as I did already. What I did to start off was grab the return address to the dbpro code from the stack, and performed a search in that memory space for the search string I specified. It worked perfectly, the only problem being that there needs to be a solid way of identifying one function from another. I'm hoping that I come up with a creative way to solve this problem so that users can benefit from it.

The possible future DarkScript command would look like:

SCRIPT LOAD DBP FUNCTION "some_function","script command name"

e.g.
script load dbp function "load_maps","LoadMaps"

Then within your scripts you'd use the command:

LoadMaps();

To access the dbpro function.

Wish me luck!

[edit]

Got a test dbp function running from a script as a command!!!!


Torrey
20
Years of Service
User Offline
Joined: 20th Aug 2004
Location: New Jersey
Posted: 19th Dec 2005 12:38 Edited at: 19th Dec 2005 12:38
Okay, this maybe another cube example, but it demonstrates one of the most powerful features a plugin could have. After working several hours I feel great after getting it to work.

The feature shown in this example can run dbpro coded functions from within your script! You can even give the script command the name you choose. I am still calling this an experimental function, because I'm not completely sure it will run on everybody's system, so please help me test it.

DBPro Source:


DarkScript Source:


Attached is the example source and compiled executable.

I have not updated the plugin setup for this new feature, but I will do so once more testing has been done by users!

Attachments

Login to view attachments
John Y
Synergy Editor Developer
22
Years of Service
User Offline
Joined: 4th Sep 2002
Location: UK
Posted: 19th Dec 2005 12:55
Thats very cool. I wanted to know how to do this so that I could add 'events' to my plugin that could call dbp functions.

You should make that ability into a seperate plugin!

Torrey
20
Years of Service
User Offline
Joined: 20th Aug 2004
Location: New Jersey
Posted: 19th Dec 2005 15:32 Edited at: 19th Dec 2005 15:32


Thanks, I'll have to consider that idea. The function that actually gets the dbp functions isn't that big at all, but took me forever to tweak and get correct. Mainly because I had to play around with the stack, and get my structure format all setup without problems. Inline asm can really come in handy when you need it!

Incase you're reading this for the first time, look up about two posts ago and check out the darkscript example that allows you to use dbp coded functions in your scripts!

adr
21
Years of Service
User Offline
Joined: 21st May 2003
Location: Job Centre
Posted: 19th Dec 2005 16:25 Edited at: 19th Dec 2005 16:35
I've always been into the idea of "consoles" in games during development. You hit the ` key, set a couple of variables and then restart your event. This way you can tweak stuff in-engine ... and your plugin just made that process a WHOLE lot easier. A simple mapping table of DarkScript -> DBPro functions makes the process of setting engine variables and calling adhoc functions much more straight forward. Also, I'm not sure what string processing functions you've got, but they could come in handy too.

What's worrying me about this thread (if I can call it "worry") is that your plugin is slowly replacing the core language. You said earlier that your plugin outperformed native DBP code - Congrats to you on that, but doesn't that highlight some kind of issue with DBP's compiler?

[center]
iv tryed everything!!!!!!!!!! could u please just add The gun and shooting Code thats All!!!!!!!!!
Torrey
20
Years of Service
User Offline
Joined: 20th Aug 2004
Location: New Jersey
Posted: 19th Dec 2005 20:10
Quote: "I've always been into the idea of "consoles" in games during development. You hit the ` key, set a couple of variables and then restart your event. This way you can tweak stuff in-engine ... and your plugin just made that process a WHOLE lot easier. A simple mapping table of DarkScript -> DBPro functions makes the process of setting engine variables and calling adhoc functions much more straight forward."


What's cool is that this is a completely seperate language from DBpro. Not only do you have the scripting language to play around with, but now users have the ability to grab the DBPro functions from their game/app in memory and use them in their scripts.

I haven't tested functions with params but the way the scripting language functions it is already possible, the only worry at the current time is the total number of params entered. If the person enter too many or not enough the stack would be off and would probably cause a crash in time. So I'll have to add some protection with this new function I've created.

Quote: "Also, I'm not sure what string processing functions you've got, but they could come in handy too."


Here's a quick list of the script string commands, if you want to know how to use any of them let me know and I'll type up a quick example to show you how.

- IsEmpty
- Length
- Left
- Right
- RightAt
- Mid
- Compare
- CompareNoCase
- Int
- Float
- String
- Upper
- Lower
- SpanIncluding
- SpanExcluding
- AppendPath
- ReplaceCharsInSet
- Find
- Reverse
- ReverseFind
- GetAt
- SetAt
- TrimLeft
- TrimRight
- GetFilenameNoExt
- GetFilename
- GetExtension
- SetExtension
- GetPath

Quote: "What's worrying me about this thread (if I can call it "worry") is that your plugin is slowly replacing the core language. You said earlier that your plugin outperformed native DBP code - Congrats to you on that, but doesn't that highlight some kind of issue with DBP's compiler?"


In some parts of execution DarkScript can out perform dbpro code, but it is not replacing that language at all. DarkScript is completely seperate, but modded in a way that this version is integrated with dbpro itself as an extension of the language (only C-style instead of BASIC style, sorry ).

It turns out that the earlier example where the speed was super increased is one of those logic puzzles. Most of the people I knew thought it was some sort of optimization engine in the compiler, but it really turned out to be one of those hard to understand logic formats that would screw anyone over on a programming exam.

adr
21
Years of Service
User Offline
Joined: 21st May 2003
Location: Job Centre
Posted: 19th Dec 2005 20:35
Quote: "it is not replacing that language at all. "

I think you may have misunderstood my sentiment. What I'm saying is, your "ameteurish" plugin is out-shining the DBP compiler. It's something to be proud of, don't get me wrong.

From TGC's point of view, I'd be concerned that their product will just become a 3D engine, with everyone doing the logic in your scripting language. We're a while away from that yet, but if you were to keep developing this at your current rate, I don't think it's out of the question.

[center]
iv tryed everything!!!!!!!!!! could u please just add The gun and shooting Code thats All!!!!!!!!!
Torrey
20
Years of Service
User Offline
Joined: 20th Aug 2004
Location: New Jersey
Posted: 20th Dec 2005 09:05
Quote: "I think you may have misunderstood my sentiment. What I'm saying is, your "ameteurish" plugin is out-shining the DBP compiler. It's something to be proud of, don't get me wrong.

From TGC's point of view, I'd be concerned that their product will just become a 3D engine, with everyone doing the logic in your scripting language. We're a while away from that yet, but if you were to keep developing this at your current rate, I don't think it's out of the question.
"


Thanks for the good compliments! I am proud of the work that has been done thus far. With the addition of this new function I will be able to remove a lot of the dpbro commands that I needed to use before. Doing this will tie DarkScript and DBPro closer together. I do understand what you mean though, I'll have to avoid dominance over the DBP compiler.

Development will begin to slow down now so that I can prepare what I need to for the commerical release of v1.0. Other than improvements I can't think of too many additional features that are needed for this first version?

Torrey
20
Years of Service
User Offline
Joined: 20th Aug 2004
Location: New Jersey
Posted: 21st Dec 2005 07:55 Edited at: 21st Dec 2005 09:22
Tonight I added a new darkscript command which is:

IsPressed(key); // key = virtual key code

The use of this in script command was simplified by me creating the variables for the user. For example if you wanted to find out if the user pressed the RETURN key, you'll use a command like:



I am still in the middle of adding the key variables, but most will be like:

Key.LBUTTON - left mouse button
Key.RBUTTON - right mouse button
Key.MBUTTON - middle mouse button
Key.RETURN - enter key
Key.BACKSPACE - backspace key
etc...

I will post up the rest of them when I have completed adding them. Also this isn't that suprising but this script command for checking a keypress is faster than dbpro's because it uses the API GetAsyncKeyState, whereas dbpro goes through several lines of code and internal functions before returning its result.

Hamish McHaggis
21
Years of Service
User Offline
Joined: 13th Dec 2002
Location: Modgnik Detinu
Posted: 21st Dec 2005 14:27
Holy moly! The ability to call DBPro functions makes things a lot easier, although loading all the functions using the order they appear in-code could become quite hasslesome (especially when you have several hundred functions in your code, and are constantly inserting new functions inbetween).

Quote: "From TGC's point of view, I'd be concerned that their product will just become a 3D engine, with everyone doing the logic in your scripting language. We're a while away from that yet, but if you were to keep developing this at your current rate, I don't think it's out of the question."


Torrey wouldn't be allowed to put in all the DBPro commands into this plugin, so you will never be able to just call a single function from within DBPro, and use it as an engine. If you want a faster, more flexible language to make games in, but still want to use the DBPro engine, then use DGSDK, that certainly seems to be TGC's attitude towards the matter (not that I agree with it, and to be honest, if I was going to learn to use C++ seriously then I'd probably look into using one of the other 3D engines available, as DBPro certainly isn't the best one). This plugin however is really useful for allowing users to mod your cretions to a certain extent. You will still need to use DBPro to create the core part of your engine, as transferring data between the plugin and DBPro is relatively slow (at the moment).

Torrey
20
Years of Service
User Offline
Joined: 20th Aug 2004
Location: New Jersey
Posted: 21st Dec 2005 15:15 Edited at: 21st Dec 2005 15:38
Quote: "Holy moly! The ability to call DBPro functions makes things a lot easier, although loading all the functions using the order they appear in-code could become quite hasslesome (especially when you have several hundred functions in your code, and are constantly inserting new functions inbetween)."


I'm sorry about this fact, but there isn't much of an easier way to do it. The community talked about this for a long time with no results, but finally I broke down and wrote a byte parser to grab dbro's functions in the order they were created. Which happens to be the order that you coded them. More information will appear in the manual about this topic. I'm planning on giving you a free license to the commerical product.

Quote: "You will still need to use DBPro to create the core part of your engine, as transferring data between the plugin and DBPro is relatively slow (at the moment)."


Having problems there that I don't know about? I haven't had many speed problems at all with DarkScript. I did notice something though that may help out some people. When possible try to use SCRIPT EXECUTE. It'll save you a couple FPS.

In other news about 80% of the dbpro help files are complete, and I have started working on the manual. I can only imagine how many pages that manual will be when complete (at least 50).

Hamish McHaggis
21
Years of Service
User Offline
Joined: 13th Dec 2002
Location: Modgnik Detinu
Posted: 21st Dec 2005 19:58
Quote: "I'm planning on giving you a free license to the commerical product."


Thanks, presumably you mean for Blackout? If you indeed decide to be so generous then maybe you could do what Benjamin, author of Tempest (the network plugin we are using) did, and add a splash screen saying that it should only have been used in Blackout. This way other people couldn't use the plugin for their projects, and would also be able to re-compile the Blackout code. Otherwise, I will just stick with the free version (for Blackout anyway)!

Quote: "Having problems there that I don't know about? I haven't had many speed problems at all with DarkScript. I did notice something though that may help out some people. When possible try to use SCRIPT EXECUTE. It'll save you a couple FPS."


The problem is with SCRIPT EXECUTE. To transfer data from DBPro to Darkscript you need to do something like:

script execute "variable = "+str$(value)

This takes significantly longer to do than doing "variable = value" in either purely DBPro or purely Darkscript. So whether you store your main data in DBPro or in Darkscript, it still takes ages to transfer between the two. I have also tried compiling several commands into a single script execute functions, but it makes no difference. Maybe I am missing something?

Torrey
20
Years of Service
User Offline
Joined: 20th Aug 2004
Location: New Jersey
Posted: 21st Dec 2005 21:12 Edited at: 21st Dec 2005 21:14
Quote: "The problem is with SCRIPT EXECUTE. To transfer data from DBPro to Darkscript you need to do something like:

script execute "variable = "+str$(value)

This takes significantly longer to do than doing "variable = value" in either purely DBPro or purely Darkscript. So whether you store your main data in DBPro or in Darkscript, it still takes ages to transfer between the two. I have also tried compiling several commands into a single script execute functions, but it makes no difference. Maybe I am missing something?"


What kind of values are trying to insert? Transfer of integers, floats, and strings are currently supported. To transfer a value from dbpro to darkscript you'd use this command:

script set int variable "variablename",integer value
script set float variable "variablename",float value
script set string variable "variablename",string value


Then to read a variable value from DarkScript to dbpro you'd use these commands:

result = script int variable("variablename")
result# = script float variable("variablename")
result$ = script string variable("variablename")


The variable names must be global variables, not local.

I've started thinking that you'll probably reply back with saying that you need to transfer table values, if this is the case I can look into that idea and see what is possible.

Hamish McHaggis
21
Years of Service
User Offline
Joined: 13th Dec 2002
Location: Modgnik Detinu
Posted: 21st Dec 2005 22:50
Yep, table values, and arrays too! Be quite cool if you could get them working too.

Mikey P
19
Years of Service
User Offline
Joined: 23rd May 2005
Location: Manchester, UK
Posted: 21st Dec 2005 23:19 Edited at: 22nd Dec 2005 02:33
Wow, DBP Functions in a scripting language... That's a dream . Are you just gonna have that functionality in the Commericial Version or Free Version too?

Great work *re-downloads*. Heh, Im soo happy, I was just cursing in IRC about how annoying it is that the scripting languages can't do this for DBP... *dances*. Thanks alot!

[Edit]
Hmm, Ohh i see, you have re-released yet heh ... The compiled example works fine here

[Edit2]



If I have that in my script file, and then do:



Why would it make Enemy(i).X equal 0? Am I misunderstanding the use of globals?

[Edit3]

Heh, Fixed Just had to do "global ReturnX = x;" instead of "ReturnX = x;"... Wee

Torrey
20
Years of Service
User Offline
Joined: 20th Aug 2004
Location: New Jersey
Posted: 22nd Dec 2005 14:08
Quote: "Yep, table values, and arrays too! Be quite cool if you could get them working too."


Completely done! I've changed the (receiving) variable commands for this change. You'll now be able to grab the values that you need. I'll be emailing you a copy of the plugin shortly.

Quote: "Wow, DBP Functions in a scripting language... That's a dream . Are you just gonna have that functionality in the Commericial Version or Free Version too?

Great work *re-downloads*. Heh, Im soo happy, I was just cursing in IRC about how annoying it is that the scripting languages can't do this for DBP... *dances*. Thanks alot!"


Thanks for the feedback! I'm waiting to release a new update since I constantly update and improve the source code. As for your question about the DBPro function usage I was planning on adding it to the free version. I still want to add more error protection for this feature since it is playing around with the stack.

One thing that will really help you is the scripting usage manual that I'm currently writing that will help you learn about the language and how to use it.

Mikey P
19
Years of Service
User Offline
Joined: 23rd May 2005
Location: Manchester, UK
Posted: 22nd Dec 2005 14:38 Edited at: 22nd Dec 2005 21:26
Any idea when the Commercial Version will be released? There's a good chance I'll be buying it

[Edit] Also, anychance of the command "Sprite Collision" being added for the next release?

[Edit2] More goodness...

If I define a structure of tables like so:



"Enemy[10].Bullets[2].X" should exist.. right? Because, after doing that, and sticking some data in from another function, I try to print it to the screen, but nothing happens. Before I put data into it, the function executes normally, but after I try put values in, it doesn't seem to execute atall... :/

Anything I'm doing badly wrong?

Torrey
20
Years of Service
User Offline
Joined: 20th Aug 2004
Location: New Jersey
Posted: 23rd Dec 2005 16:19
Quote: "Any idea when the Commercial Version will be released? There's a good chance I'll be buying it"


Thanks for the motivation! This really motivates me to work harder.

Quote: ""Enemy[10].Bullets[2].X" should exist.. right? Because, after doing that, and sticking some data in from another function, I try to print it to the screen, but nothing happens. Before I put data into it, the function executes normally, but after I try put values in, it doesn't seem to execute atall... :/

Anything I'm doing badly wrong?"


For the most part you're doing everything exactly right! For my own testing purposes I changed it to this:



BulletCount did need an equals sign there otherwise when you attempt to read it as Enemy[3].BulletCount you'll create an error. Since I imagine you're trying to read this in dbpro you'll most likely benefit from my newest update, which I will have to upload real soon so you can continue with your work. In the meantime you can test reading those by using something like:

script execute "tempbuf = Enemy[2].Bullets[3].X;"
result = script int variable("tempbuf")

The holiday season is kind of slowing me down with getting this update out and also working on the commerical release content. Almost everyday I have to go to a million different places or visit with some relative.

Mikey P
19
Years of Service
User Offline
Joined: 23rd May 2005
Location: Manchester, UK
Posted: 23rd Dec 2005 18:11 Edited at: 23rd Dec 2005 18:41
Awesome! That must of been my problem.... Can't test at the moment, because I have to clean the house for Christmas and stuff, but when I get a change, I'll give it a go. Got a good feeling that itwill work though hehe.

Any idea how much the commercial version shall be?

[Edit]

Woo, that fixed it =) Well, sort of, just a couple of my own bugs to fix... Thanks a bundle! Also, at the moment, there's no great need for me to use the Enemy table in DBP (I have a copy there already, that I update with a function), so don't go to any great measures to try and get it out for me .

Torrey
20
Years of Service
User Offline
Joined: 20th Aug 2004
Location: New Jersey
Posted: 25th Dec 2005 03:08
Quote: "Any idea how much the commercial version shall be?"


Not sure of the price as of yet.

Quote: "Woo, that fixed it =) Well, sort of, just a couple of my own bugs to fix... Thanks a bundle! Also, at the moment, there's no great need for me to use the Enemy table in DBP (I have a copy there already, that I update with a function), so don't go to any great measures to try and get it out for me."


Cool, good that you got it working. I think you'll really like the updates coming soon. Using DBP user functions as script commands will work great with your code. In the next day or two I'm going to add support for return values (from dbpro user functions), and also work on the system to support passing function params to those dbpro functions.

Torrey
20
Years of Service
User Offline
Joined: 20th Aug 2004
Location: New Jersey
Posted: 26th Dec 2005 14:53 Edited at: 26th Dec 2005 18:26
I have updated the beta version setup to include a newer darkscript compile. In this release there was a few changes, and also additions.

- SQL script commands removed for now. I plan on adding them back in soon, but as a DarkScript plugin. I'm working to add support for the user expansion of DarkScript. Users will be able to program their own plugin DLLs and create their own script commands!

- You can test out the experimental function that lets you use DBPro user functions as script commands. If you check several posts above you will find the example I created to show off this much needed feature. The command syntax is as follows:

SCRIPT LOAD DBP FUNCTION function number, script command name (returns true or false)

- I also improved the ability to grab variables from DarkScript to DBPro. You can grab values from arrays, tables, and the usual variables.

- Almost forgot about this update. I added keypress support. There are 52 predefined type bindings for the keyboard. The new script command is IsPressed(key) with key being the virtual key code. I still need to type out the complete list for users. Which I will most likely do tonight while I'm at work. Keep an eye for that on my website.

Enjoy the new update!

Click the above link to download the update.

[edit]

Note about the usage of dbpro functions: In this current release of DarkScript I have not included support grabbing the return value of the dbpro function, and also with this release you cannot use params with your dbpro function. These are simple additions to the scripting plugin and will be released soon. Until then, experiement around with the command and see how you like it!

Torrey
20
Years of Service
User Offline
Joined: 20th Aug 2004
Location: New Jersey
Posted: 27th Dec 2005 10:38 Edited at: 27th Dec 2005 10:39
Here's another feature I coded in tonight that will blow your mind. I have added in a DarkScript plugin framework! Say for example you write a plugin dll and are ready to load it into DarkScript, you can do it in one of two ways.

At the top of your script write:

BindPlugin("somefile.dll");

The optional way to load the plugin is through your dbpro code:

result = LOAD SCRIPT PLUGIN("somefile.dll") (returns 0 (false) for failure or 1 (true) for success)

Once the plugin loads your scripts will now be able to use your new bindings, even if the scripts were loaded previously!

I am attaching the first example plugin I wrote that created a new script command called AlertBox (simple messagebox). The commands format looks like AlertBox(message,title);.

DarkScript Source:


Let me know your thoughts on this feature!

Attachments

Login to view attachments
FXTC
20
Years of Service
User Offline
Joined: 3rd Jul 2004
Location: CzechRepublic
Posted: 27th Dec 2005 18:25
framework works good

AMD 2,4 512MB RAM,2x200GB hdd,GforceFX5700GT128MB
Torrey
20
Years of Service
User Offline
Joined: 20th Aug 2004
Location: New Jersey
Posted: 27th Dec 2005 23:15
Quote: "framework works good "


Awesome, tonight I'll work on the SQL one so users can access those commands again.

Torrey
20
Years of Service
User Offline
Joined: 20th Aug 2004
Location: New Jersey
Posted: 29th Dec 2005 12:40 Edited at: 29th Dec 2005 12:41
Quick Announcement

I have 11 more help file examples to create, finish off the function for loading dbp user functions, and work on the web interface for updates then I'm going to start the advertisement for the EA release. Users that purchase the EA version will have access to all the new updates and even the full version. If you want to wait until the full version is complete the price will go up around $5 USD. The price for EA version will be around $18.99, even if you think that is a high price remember that this is a full featured scripting plugin, plus a completely seperate programming language that is capable of stand alone for seperate applications.

DarkScript is not just a scripting language plugin for DarkBASIC Professional, but is capable of much more and I plan on taking it all the way! With the plugin features I've added to DarkScript it makes possible to bind virtually anything to the engine.

The integration between dbpro and DarkScript is tighter than any other plugin has been in the past. There is an interesting flip side to this fact, DarkScript is also completely seperate, and I plan on developing that side of it as well. For example, if you wanted to use DarkScript for a network game server you'll have that ability to create that as a stand alone executable, thus keeping you from worrying about the 100% cpu usage coming from a dbpro executable.

If you need further information, please feel free to ask.

Torrey
20
Years of Service
User Offline
Joined: 20th Aug 2004
Location: New Jersey

Login to post a reply

Server time is: 2024-11-17 07:15:11
Your offset time is: 2024-11-17 07:15:11