if(src.moving==0)
spawn(20)
if(src.moving==0)
usr<<"HEY"
else
return
Hello friends and fellow programmers, I have come for help once again. I am at the moment working on a way to go faster as the player run, so that they do not go at full speed as soon as they press the arrow key. Would I tried to do was make it so that the game checks if you are running after about a second thus increasing said speed. I attempted to test this by using spawn(), the message "HEY", and moving as the variable it checks. It does in fact wait the time to do the next code, but it spams the message, even if you stop running. Would I instead need a proc?
|
Spawn should be avoided except where absolutely necessary.
client Control loops work MUCH better than BYOND's built-in setup, to be honest. |
In response to Ter13
|
|
Ter13 wrote:
Spawn should be avoided except where absolutely necessary. > client Control loops work MUCH better than BYOND's built-in setup, to be honest. Hey, I am a bit confused by some of the coding. When ever I press a key that you said use as macro, they show up as text each time. |
The "Any" macro is still in beta. It can be used to track the press and release events of any button on the keyboard or gamepad, without needing a separate macro for every individual key, by providing the name of the key as an argument to the verb.
|
In response to Universe_Steven
|
|
Universe_Steven wrote:
Hey, I am a bit confused by some of the coding. When ever I press a key that you said use as macro, they show up as text each time. Did you set up the macros in the interface editor? Open your interface file (.dmf file). If you don't have one, create one via File->New. Double click on the default macro set in the top box. Now edit the macro set in the skin editor. Delete every macro. Add a new macro: Key: Any Command: keyPress "[[*]]" Add another new macro: Key: Any+UP Command: keyRelease "[[*]]" Save. Compile. Run. Is there anything else you are struggling with? |
I deleted the default macro set, created macro with the button X and had the command: keyPress then I created one that was X+UP and the command was : keyRelease. When I tested it not only could I not move, but it only created x's in the text input box.
|
In response to Ter13
|
|
Thank youuu ter13, your movement system is awesome, how can i make this: when the character is walking northwest and then it hits a wall at north, it stops, how can i make it still going west?
|
In response to STa
|
|
STa wrote:
Thank youuu ter13, your movement system is awesome, how can i make this: when the character is walking northwest and then it hits a wall at north, it stops, how can i make it still going west? I think he means edge sliding. |
Something like this would fit better.