I just want a simple explanation on how to stop a usr from moving. Like if he were to rest.
and
How to change the background of the text box to black.
Thanks
Fraon2
ID:170697
![]() Dec 23 2004, 9:23 pm
|
|
oh..Just set a var to like 1 and in Move() check to see if its 1 or not..If its 1 call return so they dont move or else do ..()
|
You shouldnt be making a game if you cannot make a variable and check it.
mob/var/moveable = 1 |
Dession wrote:
You shouldnt be making a game if you cannot make a variable and check it. > var/moveable = 1 Maybe you shouldn't be helping if you misuse ==0 & ==1. ~>Jiskuha |
Jiskuha wrote:
Dession wrote: > > var/moveable = 1 Maybe you shouldn't be helping if you misuse ==0 & ==1. And how did I misuse it? If moveable is 0 you cannot move..If it is 1 you can move. |
Thats why I'm learning.
It still isn't working, I must have something out of place. verb Rest() if(usr.stm < usr.mstm) usr<<"<font color = green>You begin resting.</font>" usr.rst = 1 src.Move(null) sleep(100) usr.stm = usr.mstm src.Move(1) usr<<"<font color = green>You are done resting.</font>" mob var moveable = 1 mob Move() if(src.moveable == 0)//If moveable is 0 they cannot move return else ..() |
You must set moveable to 0 for them not to be able to move. Let me guess, this is a DBZ game? You can also do if(!moveable) that means if it is 0 or equals nothing. Its shorter and easy to remember.
|
Dession wrote:
And how did I misuse it? If moveable is 0 you cannot move..If it is 1 you can move. Please excuse my previous post,It's 3 AM. What i meant to say was it's a lot cleaner to be using the ! operator(s) here rather than the == operator. I'm not thinking straight tonight. ~>Jiskuha |
Thats why I'm learning.
It still isn't working, I must have something out of place. verb Rest() if(usr.stm < usr.mstm) usr<<"You begin resting." usr.rst = 1 src.Move(null) sleep(100) usr.stm = usr.mstm src.Move(1) usr<<"You are done resting." mob var moveable = 1 mob Move() if(src.moveable == 0)//If moveable is 0 they cannot move return else ..() |
~>Jiskuha |
Dession wrote:
Yes but he is new and he doesnt know what ! means. So what I showed him is fine. No, it's even worse. If you don't teach things like that to newbies, how will they learn them? It's also best to get them in good habits to start with, so they don't have to unlearn what you told them later. |
and