[SCRIPTING] SWITCH/CASE for DECORATE

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: [SCRIPTING] SWITCH/CASE for DECORATE

Re: [SCRIPTING] SWITCH/CASE for DECORATE

by Major Cooke » Fri Oct 07, 2016 5:54 pm

I see it now.

WFZS. Same ring and all.

Also if you need extensive testing at certain points, let us know. I'll happily jump aboard this ship.

Re: [SCRIPTING] SWITCH/CASE for DECORATE

by Graf Zahl » Fri Oct 07, 2016 5:38 pm

Who cares? This is ZDoom, so it has every right to call its scripting ZScript.

Doomscript is a no-go, that name is saddled with too much backstory.

Re: [SCRIPTING] SWITCH/CASE for DECORATE

by HavoX » Fri Oct 07, 2016 5:38 pm

Probably not. I guess it's just me... :shrug:

@Graf: Fair enough.

Re: [SCRIPTING] SWITCH/CASE for DECORATE

by Gez » Fri Oct 07, 2016 5:37 pm

Does it matter if the name is taken by a different game? Are there any real risk of confusion between Zelda Classic and ZDoom?

Re: [SCRIPTING] SWITCH/CASE for DECORATE

by HavoX » Fri Oct 07, 2016 5:33 pm

I thought I said this before:

ZScript's already taken.

Re: [SCRIPTING] SWITCH/CASE for DECORATE

by Graf Zahl » Fri Oct 07, 2016 4:48 pm

Don't get your hopes up. This is going to take time. I am currently trying to make constants.txt compile with the ZScript compiler and running into some problems already because at the moment DECORATE cannot access the constants defined within enums. (Update: That works now, the original code wrote the symbols to a scratch symbol table that was discarded right away.)

It is very clear that so far the compiler has only been tested in a sandbox so expect problems to surface now that it is getting real-life script code that needs to work in the existing framework of things thrown at it for the first time. Right now I have no plans to work on actual code generation, the first thing to be done is to let it parse Actor's class definition so that the basic framework is there. That alone will be quite a bit of work.

Re: [SCRIPTING] SWITCH/CASE for DECORATE

by Major Cooke » Fri Oct 07, 2016 2:16 pm

Ah, from randi I presume? Well, still, at least we're starting up again.

Something tells me that if it should come, it'll be ZDoom 3.0 I reckon. I mean, what a perfect number for a release candidate introducing doomscript.

(Let fate smile on us for ZDoom 3.0 to be before Doom's 30th birthday...)

Re: [SCRIPTING] SWITCH/CASE for DECORATE

by Graf Zahl » Fri Oct 07, 2016 12:42 am

It still will take a lot of time. I just started analyzing the compiler code, now that I finally have some code to play around with.

Re: [SCRIPTING] SWITCH/CASE for DECORATE

by Major Cooke » Thu Oct 06, 2016 9:12 pm

Graf Zahl wrote:Sorry, but this won't see any further extensions, we'd rather focus on making the real scripting language work now.
Finally! I'm looking forward to this.

Re: [SCRIPTING] SWITCH/CASE for DECORATE

by Mikk- » Thu Oct 06, 2016 2:07 pm

Okay that's fine! I look forward to that in the future!

Re: [SCRIPTING] SWITCH/CASE for DECORATE

by Graf Zahl » Thu Oct 06, 2016 2:02 pm

Sorry, but this won't see any further extensions, we'd rather focus on making the real scripting language work now.

[SCRIPTING] SWITCH/CASE for DECORATE

by Mikk- » Thu Oct 06, 2016 1:42 pm

I think it would be neat if we could use Switch/Case inside Anonymous Functions

For example: (a very simple and silly pseudocode)

Code: Select all

ACTOR THING 
    {
    CONST INT SOME_CONSTANT = 3;
    {
    STATES
        {
        SPAWN:
            TNT1 A 0 NODELAY
            { 
            SWITCH(CALLACS("SOME_SCRIPT"))
                {
                CASE 1:
                    { A_PRINT("CATS ARE FUN"); }

                CASE 2:
                    { A_SPAWNITEMEX("DOOMIMP",RANDOM(-32,32),RANDOM(-32,32)); }

                CASE SOME_CONSTANT:
                    { A_LOGINT(USER_VARIABLE1); }

                [...]
                }
            }
        }
    } 
Would such a request be feasable? I think it would be a lot cleaner than a lot of If() statements. It's not the end of the world if this isn't doable, however it would be nice.

Top