Re: AGLL Guide -- Make your own AGL games
Sam, on host 12.16.110.5
Monday, December 14, 1998, at 10:25:08
Re: AGLL Guide -- Make your own AGL games posted by Stephen on Monday, December 14, 1998, at 09:51:53:
> I just thought of a possible way around this dilemma.
Stephen, your thoughts are so enticing, I hate to have to put a damper on them. The AGL engine won't do what you suggest. Here's why:
> * end Get one of the Endings > ______ v 1 + 1 > ______ c v1=5 > ____________ p "Here is the ending." > ____________ w > _____ p "This is the same ending." > _____ l
For starters, let's get the nitpick out of the way. (And this nitpick is my fault, because it's not documented very well in the tutorial -- something I'll remedy after posting this.) The "w" command doesn't _jump_ to the "win game" sequence, it simply sets the "win" flag to true so that when the execution of AGLL code is finished, the engine will know whether you won the game or not. The above code works if v1 isn't 5 yet, but if it is, it will state the action text appropriately, then set the win flag, then fall through and overwrite the action text with the "lose" text, then set the lose flag. By the time you're done, you'll have the "lose" text ready to go, and you'll have both won *AND* lost the game. I honestly don't know what the engine does in that event, but at any rate, what it should look like is this:
* end Get one of the Endings ______ v 1 + 1 ______ c v1=5 ____________ p "Here is the ending." ____________ w ______ c v1!5 ____________ p "This is the same ending." ____________ l
Now let me explain why this won't work either. When a "lose" occurs, the ability to "undo" the move is enabled by NOT updating the player's saved game. (That's why, in the game, you can use the browser's "back" button on a "lose" screen to resume play, whereas the "back" button won't work at any other time, because it'll see that your saved game is newer than the screen you're moving from.) So the incrementing of v1 will not be remembered by the game.
The other problem is that the lose game page has the text "You Lost! Oops. Press the undo button to undo that last fatal move," printed after *your* lose game text. If that doesn't make sense in the context of the game, you'll be confusing the players.
There is, however, a way to accomplish what you suggest by not using *either* the "win" or "lose" commands. At each ending, jump to a new location called "ending" (or whatever), which is not a physical location, per se, but a point in the game which will handle all possible endings. Set a global variable before you jump to "ending" so the code in "ending" can determine what ending to supply, and use "ending"'s state variable to count how many endings you've seen so far. (Actually maybe you need a separate global for each ending so you can ensure that the player doesn't see one ending twice and get gipped of another.) When the "ending" code determines that the player has seen all possible endings, just provide the single choice "Finish" which, upon being triggered, executes a "w" command. (I don't think it'll work if you put a "w" or "l" command outside of an option command, but there's a slight chance I'm wrong.)
Let me know if this is not clear, and I'll provide an example with AGLL code.
> One bit about my game: StinkWorks Swamp.
My interest is piqued already.
|