Disabling Movement #1291
-
I have a player.move attribute with an integer. I want to use this attribute for the player to move in between rooms, reducing the int. by 1 with each turn. When the int. reaches zero, I want to prompt the player to rest, replenishing the attibute with a new random number. I have all the code worked out so far, but I'm having difficulty with disabling my players ability to move between rooms when the player.move counter reaches zero. What would be a solution that would help me to achieve this in Quest? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 13 replies
-
EDIT: There's now a better way. See my reply below. I can see a few ways to do this. If you just want to disable the
You can disable movement when the move counter hits zero by doing
This just calls the built-in |
Beta Was this translation helpful? Give feedback.
-
I've had a play around but it's been a long time since I've used ASL. I thought perhaps you could do something with this?
The script runs before entering a room. You can create a custom function for canmove, and use verbs for adding the directions. |
Beta Was this translation helpful? Give feedback.
-
There really should be a simpler way of doing this. Having a built-in canmove would be ideal. |
Beta Was this translation helpful? Give feedback.
-
Before moving the player, the go command runs a function called If you're on the web editor, you can't edit existing functions. So instead, you should set If you are using the desktop editor, you should be able to change this function. It takes one parameter, the exit the player is trying to go through, and returns
(In this case, I named the attribute |
Beta Was this translation helpful? Give feedback.
Here's a library with Angel's modified
TestExitGlobal
from this post, which also includes thego
command needed to work with this:GoPatch-Kayoz1984Mod.zip
I also made a library/patch for general use, using the
TestExitGlobal
function andgo
command from the WebEditor app:#1292