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 / POWERSOFT >>> Scripting System

Author
Message
PowerSoft
19
Years of Service
User Offline
Joined: 10th Oct 2004
Location: United Kingdom
Posted: 25th Oct 2004 23:01
Hello all.

A few months ago i started work on a scripting system, which, sadly died. Last Night however it was reborn. After

7hours 40minutes and help in trapping errors from BatVink, Lost in Thought and DarkCoder it compiled and worked.

So any questions/comments just post.

Regards
Rich,


(ps: creadit me when using this)


Create? Play? YOU Decide

Attachments

Login to view attachments
BearCDPOLD
20
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 26th Oct 2004 08:24
questions/comments:

Show us some tasty things , what is the scripting for?

Crazy Donut Productions, Current Project: Project Starbuks
Sony stole our name!
PowerSoft
19
Years of Service
User Offline
Joined: 10th Oct 2004
Location: United Kingdom
Posted: 26th Oct 2004 15:51
Well its for whatever you want to do with it.


It has support for variables


Create? Play? YOU Decide
Lynx
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location: IRC chat
Posted: 26th Oct 2004 16:16
Very nice .
How many commands does it support?

PowerSoft
19
Years of Service
User Offline
Joined: 10th Oct 2004
Location: United Kingdom
Posted: 26th Oct 2004 16:31
thanks for your comments.

I tryied to include as much info as possible to let you do this:

There is an array (SP_COMMANDS.DBA File)

That contains the infomation about the commands. You need to add an entry to this to tell the engine that the command exists.

So in the example ths would be

command_list$(2)="TIMER"

this registers the command but to register the actions it performs in the function ExecuteCommand( command_string$ as string)

you specify this.

case 2
time=val(parameter$(1))
wait time
endcase

What happens is because the function SearchCommand() returns the position in the array the command lies you just need to do a select case for it because it only takes one parameter (you can add more) it has parameter$(1) if there was two or more it would look like this.

parameter$(1)
parameter$(2)


which in the script file would be

command=parameter$(1),parameter$(2)


Create? Play? YOU Decide
PowerSoft
19
Years of Service
User Offline
Joined: 10th Oct 2004
Location: United Kingdom
Posted: 27th Oct 2004 00:15
Ive added some new commands for your viewing pleasure

Added: PAUSE and QUIT_PROGRAM command




Please can i have some more comments? I feel as if no one wants it


Create? Play? YOU Decide

Attachments

Login to view attachments
Hamish McHaggis
21
Years of Service
User Offline
Joined: 13th Dec 2002
Location: Modgnik Detinu
Posted: 27th Oct 2004 02:51
Cool. Seems to be working, but it only seems to be able to execute one command.

Isn't it? Wasn't it? Marvellous!
PowerSoft
19
Years of Service
User Offline
Joined: 10th Oct 2004
Location: United Kingdom
Posted: 27th Oct 2004 02:54 Edited at: 27th Oct 2004 02:56
Thanks for that Hamish, someone is checkng it i see


That is a strange problem ill get looking at the problem



[edit]
ok i have deduced a few things the problem does not lie with the reading of the command or the splitting of the command and parameter. . . i have no clue at this time the problem but i suspect i could have made a variable and i didnt need to. . .

If any one finds the solution could they please enlighten me then i can make a seriously cool demo program that will amaze you all

(and everyone gets free pie)


Create? Play? YOU Decide
PowerSoft
19
Years of Service
User Offline
Joined: 10th Oct 2004
Location: United Kingdom
Posted: 27th Oct 2004 04:07
UPDATE:: After much time spent i have it working. It seemed to be cause by another bug because it wasnt clearing the parameter storage array. . .

So that resulted in two bug fixes....


::LATEST DOWNLOAD::


Create? Play? YOU Decide

Attachments

Login to view attachments
PowerSoft
19
Years of Service
User Offline
Joined: 10th Oct 2004
Location: United Kingdom
Posted: 27th Oct 2004 04:36
Another update. Whats happened now is i have considered that not everyone wants to split there commands with an = or the paramters with , so now you can change it to whatever you want

