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.

DarkBASIC Discussion / Scripting Hypothesis

Author
Message
epicgamer
11
Years of Service
User Offline
Joined: 11th Nov 2012
Location: Unknown
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 22nd Feb 2013 16:47
DB is not object-oriented so your scripting syntax will be very difficult, if not impossible, to convert.

epicgamer
11
Years of Service
User Offline
Joined: 11th Nov 2012
Location: Unknown
Posted: 22nd Feb 2013 18:00 Edited at: 22nd Feb 2013 18:29
Quote: "very difficult, if not impossible, to convert."


.:"
::.
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 22nd Feb 2013 18:32
Hmm, not sure about the structure you've chosen to use, but whatever.

TheComet

http://blankflankstudios.tumblr.com/
"You're all wrong. You're all idiots." - Fluffy Rabbit
"Bottom line, people are retarded." - Fluffy Rabbit
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 22nd Feb 2013 19:02 Edited at: 22nd Feb 2013 19:03
@epicgamer
I don't know what that was supposed to demonstrate but it was pretty cool. You make some interesting stuff.
If those shapes represent files how do you know what they are?

Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 22nd Feb 2013 20:36
Quote: "DB is not object-oriented so your scripting syntax will be very difficult, if not impossible, to convert."


Why would you say that? The script could be running within the the 3d editor itself - specific to the program. Another option is to run the scripting program in a dll, use the console window for interaction, transfer relative data back to DB through pointers and variables. On the return from a function call, the objects conditions are updated within DBC.

Enjoy your day.
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 22nd Feb 2013 20:56
@Latch
You'd have to write a conversion for every single event, I don't see why anyone would do this in DBC when DBC is not designed this way.

Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 22nd Feb 2013 21:57 Edited at: 22nd Feb 2013 22:03
Maybe, maybe not.

DBC is designed in a manner to manage scripting if you look at the CLI as a interface to run small blocks of code outside of the main program. If one has the imagination and perseverence, they can accomplish what they need.

Heck, there might even be a way to access the CLI in a compiled program. In fact, if you could find the entry point of the code in a compiled EXE, you could in theory change that code.

Enjoy your day.
epicgamer
11
Years of Service
User Offline
Joined: 11th Nov 2012
Location: Unknown
Posted: 23rd Feb 2013 05:15 Edited at: 23rd Feb 2013 05:18
Quote: "If those shapes represent files how do you know what they are?"


Current selection is current folders files. Each block represents a file or folder on your computer. Current selection data and action requests are sent to files for access from other applications.

Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 24th Feb 2013 11:17
Quote: "DBC is designed in a manner to manage scripting if you look at the CLI as an interface to run small blocks of code outside of the main program."

Yes, that is one interesting thing DBC has over DBP, but I don't think this syntax works well with DBC: it will need a lot of conversion. A dll is a possibility.


Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 24th Feb 2013 19:30
@epicgamer

Do you already have scripting in place? Or are you proposing how it might be done?

Enjoy your day.
epicgamer
11
Years of Service
User Offline
Joined: 11th Nov 2012
Location: Unknown
Posted: 24th Feb 2013 21:51
Quote: "proposing how it might be done"


BN2 Productions
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 24th Feb 2013 23:23
My thoughts on the idea:
I imagine that parsing the command wouldn't be the difficult part (I've been able to pull that kind of thing off before). The difficult would be storing the data.

Let's assume every object can have x number of commands assigned to it. My gut reaction would be that that requires an array like this:

dim commands(65535,X)

But that means you will waste commands on control structures (Like while/wend). So perhaps you could split the X into Y and Z subsections such that X=Y*Z, making an array like so:

dim commands(65535,Y,Z)

Then use the first area as a means of getting start and finish conditions.

However, this would only work for loop structures with constant beginning and ending criteria (DO/LOOP, FOR/NEXT) and NOT ones in which the user can specify a condition to check (REPEAT/UNTIL, WHILE/ENDWHILE). You could work around this, but then you have to do a few things:

1) All variables MUST be part of an ARRAY (thus it will store the index number to check).

2) Parsing it out would then store the index number of the variable to check, the operation code, and the number to check against (this could be a discrete value or another variable index).

Such that the code would be something like

IF variable(varA) operation varB THEN...

Where the operation codes would be something like:
1.==
2.!=
3.<
4.>
5.<=
6.>=
7.=i (equals integer)
8.!=i (notEqual Integer)
9.<i (less than integer)
10.>i (and so on...)
11.<=i
12.>=i

Where all operation codes of 7+ use the second value as a value, rather than a variable index.

Just my thoughts. Don't know if you were soliciting ideas.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
epicgamer
11
Years of Service
User Offline
Joined: 11th Nov 2012
Location: Unknown
Posted: 24th Feb 2013 23:53
Parsing the script and making it work is not a problem.

Is it worth it to create a scripting language, or should it be point and click (select) actions?

Login to post a reply

Server time is: 2024-04-23 06:29:26
Your offset time is: 2024-04-23 06:29:26