ex:
mob
var
yo
area
people
Entered(mob/M)
if(usr.yo >= 1)
usr << "I said hello already..."
else
usr << "Hello for the first time!"
usr.yo = 1
I want to avoid having a thousand var.
Thx.
ID:179505
Dec 14 2001, 11:01 am
|
|
Is there a way to make an event happen only once without using a var ?
ex: mob I want to avoid having a thousand var. Thx. |
There are two ways you can determine that something has happened:
- By deriving it
- By storing it
If there is something about a mob that would change because you said something to them already, then you can derive it.
Probably not, though...so you have to store it.
However, there are multiple ways to store things. One approach would be to create a list that keeps tokens indicating what has been said:
This way you only have one variable, you can store any amount of stuff in it, and it only takes up space for stuff that has actually been said that needs to be tracked.