To do this just change the value supplied in the call to the functions

SplitLine(whole_line$,"=",1)
and
SplitParameter(parameter_block$,",")


Create? Play? YOU Decide
PowerSoft
19
Years of Service
User Offline
Joined: 10th Oct 2004
Location: United Kingdom
Posted: 27th Oct 2004 04:37
damn forgot download


Create? Play? YOU Decide

Attachments

Login to view attachments
Ian T
22
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Around
Posted: 28th Oct 2004 00:50
Very good scripting system , should be a good tool and/or example for people interested in making their own RPGs, FPSs, etc.


Here we go again!
Whaddaya mean there's no such data type as a flaot?[/i]
PowerSoft
19
Years of Service
User Offline
Joined: 10th Oct 2004
Location: United Kingdom
Posted: 28th Oct 2004 03:56
ok. This thread needs sorting out.

This post will explain about the project.


This ScriptingProgram is built to allow you to create scripts for your game. It can be used in ANY game as it is so flexible. An example of this is:

In my examples i split command with parameters with a = and the parameter with , If you dont like this YOU can choose what its split up with.

I have provided a few commands to be used, but because it is so flexible you can code EXACTLY what commands there are. Its as simple as:

Adding the name of the command to the COMMAND_LIST$ array than add infomation on HOW the command works.

Another key feature of the engine is the support for variables. It at the moment supports 4 type of variables.
Integers
Floats
Strings
Handles

Handles is for when you create a gadget using BlueGUI 2, at the moment i cant release the version to support that but it will be released shortly.

If you have any questions just post and ask. i dont bite and i will help anyone who wants to know it at basics right the way to the nitty gritty logical workings behind it.

To summarise this Scripting Engine as it stands has FULL support over creation of variables and usage in your commands.

Enjoy

Rich.




Create? Play? YOU Decide

Attachments

