Equipment 0,4,20014
My code differs from your code probably because I use different characters, character IDs, and level names. In this code, I use the variable "
Inv"
, the levels "
Secret Path"
and "
Inv"
, and the first Go to Level Entrance is a "
Return to prior location"
.
Pasted code shows up different than in-game, is that correct?
Yes. The code is like that because it can be copied back into the hold using Ctrl-C and Ctrl-Shift-B, and (probably) because that is how the program looks at code before compiling it into machine code.
===========
This might not be useful, but let me explain what each part of the code does. Maybe that will help you find where the problem lies.
Each use Inv
Whenever the CMD button is pressed, the code jumps to Label Inv.
Go to End
If the CMD button is
not pressed on a given turn, the code skips to Label End (and does nothing).
Label Inv
If ...
Wait until var "Inv" = 1
Set var "Inv" = 0
Go to level entrance -2,1
Should the variable "
Inv"
be equal to one, set it to zero and return the player to the player's previous location in whatever level and location. Basically, this is the code that will send the player out of the inventory and back to wherever he came from.
Else
Set var "Inv" = 1
Go to level entrance 2,0
If End
Since "
Var"
is not one, it must be zero. Therefore, "
Var"
will be set to one and the player will be sent to the inventory. This code will send the player to the inventory and
set "Inv" to one, thus stating that the player is already in the inventory. Bolded for importance.
Label End
As said above, if CMD is not pressed on the current turn, the code jumps down here to not do anything.
===========
I think it would be best if you shared your hold so I could see what exactly is going on.
Best of luck.
____________________________
It was going well until it exploded.
~Scott Manley
Check out the DROD Wikia project
here!
[Last edited by 12th Archivist at 11-11-2011 01:58 AM]