I want to tally health in the middle of the game and award points, but counting means taking and taking all the health makes the game end.
#take health 100
#give health 100
ends the game (assuming you have exactly 100 health)
yet we know the odd truth that:
#endgame
#give health 100
does not end the game. any ideas?
counting health without endgame
Moderators: Commodore, Zenith Nadir
counting health without endgame
*POW* *CLANK* *PING*
#take health 100
#give health 100
Doesn't end the game, although if there's an idle or any other type of command that doesn't happen instantaneously, it will make your game go into hyperspeed. So, just keep taking health until you are incapable, and then immediately give back at least one health point.
#give health 100
Doesn't end the game, although if there's an idle or any other type of command that doesn't happen instantaneously, it will make your game go into hyperspeed. So, just keep taking health until you are incapable, and then immediately give back at least one health point.
- Dr. Dos
- OH YES! USE VINE WHIP! <3
- Posts: 1772
- Joined: Tue Mar 11, 2003 12:00 am
- Location: Washington
Fixed for you.Commodore wrote:well this is sort of what I had, but it goes into super speed
:loop
#take health 1 #done
#give score 1
#loop
:done
#endgame
#give health 100
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.
- Dr. Dos
- OH YES! USE VINE WHIP! <3
- Posts: 1772
- Joined: Tue Mar 11, 2003 12:00 am
- Location: Washington
Could the stat order cause that?Commodore wrote:no i tried that. the hyper effect starts when health reaches zero and doing an endgame after the effect starts doesn't slow the game back down.
Because I ended up making a test world with code exactly like that before seeing your own code.
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.
- Quantum P.
- Level 17 Accordion Thief
- Posts: 1433
- Joined: Fri Sep 12, 2003 1:41 am
- Location: Edmonds, WA
- Contact:
You could do it backwards:
There's still one #take health in there, so it might still send you into hyperspeed. Might be solvable by throwing in an idle before the #take health. I haven't tested it.
Code: Select all
#give score 100
#start
:loop
#give health 1
#take score 1
:start
#take health 100 loop
#give health 100