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
|
|
In response to Dession
|
|
I tried src.Move(null)
but my character could still move |
In response to Fraon2
|
|
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 ..()
|
In response to Dession
|
|
what var do i set to 1, and how do i check to see if Move() is 1 or not?
|
In response to Fraon2
|
|
You shouldnt be making a game if you cannot make a variable and check it.
mob/var/moveable = 1 |
In response to Dession
|
|
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 |
In response to 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. |
In response to Dession
|
|
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 ..() |
In response to Fraon2
|
|
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.
|
In response to Dession
|
|
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 |
In response to Jiskuha
|
|
Yes but he is new and he doesnt know what ! means. So what I showed him is fine.
|
In response to Dession
|
|
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 ..() |
In response to Fraon2
|
|
And why did you post it twice in the same topic? I already replied to your original.
|
In response to Fraon2
|
|
~>Jiskuha |
In response to Jiskuha
|
|
Did you guys NOT see my post? Also you must set moveable to 0 not 1.
|
In response to Dession
|
|
Its 1am give me a break. Jeesh.
|
In response to Fraon2
|
|
Maybe you should give youself a break and not try to program at 1:00 am.
|
In response to Dession
|
|
Lol good point, but this is the time when i become most creative.
|
In response to Dession
|
|
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