More ZZT-OOP codes.
Moderators: Commodore, Zenith Nadir
More ZZT-OOP codes.
There are still four things I can't work out:
1: How to make a working fade in/out.
2: How to make flashing objects.
3: How the #put command works.
4: How the #send command works.
Will anyone help?
1: How to make a working fade in/out.
2: How to make flashing objects.
3: How the #put command works.
4: How the #send command works.
Will anyone help?
- Zenith Nadir
- this is my hammer
- Posts: 2767
- Joined: Wed Mar 12, 2003 11:40 am
- Location: between the black and white spiders
1.
Suppose you want all the red walls on a board to fade in and out in sync.
@supercharger hell
#cycle 1
:hrr
/i#change red solid normal
/i#change red normal breakable
/i#change red breakable water
/i#change red water invisible
/i#change red invisible water
/i#change red water breakable
/i#change red breakable normal
/i#change red normal solid
#hrr
2.
Flashing objects are available in <a href="http://zzt.org/?p=reviews ... ip">STK</a> and <a href="http://zzt.org/?p=reviews ... s24.zip">a whole bunch of toolkits</a>. You can't "make" them outside of it unless you're using ZZTAE or KevEdit, and you can't make an object #become one.
3.
Easy, the #put command makes an object put whatever you specify in whatever direction you specify. Say, you want an object to put a green gem to its right;
#put e green gem
Or, if you want to use a direction relative to the player,
#put seek green gem
OR
#put opp seek green gem
OR
#put cw seek green gem.
You can #put pretty much any pre-programmed item, terrain or creature.
4. The #send command makes objects interact with one another. for example, say you have two objects, "dog" and "cat", and you want one to react to an event that happens to the other.
@dog
#cycle 1
#end
:touch
DOG: Woof!
#lock (this makes it so the player cannot touch the dog and restart its routine)
/i/i/i/i/i/i (this causes a short pause, making things look a little more realistic)
#send cat:ahh (the #send is actually superfluous- you can just use "#cat:ahh" and it'll have the same effect)
#unlock (reverses effect of #lock command)
#end
@cat
#cycle 1
#end
:ahh
#lock
CAT: OH GOD IT'S COMING TO GET ME GHFGFDHGBGHRS f
/i/i/i?rnd?rnd?rnd?rnd?rnd?rnd?rnd?rnd
CAT: Wait, nevermind.
#unlock
#end
Hope that helps!
Suppose you want all the red walls on a board to fade in and out in sync.
@supercharger hell
#cycle 1
:hrr
/i#change red solid normal
/i#change red normal breakable
/i#change red breakable water
/i#change red water invisible
/i#change red invisible water
/i#change red water breakable
/i#change red breakable normal
/i#change red normal solid
#hrr
2.
Flashing objects are available in <a href="http://zzt.org/?p=reviews ... ip">STK</a> and <a href="http://zzt.org/?p=reviews ... s24.zip">a whole bunch of toolkits</a>. You can't "make" them outside of it unless you're using ZZTAE or KevEdit, and you can't make an object #become one.
3.
Easy, the #put command makes an object put whatever you specify in whatever direction you specify. Say, you want an object to put a green gem to its right;
#put e green gem
Or, if you want to use a direction relative to the player,
#put seek green gem
OR
#put opp seek green gem
OR
#put cw seek green gem.
You can #put pretty much any pre-programmed item, terrain or creature.
4. The #send command makes objects interact with one another. for example, say you have two objects, "dog" and "cat", and you want one to react to an event that happens to the other.
@dog
#cycle 1
#end
:touch
DOG: Woof!
#lock (this makes it so the player cannot touch the dog and restart its routine)
/i/i/i/i/i/i (this causes a short pause, making things look a little more realistic)
#send cat:ahh (the #send is actually superfluous- you can just use "#cat:ahh" and it'll have the same effect)
#unlock (reverses effect of #lock command)
#end
@cat
#cycle 1
#end
:ahh
#lock
CAT: OH GOD IT'S COMING TO GET ME GHFGFDHGBGHRS f
/i/i/i?rnd?rnd?rnd?rnd?rnd?rnd?rnd?rnd
CAT: Wait, nevermind.
#unlock
#end
Hope that helps!
he looked upon the world and saw it was still depraved
Overall: Rotton egg for breakfast
Overall: Rotton egg for breakfast
-
- LOOK OUT FER BAAAD BOB
- Posts: 116
- Joined: Fri Mar 28, 2003 12:51 am
You'll have to do that artificially. "#become red object" doesn't work in ZZT, so you'll either have to put an object next to it that says ":loop #put w red object #put w purple object #put w yellow object #put w white object #put w blue object #put w green object #put w cyan object #loop", or have the object say ":loop #change cyan object red object #change red object purple object #change purple object yellow object #change yellow object white object #change white object blue object #change blue object green object #change green object cyan object #loop", which would soon affect all the bright objects on the screen.DAVEW27 wrote:2: How do you get it to flash objects like the text at the bottom of the screen flashes?
And if you want to simulate blinking objects without the actual blinking color, you can just have your object alternate between "#char 32" and "#char [whatever number the object started at]".
But I recommend you figure out your own special ZZT techniques.
-
- LOOK OUT FER BAAAD BOB
- Posts: 116
- Joined: Fri Mar 28, 2003 12:51 am
- My Liver Hurtz
- All Hail
- Posts: 15
- Joined: Sun May 11, 2003 1:31 pm
- Location: Ottawa, Canada
- Contact:
- superbowl shuffle
- Official Clamp School Defender
- Posts: 418
- Joined: Mon Apr 07, 2003 4:52 am
- Location: CAsE SenSiTiVe
- Zenith Nadir
- this is my hammer
- Posts: 2767
- Joined: Wed Mar 12, 2003 11:40 am
- Location: between the black and white spiders
/seek or ?seek make an object seek the player.
You can't (or at least, it's totally difficult to) make an object seek another, although it is possible to have objects "touch" each other (eg. the platform level at the end of Fantasy World Dizzy).
You can't (or at least, it's totally difficult to) make an object seek another, although it is possible to have objects "touch" each other (eg. the platform level at the end of Fantasy World Dizzy).
he looked upon the world and saw it was still depraved
Overall: Rotton egg for breakfast
Overall: Rotton egg for breakfast