Login to view attachments
Mnemonix
21
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: Skaro
Posted: 29th Oct 2004 05:42
When my first show is broadcast, you can all listen in to Powersoft`s report on the PSE(Powersoft scripting engine). I just heard it for the first time and it sounds great.

The 3d chat is coming...
Rights For Traffic Cones!
PowerSoft
19
Years of Service
User Offline
Joined: 10th Oct 2004
Location: United Kingdom
Posted: 29th Oct 2004 05:44
Thanks alot. I didnt know i was that good


Create? Play? YOU Decide
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 29th Oct 2004 06:30
I'm sending you the email regarding our discussion on MSN, it's about 5.10mb in size so I hope your email client supports this size.

Paul.


Home of the Cartography Shop - DarkBASIC Professional map importer
1tg46
20
Years of Service
User Offline
Joined: 1st Feb 2004
Location: I dont know!
Posted: 30th Oct 2004 01:22 Edited at: 30th Oct 2004 04:08
Great program, would you mind if I could use this in DarkBASIC Network IDE? It could be very useful .I just might add the DBN header to the file and say that you created this piece of code.


Click the sig
PowerSoft
19
Years of Service
User Offline
Joined: 10th Oct 2004
Location: United Kingdom
Posted: 30th Oct 2004 17:01
If you let me no what you want to use it for and how it will be useful to you i will sort it all out for you


Create? Play? YOU Decide
1tg46
20
Years of Service
User Offline
Joined: 1st Feb 2004
Location: I dont know!
Posted: 30th Oct 2004 22:20
Well it just seems like some of the functions may be useful, right now I can't tell you exactly how they will be useful because I am working on a different part of the program right now, but some of the functions could be useful. And I am just saying that it could be useful at first glance, I haven't really looked at it extremely close, I have just browsed the basic commands and basic principles. And at first glance it could be useful, I may decide their are other ways that I would like to do stuff rather with the commands.


If I can remember (so early in the morning ) the commands that really caught my eye, were the commands about files and splitting them in arrays, and that sort of stuff.


Click the sig
PowerSoft
19
Years of Service
User Offline
Joined: 10th Oct 2004
Location: United Kingdom
Posted: 4th Nov 2004 03:23
hi people, on my quest to better this program i decided an IDE might be a good idea or a improved method of running scripts, (perhaps resulting in a interperated language!) so would anyone be interested in this?


Create? Play? YOU Decide
1tg46
20
Years of Service
User Offline
Joined: 1st Feb 2004
Location: I dont know!
Posted: 4th Nov 2004 05:39
*cough* DarkBASIC Network *cough*


Click the sig
Mr Underhill
21
Years of Service
User Offline
Joined: 23rd Apr 2003
Location: The Forgotten Worlds...
Posted: 19th Nov 2004 04:10
@Powersoft: Have you ever thought about making a compiler for this scripting language? Y'know, all that text handling has got to be a pain on the host program. If you had a compiler change the commands into numbers (ex. Print "Hello World" would become 1,"Hello World"), that could speed things up a little (since computers handle numbers faster than letters).

Quote: "A kilobyte is 1024 bytes, not 1028.
I mean.... not.. that i.... new that already.... i figured... maybe... CRUD! IM A NERD! -Ion Stream"
PowerSoft
19
Years of Service
User Offline
Joined: 10th Oct 2004
Location: United Kingdom
Posted: 19th Nov 2004 15:33
Thanks for th comments, i have been toying with that idea but at the moment im working on an ide. if i decide to you'll be the first to know


Create? Play? YOU Decide
Maleck
20
Years of Service
User Offline
Joined: 12th May 2004
Location: US
Posted: 25th Nov 2004 05:24
This looks interesting. I have been searching for a scripting system to use in my programs to allow MOD-ability, and this may do it. I have just downloaded it and maybe I cna take a look over the weekend in more detail.
PowerSoft
19
Years of Service
User Offline
Joined: 10th Oct 2004
Location: United Kingdom
Posted: 26th Nov 2004 00:20
Yes you can thats the great thing about the engine, its flexible.

Im currently using it in my game


Create? Play? YOU Decide
PowerSoft
19
Years of Service
User Offline
Joined: 10th Oct 2004
Location: United Kingdom
Posted: 24th Dec 2004 23:41
Hello,

Just thought id let you know that version 3 is currently being written and imho i think it will be as fast as anything

Liberty: Fight for Freedom
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 25th Dec 2004 00:04
Cool

I'm trying to write a LUA wrapper for DBPro at the moment - if I have any success I'll send it to you.

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
PowerSoft
19
Years of Service
User Offline
Joined: 10th Oct 2004
Location: United Kingdom
Posted: 25th Dec 2004 00:08
cheers,

still trying to work out bloody if statements and loops and expression parsing.

Liberty: Fight for Freedom
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 25th Dec 2004 01:03 Edited at: 25th Dec 2004 01:06
Heh - here's the code I wrote for you on labels.



I always find it easiest to think of interpreting a program in these stages:

- FIRST PASS - Scan the code for any control constructs, for example IFs, Loops etc and convert these to labels and gotos.

- SECOND PASS - Scan the new code for any label declarations and make a lookup table of all label names and their positions

- FINAL PASS - Go through code from top to bottom executing each statement. The only dynamic things you have to worry about are labels really - all the IFs, WHILEs, REPEAT UNTILs etc. have disappeared

Here's how I converted some contructs in my own language:



became





became



All quite simple really

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
PowerSoft
19
Years of Service
User Offline
Joined: 10th Oct 2004
Location: United Kingdom
Posted: 25th Dec 2004 01:51
cheers

Liberty: Fight for Freedom
1tg46
20
Years of Service
User Offline
Joined: 1st Feb 2004
Location: I dont know!
Posted: 27th Dec 2004 00:22
*cough* DarkBASIC Network *cough* their is an update if you are still interested.


Click the sig
Random 69
20
Years of Service
User Offline
Joined: 24th Aug 2004
Location: Marshmellowland
Posted: 8th Jan 2005 05:52
that is so amazing im trying to make a langauge of my own but im off to a horrible horrible start could you make a tutorial

Happy joy happy happy
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 8th Jan 2005 05:55
There's one on my site, see the programming talk forum or click below

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
Random 69
20
Years of Service
User Offline
Joined: 24th Aug 2004
Location: Marshmellowland
Posted: 10th Jan 2005 03:01
thats in c++ not basic ... and you called yourself a mod

FOR SHAME

I made a extra security function for windows Ask me for it.

I can disable ctrl alt delete windows key and alt dab Ask me for dll and code 5 lines of code and dll
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 10th Jan 2005 07:10
Quote: "thats in c++ not basic ... and you called yourself a mod

FOR SHAME"


The tutorial's in Visual Basic. How much more basic could you want?

I do call myself a mod too

Powersoft - I just wrote an expression evaluator today - I'll talk to you about it next time you're on msn.

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
PowerSoft
19
Years of Service
User Offline
Joined: 10th Oct 2004
Location: United Kingdom
Posted: 15th Jan 2005 16:52
Hello David,

Not been around for about 3weeks!!! But im going to get back into it about....NOW


@Forum: Hello, im back

Liberty: Fight for Freedom
PowerSoft
19
Years of Service
User Offline
Joined: 10th Oct 2004
Location: United Kingdom
Posted: 27th Jan 2005 02:39
Well I lied, im back now...... hopefully.

David, im waiting for the invite

Liberty: Fight for Freedom
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 27th Jan 2005 02:42
Ask me yourself

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
Ereon
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Location: The Realm of Ithia
Posted: 16th Feb 2005 10:53
Ok, this is all exciting, and I need a scripting engine. So.....wheres the download. PLEASE tell me that it isn't gone. If someone can help me out, I'd be very grateful.

Dream big, plan hard, close your eyes, jump, and pray like crazy.
Pyre
21
Years of Service
User Offline
Joined: 22nd Dec 2002
Location: France
Posted: 16th Feb 2005 14:51 Edited at: 16th Feb 2005 15:02
A new upgrade using David's code would be great !! Waiting for the upgrade....

And also : I think (but that's only my opinion) that the commands and the variables should be case sensitive. So that POSX and posx wouldn't be the same variable... and the same thing for the commands... Codes would be more clear... Good code anyway, I might use it for the developpement of AI in my RTS game...

Bye

Pyre

---------------------
Souillard powwaaa : Who will move the fruit juice, and the fruit mousse too, through the food cooler, to improve them soon, and not to loose them in June !! Crazy lessons....
PowerSoft
19
Years of Service
User Offline
Joined: 10th Oct 2004
Location: United Kingdom
Posted: 19th Feb 2005 00:46 Edited at: 19th Feb 2005 00:54
Hey all.

The new download? Im working on it. I have been in Pantomime all this week so not had alot of free time but it will come.

@Pyre+Ereon if you email me with any features you want to see or any problems your having i will most gladly help.



Regards,
Rich


[EDIT]
Just realised that i had started v3 of the engine and i must say im pleasantly surprised by what i had done. If my judgement serves me correctly it appears that the variable system should be faster and the ability to convert variables should work... .eg val(), str$() etc.

Liberty: Fight for Freedom
Pyre
21
Years of Service
User Offline
Joined: 22nd Dec 2002
Location: France
Posted: 19th Feb 2005 01:53
Right now I have no idea for new features... Just waiting to see your surprises lol...

---------------------
Souillard powwaaa : Who will move the fruit juice, and the fruit mousse too, through the food cooler, to improve them soon, and not to loose them in June !! Crazy lessons....
1tg46
20
Years of Service
User Offline
Joined: 1st Feb 2004
Location: I dont know!
Posted: 19th Feb 2005 04:41
@Powersoft their is another VB update of DarkBASIC Network IDE if you are still interested. Or their are also four options stated in that thread regarding if you want to stay in the team or not.


Click sig for DB Network X
PowerSoft
19
Years of Service
User Offline
Joined: 10th Oct 2004
Location: United Kingdom
Posted: 19th Feb 2005 16:45
i dont believe it would be fair for me to take credit for the little i have produced and shown. I will help where i can but dont deserve crediting....

Regards,
Rich

Liberty: Fight for Freedom
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 19th Feb 2005 17:23
Got you booleans and expressions done?

i.e.

IF (val1+val3*val2) > 8 OR 6<7
{code}
ELSE
{code}
ENDIF

it's surprisingly easy. Just need to convert (1+3*2) > 8 OR 6<7 into reverse polish notation:

1, 3, 2, *, +, 8, >, 6, 7, <, OR

that is using a precedence like this:

lowest
- booleans (AND, OR, NOT)
- comparisons (<, >, =)
- addition + subtraction
- multiplication + division
- exponentials
highest

Once you've got it converted into RPN (ask me on MSN how), it's easy to evaluate. Go through each token in turn.
-If it's a number, push it to the stack.
-If it's an mathematical operator pop two numbers, perform it, and push the result to the stack.
-If it's a comparison, pop two numbers, compare, and push the boolean result to a different stack (I call it the boolstack)
-If it's a boolean op, pop two bools from the boolstack, perform, and push the result.

The resulting value on the boolstack indicates if the expression is true or false.


Using this example:

1, 3, 2, *, +, 8, >, 6, 7, <, OR

1) token in: 1. Treat as number, push.

STACK: 1
BOOLSTACK: {empty}

2) token in: "3". Same:

STACK: 3, 1
BOOLSTACK: {empty}

3) token in: "2".

STACK: 2, 3, 1
BOOLSTACK: {empty}

4) token in: *. Pop two, multiply, and return to stack.

POP 2 & 3, multipled is 6.

STACK: 6, 1
BOOLSTACK: {empty}

5) token in: +. Pop two, add, push.

POP 6 & 1, added is 7.

STACK: 7
BOOLSTACK: {empty}

6) token in: 8. Push:

STACK: 8, 7
BOOLSTACK: {empty}

7) Token in >. Pop top two, see if second val popped is bigger than first (second val popped was the first in)

7 is not > 8, so push "FALSE"

STACK: {empty}
BOOLSTACK: FALSE

8) token: 6

STACK: 6
BOOLSTACK: FALSE

9) token: 7

STACK: 7, 6
BOOLSTACK: FALSE

10) token: <. Pop two, compare, push result to boolstack.

6 is smaller than 7, push "TRUE".

STACK: {empty}
BOOLSTACK: TRUE, FALSE

11) token "OR". Pop two bools, perform operation nad push a bool.

TRUE and FALSE, when put through an OR, returns TRUE. Push TRUE.

Stack: {empty}
BOOLSTACK: TRUE

That's it, we're left with "TRUE" on the boolstack hence the condition wwas true.

Easy. When you get the hang of it

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
PowerSoft
19
Years of Service
User Offline
Joined: 10th Oct 2004
Location: United Kingdom
Posted: 19th Feb 2005 19:34
in a word. NO



Ill talk on msn


regards,
Rich

Liberty: Fight for Freedom
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 20th Feb 2005 03:37
It's very easy

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
PowerSoft
19
Years of Service
User Offline
Joined: 10th Oct 2004
Location: United Kingdom
Posted: 20th Feb 2005 17:40
i might have to ask you on MSN if thats ok?

Liberty: Fight for Freedom
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 20th Feb 2005 21:31
Fine by me

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
PowerSoft
19
Years of Service
User Offline
Joined: 10th Oct 2004
Location: United Kingdom
Posted: 22nd Feb 2005 01:37 Edited at: 25th Feb 2005 05:18
Cheers David. Im understanding RPN extremly well with your helps and those links. Ive found some pseudo code to help me with the RPN coding function (no brackets version)

So ill post it for anyone else



Powersoft Scripting Language under redevelopment!

Login to post a reply

Server time is: 2024-09-29 12:25:09
Your offset time is: 2024-09-29 12:25:09