DracScript Preview! (Now released, check announcements)

Everything else that doesn't fall into one of the other PB categories.
dracflamloc
Addict
Addict
Posts: 1648
Joined: Mon Sep 20, 2004 3:52 pm
Contact:

DracScript Preview! (Now released, check announcements)

Post by dracflamloc »

[edit]
See here for the full release: http://www.purebasic.fr/english/viewtopic.php?t=20312
[/edit]


Hey you don't need to report errors you get with this. Its just a test build to give you guys a little taste of what will soon be public domain for all to enjoy!

Read the readme.txt!


Let me know what you think! Obviously speed improvements are on the way. But its pretty quick so far.

Currently it runs in pb 3.94, and should be real easy to use in pb 4.0 once I've released the code.
Last edited by dracflamloc on Fri Mar 10, 2006 7:39 pm, edited 1 time in total.
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

sweeeeet

Post by Shannara »

This is niiice ...

In future releases, is it possible to cal PB functions directly? Are they exposed to the engine? How about Structures? Those are a few things missing in other PB based scripting languages that I have seen on these forums so far ... what about the ability to read/write to pb linklists or arrays? Im curious as to how far this has one ..

If it made it that far, then it is definately a contender to VBScript :)
dracflamloc
Addict
Addict
Posts: 1648
Joined: Mon Sep 20, 2004 3:52 pm
Contact:

Post by dracflamloc »

PB has no reflection so its not possible to call pb functions directly but it would be very simple to make those functions available to the scripting engine. There is a command:

DS_RegisterCommand(@Proc(),commandname.s,numParams.l)

This will allow any pb procedures to be commands in the scripting language that you like. The default functions like Mod, Mid, etc, are actually optional and can be stripped out to make the engine even more lightweight if needed.

No structures yet. Not sure if ever, but since its open source maybe someone will add it. The key is for this language to be light and quick and easy to implement into a project. Its possible though for a command to be created using the above DS_ procedure that passes addresses to pointers and such.

So in the script you could do:
SetPlayerX(playerStruct,10)

playerStruct could be set as a constant or set as a variable during the script.

In PB the Procedure could look like:

Code: Select all

Procedure SetPlayerX(*playerAddr.PLAYER_STRUCT,newx.l)
DS_RegisterCommand(@SetPlayerX(),"SetPlayerX",2)
Last edited by dracflamloc on Tue Mar 07, 2006 8:08 pm, edited 1 time in total.
Killswitch
Enthusiast
Enthusiast
Posts: 731
Joined: Wed Apr 21, 2004 7:12 pm

Post by Killswitch »

Looks great - but no source?
~I see one problem with your reasoning: the fact is thats not a chicken~
dracflamloc
Addict
Addict
Posts: 1648
Joined: Mon Sep 20, 2004 3:52 pm
Contact:

Post by dracflamloc »

I'm not done with it yet =) Its just a preview
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post by Shannara »

Actually ... I was trying to compare this against the WSH for VBScript.. and with what you told me, basically neither have reflection, but both allows you to register functions in the script, which is awesome :) The only difference I can see now is that WSH allows classes/structures to be registered and passed back and forth the registered functions.

But that's ok if this doesnt provide that, because its fairly easy to wrap a structure or a linklist/array object around a registered function :) This is great news!

Another one is .. can you load multiple scripts at once? With the ability to reload individual scripts as warrented?

Sorry, one more question, I have to prod after having a taste :D

Can the engine load script files from memory, given a memory pointer and length? This would be helpful loading script files from packed files :)
dracflamloc
Addict
Addict
Posts: 1648
Joined: Mon Sep 20, 2004 3:52 pm
Contact:

Post by dracflamloc »

While right now it can't, It should be relatively simple to add that stuff. The first release will be one script at a time. You can load from the buffer probably by doing a peeks(*buffer,length) and passing it to the DS_LoadScriptString() procedure.
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post by Shannara »

Hmm, cool. cant wait for the release.
Post Reply