ZZT editor improvements

Discuss how totally awesome Bang! is here.

Moderator: Terryn

User avatar
Mooseka
;-*
Posts: 282
Joined: Mon Sep 22, 2003 5:01 pm

ZZT editor improvements

Post by Mooseka »

01:07:02 <Mooseka> I'M GOING TO LEARN C++ AND MAKE A BETTER ZZT EDITOR THAT CONFORMS TO MY STANDARDS.
01:07:31 <Jou> GOOD LUCK.
01:07:39 <Mooseka> IT'S NOT LIKE I'LL ACTUALLY DO IT
01:07:46 <Mooseka> BUT I WILL POST ON THE FORUMS AND BITCH ABOUT WANTING IT!

Yeah. If you haven't guessed what this post is about by now you're probably atleast mildly-retarded. I do enjoy the current editors that are out, but if anyone would like to take, OH, ZZTAE and make some improvements I'd be happy. IMPROVEMENTS I CAN THINK OF INCLUDE:

Ability to change the color of the object without having to delete it.

Ability to do things like Quill and Ibag internally, scrolling text and making inventory systems, and such. Kind of like an object library with a GUI.

Programming shortcuts. For example, being able to type uhh..like.. #find east and having the object go east until it hits a wall. I understand that's a bad example, but I'm late. It wouldn't actually be changing the code that goes into the game, just replacing it in the editor...OK THAT SOUNDED RETARDED TOO. Basically if you were to open it in any other editor it will be the NON-COMPRESSED version of the code, but in the editor you wrote it in you would just see #find east. For those of you who know mIRC scripting I'll explain it like this. It would be like an alias..

'//msg $chan $ip' for example isn't sending the channel $ip, it's sending the IP your computer is broadcasting. It is a shortcut. These can be set in IRC like so

alias agh msg $chan lol wot

then you would type

"//say $agh" and it would show "lol wot" to the channel. IS ANYONE FOLLOWING ME HERE? ...Engh, I'll work on this later when I'm less tired.
Image
User avatar
Dr. Dos
OH YES! USE VINE WHIP! &lt;3
Posts: 1772
Joined: Tue Mar 11, 2003 12:00 am
Location: Washington

Post by Dr. Dos »

What...

MOOSE I CAN HELP YOU WITH THE FIRST ONE IN ZZTAE. MR. WHITE OBJECT WANTS TO BE MR. BLUE OBJECT SO...

Put Mr. White object in the patterns box.
Keep the patterns cursor over Mr. White.
Pick a new color as you normally would.
Visit the Museum of ZZT
Follow Worlds of ZZT on Twitter

Apologies for the old post you may have just read.
21
What can be said now?
Posts: 0
Joined: Mon Oct 13, 2003 6:07 pm

Post by 21 »

Pretty much every time that features for a new editor are discussed, the idea of having shortcut commands comes up. Thing is, we've never really found a way to get the expanded command back into the shortcut version. As for modifying ZZTAE: Got Source?
User avatar
Mooseka
;-*
Posts: 282
Joined: Mon Sep 22, 2003 5:01 pm

Post by Mooseka »

I'M SURE CYQ DOES!
Image
20
What can be said now?
Posts: 0
Joined: Sat Mar 15, 2003 11:20 am

Post by 20 »

uh.. uh.. it was lost in a terrible hard drive crash

but seriously, you should all go use kevedit. though development on that seems to have slowed down a bit again now that i've stopped working on zztae.
User avatar
Mooseka
;-*
Posts: 282
Joined: Mon Sep 22, 2003 5:01 pm

Post by Mooseka »

