#if color
Moderators: Commodore, Zenith Nadir
- Schroedingers Cat
- We must invent teleportation!
- Posts: 721
- Joined: Mon Jun 19, 2006 11:35 pm
- Location: Idaho, Wisconsin
I know #if any <thing> will work, but as far as I know #if doesn't work with directions.
Last edited by Schroedingers Cat on Thu Aug 14, 2008 7:21 pm, edited 1 time in total.
Yeah, I tried #if any earlier and that worked. Well, my idea was to make something based off of Carnage Heart for Playstation, although I've never really played the game. Anyway, there'd be a main object that'd check if certain things were in random/set directions and then make another object act accordingly to it. Have some robot vs robot type shit. Yeaaahhh, I think it can be done another way though.
if all you need is a randomizer you can just use commands like these:
Code: Select all
'assume the object is enclosed, with a wall to the south and a fake to the north.
@suits
#if blocked rndns black
'
'these are the "red" options, but no label is needed.
#if blocked rndns heart
'
'so this is the diamonds code.
#send bot:diamond
'
:heart
#send bot:heart
'
'but, if Black was selected earlier...
:black
#if blocked rndns spade
'
#send bot:club
'
:spade
#send bot:spade
'and if you want constant updates, you should make the randomizer keep
'looping. You can also use flags instead of messages, or whatever.
#restart
I'm nupanick.
More than a randomizer. See, in Carnage Heart you program robots by placing chips on a grid, and it acts accordingly. I wanted to recreate that so that you could place your own commands in a box and then let an object move around randomly and check to see what's near it, then send that command to the robot.
- Dr. Dos
- OH YES! USE VINE WHIP! <3
- Posts: 1772
- Joined: Tue Mar 11, 2003 12:00 am
- Location: Washington
Couldn't you do it linear and just make it like the old composer's engine?
Just have it #put dir red line or whatever as you place chips. Then when you need to read chips #put s boulder #if any red boulder whatever
Just have it #put dir red line or whatever as you place chips. Then when you need to read chips #put s boulder #if any red boulder whatever
Visit the Museum of ZZT
Follow Worlds of ZZT on Twitter
Apologies for the old post you may have just read.
Follow Worlds of ZZT on Twitter
Apologies for the old post you may have just read.
Well, I've been working on this engine, and it's not quite working correctly. http://rs71.rapidshare.com/files/137239 ... ottest.zip here's a link to it.
Edit: Oh yeah, the color keys shown aren't exactly accurate. The directions are supposed to be though.
Edit: Oh yeah, the color keys shown aren't exactly accurate. The directions are supposed to be though.
Oh, I see the problem! You put a boulder to check, and then when you're done you're trying to cover the boulder with
but that doesn't get rid of the boulder. Since the boulder is a pushable object, putting an empty just pushes the boulder out of the way and puts the empty where the boulder used to be. Instead, you should use non-pushable objects (like invisible walls) or else just do a straightforward #change boulder normal.
Since the boulder isn't cleared, the object is seeing that same boulder over and over again, and trying to repeat the command over and over again.
Code: Select all
#put e empty
#put e yellow normal
Since the boulder isn't cleared, the object is seeing that same boulder over and over again, and trying to repeat the command over and over again.
Last edited by Scribbit on Thu Aug 14, 2008 7:53 pm, edited 1 time in total.
I'm nupanick.
- Dr. Dos
- OH YES! USE VINE WHIP! <3
- Posts: 1772
- Joined: Tue Mar 11, 2003 12:00 am
- Location: Washington
or just have it so the boulder is in a corner since usually corners are where engines get stuffed
Visit the Museum of ZZT
Follow Worlds of ZZT on Twitter
Apologies for the old post you may have just read.
Follow Worlds of ZZT on Twitter
Apologies for the old post you may have just read.