I would like it so that my character does not move when performing a certain action...
Say for example. I am fishing...and i dont want to fish and walk at the same time?
How would i make it so the player is not allowed to move their character while performing this action?
ALSO
Alternatively...cancel out said action if player tries to move?
ID:155370
Jul 21 2011, 12:45 pm
|
|
Jul 21 2011, 12:47 pm
|
|
You'd want to modify the move proc to return (not 1). I have seen it done like this quite often.
|
In response to Lugia319
|
|
so simply speaking...just like that? really?
|
In response to Lugia319
|
|
and what if i just want to cancel what their doing, and allow them to move?
|
In response to Komuroto
|
|
Modify the frozen variable. It only works if the frozen variable isn't 0
|
In response to Lugia319
|
|
no i mean, for example i'm cutting away at a tree, but then suddenly i hit the arrow key to walk away from it. I dont want the cut verb to be carried out, as it will obviously still be going at this moment.
How do i make it so that when the player moves away from the tree, it would stop the called verb instantly? |
In response to Komuroto
|
|
That requires a bit more thought. I imagine it'd work a bit like this.
mob |
One thing to think about is how to keep track of what your mob is doing. The examples posted here are good and well, but if things start getting more complicated, you will get confused without a more systematic method of organizing actions. I would create a datum that keeps track of the player's current actions, and have a move function that is passed to the datum. The datum then decides what actions should be cancelled upon moving.
|
In response to Pepper2000
|
|
Could you show me your example, so i know what i'm dealing with?
|
In response to Komuroto
|
|
My example is a bit of a mess right now (some good illustrations there of what not to do), but basically I have a datum called interface, and in it I have the following vars:
MasterState: keeps track of the player's overall state (map, battle, main menu, etc.) BattleState: keeps track of the player's state within the battle system. MenuState: keeps track of the player's state within the main menu system. (more likely to come in the future) In addition to that, these state values are only assigned constant values, so when I review my code later, it will be clear what is meant by "MasterState = BATTLE". The client passes all input into the interface. For instance, there is a proc in the interface called Action(), which is your basic action key. Right now it is called by Center() in the client, but that is also likely to change. |