kevedit is lame =( KEEP WORKING ON ZZTAE OR I'LL CUT YOU
Image
83
What can be said now?
Posts: 0
Joined: Mon Apr 07, 2003 3:18 pm

Post by 83 »

Mooseka wrote:kevedit is lame =( KEEP WORKING ON ZZTAE OR I'LL CUT YOU
...for once, i agree with you...
66
What can be said now?
Posts: 0
Joined: Fri Mar 14, 2003 8:20 pm

Post by 66 »

I prefer kevedit for these reasons:

1: you can change object colors LIKE MOOSE WANTS (try ALT+T)
2: you can move, copy and paste blocks of a board
3: you can easily change the stats of an object
4: you can show the stats order (which i find really necessary for some of my engines)
5: when I first tried ZZTAE IT WAS SOO SLOW AND UNRELIABLE I STILL HATE IT)
User avatar
Zenith Nadir
this is my hammer
Posts: 2767
Joined: Wed Mar 12, 2003 11:40 am
Location: between the black and white spiders

Post by Zenith Nadir »

you all use external editors because you're WEAK
he looked upon the world and saw it was still depraved :fvkk:

Overall: Rotton egg for breakfast
User avatar
TTTPPP
Latest band news: &quot;There are no news!&quot;
Posts: 108
Joined: Sat Oct 11, 2003 7:20 pm

Post by TTTPPP »

Couldn't you do shortcut commands by making the editor replace the shortcut command with a comment of the shortcut, and the full code?

In External Editor have:
[Shortcut Command]

In ZZT File have:
'SHORTCUT: [Shortcut Command]
[Full Command]
User avatar
Mooseka
;-*
Posts: 282
Joined: Mon Sep 22, 2003 5:01 pm

Post by Mooseka »

Zenith Nadir wrote:you all use external editors because you're WEAK
no u r
Image
105
What can be said now?
Posts: 0
Joined: Wed Oct 08, 2003 5:55 am

Post by 105 »

TTTPPP wrote:Couldn't you do shortcut commands by making the editor replace the shortcut command with a comment of the shortcut, and the full code?

In External Editor have:
[Shortcut Command]

In ZZT File have:
'SHORTCUT: [Shortcut Command]
[Full Command]
Yes, you certainly could. There are a few problems with this which would have to be dealt with, though:
  • When you open the file in the editor again, it should strip out the generated code to keep things transparent to the user. This means you need something at the end of the generated code to signal this.

    The user may want to manually edit the code after it is generated, so you need a way to regulate removing/regenerating this code. Either that or make the shortcuts so powerful that manually tweaking the generated code is unnecessary.

    The commented shortcut should not look like an actual comment that a user would have in their code or things will get mucked up.

    Finally, you are pretty much stuck with whatever editor offers these shortcuts, unless they are standardized (which I doubt will happen).
I asked WiL about getting the source to ibag a long time ago, but he wasn't even sure it existed any more. So there's no chance of ibag itself being embedded, and I don't feel like reverse engineering it myself. Not to mention, ibag's syntax is wretched. I'd rather use something more human-readable.

If everyone is willing to agree on a set of command shortcuts and what code they are to generate, I should be able to incorporate them into KevEdit fairly easily. They need to be short (think 42 characters per line), consistent (similar syntax structure for each), and simple, like ZZT-OOP. Anyone accept the challenge?
66
What can be said now?
Posts: 0
Joined: Fri Mar 14, 2003 8:20 pm

Post by 66 »

Some options:

Option 1
shortcuts are put at the end of the object code
shortcuts have the form '_shortcutname:shortcutcommand
(like '_time:#take torches 1 timeup )
in the editor they will appear as #_shortcutname
(like all instances of #take torches 1 timeup will be replaced by #_time in editor X (In my case, KevEdit) )

The _ in the commands is so that there can't be any confusion with possible existing comments/labels.

Example
in ZZT:

Code: Select all

#cycle 2
:loopn
/n
#if alligned if not contact home
#if contact kill
#loopn
:loope
/e
#if alligned if not contact home
#if contact kill
#loope
:loops
/s
#if alligned if not contact home
#if contact kill
#loops
:loopw
/w
#if alligned if not contact home
#if contact kill
#loopw
:home
#shoot seek
/seek
#if alligned if not contact home
#put seek tiger
#if blocked n loopn
#if blocked e loope
#if blocked w loopw
#if blocked s loops
#home
:kill
#endgame
You've been touched by the dead
/i
#kill
'_find:#if alligned if not contact home
'_tch:#if contact kill
in editor:

Code: Select all

#cycle 2
:loopn
/n
#_find
#_tch
#loopn
:loope
/e
#_find
#_tch
#loope
:loops
/s
#_find
#_tch
#loops
:loopw
/w
#_find
#_tch
#loopw
:home
#shoot seek
/seek
#_find
#put seek tiger
#if blocked n loopn
#if blocked e loope
#if blocked w loopw
#if blocked s loops
#home
:kill
#endgame
You've been touched by the dead
/i
#kill
'_find:#if alligned if not contact home
'_tch:#if contact kill
Notice the last two lines in the editor: I they should be optional to be shown. If shown, the user can change them, and when the editor is closed, the shortcuts are read and replaced by the original. The editor could decide not to do so, but instead have a window where you can add remove and modify shortcuts. Or both ;)

And some variations which could be used (you can mix any of these)

Variation 1:

/seek
#shoot seek
'_xyz:/seek
'_xyz:#shoot seek

will become

#_xyz
(with or without the comments)

Variation 2:
'__shortcut:#command
the double _ signifies that it is a global shortcut ( put it in one object, and it will have effect on all the other object ON THE SAME BOARD )
like

@object 1
#end
:touch
#xyz
'__xyz:#endgame

@object 2
#end
:bombed
#xyz

Variation 3: CaSe SeNsItIvItY ?

Discuss it, or be creative(?) yourself
The more options the better, since I might've missed something :P
105
What can be said now?
Posts: 0
Joined: Wed Oct 08, 2003 5:55 am

Post by 105 »

I was thinking more along the lines of generating complex multi-line code; things like marquees and inventory systems.

But I can see the use of single-line shortcuts, especially in the example you give. Just to be precise, when the editor loads an object with shortcuts, it finds all lines matching the long version (e.g. "#if contact kill" in your example) and replaces them with the shortcut (e.g. _tch), whether or not they were created with shortcuts originally? If so, it would make coding it fairly easy and probably allow you to simplify existing object code by adding the shortcut and re-opening the object.

This is simple enough that if we decide we don't like it, we can just remove support for it from the editors later and just be left with some harmless comments.

I think the shortcut comments belong at the top of the file (or at least somewhere before they are used), rather than the bottom, as per convention in other preprocessors and for clarity. These are going to be important to understanding the code, so they should be seen first.

Global shortcuts would be very difficult to implement; you have to scan every object on the board every time you open any object. Terribly wasteful and slow. But I think I have an alternative idea: the ability to include another object's code inside the current object (think #bind on a smaller scale). In this way, you could import shortcuts from another object, or just plain object code. Suggested syntax:

'%include objectname

becomes:

'%include objectname
code from other object here...
'%end include

I just picked % because it isn't used for anything else, so it would be handy as a new "preprocessor command" symbol. When you re-open this code, the included stuff is stripped out. The '%end include tells the editor when to stop striping code and will also be removed.

The only problem with this is that it's much easier for an inept to tamper with in another editor and totally screw things up.

Thoughts?
User avatar
Mooseka
;-*
Posts: 282
Joined: Mon Sep 22, 2003 5:01 pm

Post by Mooseka »

This thread actually took off, I kind of expected a love-filled "SHUT THE FUCK UP MOOSE" but yay. Anyway! I like the idea of using %, because as afforementioned it isn't used for anything else. For things like marquee text I imagine it as like

%Marquee 3
_This here is text

The %Marquee being a lot like #Cycle, telling how fast the text should display. The _ commands under % would tell it what to do. That would sub for

T
/i
Th
/i
Thi
/i

etc.
Image
Post Reply