Jump to content

Photo

command editor dialog for all script types


  • Please log in to reply
8 replies to this topic

#1 Shadowblitz16

Shadowblitz16

    Illustrious

  • Members

Posted 24 October 2019 - 11:35 PM

what do you guys thing of a command editor?

basically it would be a dialog you can open when your in the script gui which would be a list of commands you can execute for objects

these commands would compile directly into zscript and we could even make our own by adding zscript command templates

 

basically it would be a option for people that don't want to get into zscript or just don't have time to and want to write a quick coroutine for a zobject.

 

an example would be something like..

- move enemy to link
- wait for 2 seconds 
- play animation     
- wait for animation to end -
- move enemy to random location
- player animation

these would run in loops as long as the enemy exists based on the time from when they were created.



#2 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 25 October 2019 - 12:26 AM

what do you guys thing of a command editor?

basically it would be a dialog you can open when your in the script gui which would be a list of commands you can execute for objects

these commands would compile directly into zscript and we could even make our own by adding zscript command templates

 

basically it would be a option for people that don't want to get into zscript or just don't have time to and want to write a quick coroutine for a zobject.

 

an example would be something like..

- move enemy to link
- wait for 2 seconds 
- play animation     
- wait for animation to end -
- move enemy to random location
- player animation

these would run in loops as long as the enemy exists based on the time from when they were created.

So basically a gui for writing scripts. This would be total ass to even begin to implement in a way that works.



#3 Saffith

Saffith

    IPv7 user

  • Members

Posted 25 October 2019 - 12:47 AM

The biggest issue with that sort of thing is that it's imprecise. For instance, what does "move enemy to link" actually mean? Move it directly on top of Link? In from of him? Anywhere random point 32 pixels? And how does it move? Does it walk, avoiding obstacles? Fly in a straight line? Teleport?

You can probably come up with answers that work for the particular script you have in mind, but making such a feature useful would require being able to control things like that. That's going to require some specific syntax and a lot of extremely precise directions. And that basically leads you to a whole new scripting language with all the complexity of ZScript. It would look closer to English, but that really just makes it harder because it's more irregular and more verbose.

Learning ZScript may not be easy, but there are reasons it is the way it is.
  • ShadowTiger and Emily like this

#4 ShadowTiger

ShadowTiger

    The Doctor Is In

  • Members

Posted 25 October 2019 - 04:20 AM

Heh.  It's a really great concept in ... ... um ... concept.  I can understand why people would like such a thing.  I remember Starcraft 1 having a similar kind of Trigger-based scripting system.  It used words, clickable links, and pulldowns to guide the user through making a trigger.  It was pretty neat as a concept. 

 

I came into this thread with similar notions to those mentioned in the above two posts though.  There are some things that words just can't handle when math does it with so incredibly much more precision. 

 

This isn't so much that a dream is being shattered here - It's just evolving into the rationality of a more precise and worthwhile system to learn.  Besides, it's good mental exercise to learn ZScript! :D



#5 klop422

klop422

    Guess I'm full of monsters and treasure

  • Members
  • Real Name:Not George
  • Location:Planet Earth

Posted 25 October 2019 - 05:52 AM

Anyone remember Scratch? As fun as it is, it's kind of clear what the issues are with an approach like this.


  • ShadowTiger likes this

#6 Shadowblitz16

Shadowblitz16

    Illustrious

  • Members

Posted 26 October 2019 - 04:52 PM

well it would a combobox with textboxes for parameter inputs not words
 
but ya the idea was to make each command basically be unfinished scripts snippets and compile them before use...
 
//Set Condition

(if, if else, else) 
{

//End Condition

}

but it was poorly thought out...
//Set Loop

(while, for) 
{

//End Condition //works not good

}

//End Loop //same thing and should be used

}

EDIT:

so what about a official built in code editor with docs, highlighting, code folding and intellisense?

that might be even better


Edited by Shadowblitz16, 26 October 2019 - 05:17 PM.


#7 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 27 October 2019 - 02:16 AM

so what about a official built in code editor with docs, highlighting, code folding and intellisense?

that might be even better

It's called "Use Notepad++"



#8 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 27 October 2019 - 06:04 AM

You mean, this?

That system can be applied to cover all ZS commands, and given a more robust syntax. See also: ZBasic

You enter commands for these in ZC Player, and can execute them as scripts, and even save them. I created them for the purpose of general quest debugging, and for personal amusement.

ZB needs an overhaul and completion. ZShell, just needs a bit of minor cleanup. I was forced to do things to circumvent 2.54 Parser bugs that I can now make cleaner.

Something like Lua though, in ZQ, is not on the table. You could make a header for simple actions if you want.

Perhaps one day we can turn the parser into its own module and link it into SciTE, so that SciTE can invoke it.

FWIW, I added a bunch of Pascal-like syntax to ZScript. I've considered adding begin and end tokens, too.

This is perfectly legal, IIRC:
 
if ( (not (a is_greater b) and b is_less c) or (a<>d) ) function();
I didn't see a good way to add the Pascal 'then' token, or rather, I didn't see a good way to replace the requirement for a left paren in a stmt, as I could easily add 'then' for the right paren.

(Pascal uses 'begin if', which would need to replace both if and the left paren.)

I could however, add begin and end as alts for curly braces:
 
if ( (not (a is_greater b) and b is_less c) or (a<>d) )
begin
    a := 16;
    function(a);
end; //or end

Unfortunately there's no good way to allow 'procedure' style syntax in addition to that. It just provides the user with some choices for tokens.

C++ already offers alt tokens, so I decided to allow those, and I included a few from Pascal in the process. Likewise, Pascal-style case isn't an option.

Anyway, it's perfectly possible to make your own interpreters on top of ZScript. Just don't expect them to be fast, and remember that you don't have vectors to use.

#9 Shadowblitz16

Shadowblitz16

    Illustrious

  • Members

Posted 27 October 2019 - 02:01 PM

@Venrob notepad++ requires a language pack to use zscript and it doesn't offer intellisense or docs.

also the language pack would have to be updated for every zc version.

 

if we had a dedicated code editor inside zq it could be binded to the zscript.

 

@ZoriaRPG the idea of the commands was they were that they were gui based zscript snippets.

basically a visual scripting inside zq. 




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users