Zipping Ahead N Turns?

For your purposes, it’s probably enough to add this property to your DefineLiteralAction:

actionTime = 0

There’s no effect.

With no change in the for loop, which counts up from two…

DefineLiteralAction(Zip) actionTime = 0 execAction() { Z_ing.n = toInteger(getLiteral()); mainReport('You are <b>zipping</b> ahead <b>' + Z_ing.n + ' turns</b>. \nTime passes...'); Z_ing.waitMany; } ;



//actionTime = 0


The point isn’t to change the number of zipped turns, it’s to make it so that >zip N only increments the turn counter by N, not N+1 (counting the zip command as an actual turn rather than a meta command.)

You’re seeing a bug where you count from 2 to N rather than from 1 to N, so even though you tell the game to wait 4 turns, it only waits 3.

You’re also printing the “Time passes” message manually, which of course is going to make it appear as if another turn has passed.

If you still have the default status bar in place, the second digit shows the current turn counter.


You’re right. With the actionTime set to zero and the for loop initialized at 1, the output is much cleaner, the NPCs aren’t able to sneak in an extra move, and the Turn counter synchs.

Thanks, man!


I wanted to see what happened.

run { local temp = new TemporaryFile(); local out = File.openTextFile(temp, FileAccessWrite); testList.forEach({x: out.writeFile('>' + x + '\n')}); out.writeFile('>zip 10\n'); out.closeFile(); setScriptFile(temp); }

The 'terp made it to turn 50.


It’s hard to follow but it looks like you are calling >zip 10 recursively from within the zip command.

I.e. >zip 1 turns into a script that runs:

>zip 10

Which in turn produces 10 of the above scripts, and goes up exponentially from there.

It looks like there’s a hard cap of 500 calls to setScriptFile before the interpreter will return to keyboard control. (Based on empirical testing; I haven’t checked the source code.) So you run into the limit after 50 turns of waiting once (+1 turn count) and calling setScriptFile ten times (+0 turn count).

It didn’t dump me back to the prompt. It hung. Greyed out window, circling Win7 cursor, all that.

I can zip 151. [Without the recursive crasher line, of course.] Haven’t tried it higher than that. – Of course, 50 turns is the last turn displayed. Who knows how deep it ran into the Z-field.