I am try o play a sound every time the world repopulates. But I want the use to be able to turn it off. This what I got.
2 verbs one that turns on the sound (sets the var sound to 1) and one thast turns is off (stes the var sound to 0)
FX_sound_on()
usr.Sound = 1
usr << "<B><font size=2 color=red>FX sound on"
FX_sound_off()
usr.Sound = 0
usr << "<B><font size=2 color=red>FX sound off"
Now when I call a sound it is in the form of a proc, an example
mob
proc
sound_flash3()
if(usr.sound)
usr << 'Flash3.wav'
Now, the world repop proc looks likes this.
world
proc
Reload_World()
world.Repop()
world << "A year has passed and the earth has grown back to it's origanal state."
repoping_world = 1
for(var/mob/characters/P in world) P.sound_repop()
for(var/obj/temp/destroyed/T in world) del(T)
spawn(2000) Reload_World()
if(quest > 1)
for(var/mob/monsters/start/Z in world) del(Z)
The line
for(var/mob/characters/P in world) P.sound_repop()
is the problem, I think.
the proc sound_repop is this
mob
proc
sound_repop()
if(usr.sound)
usr << 'repop.wav'
else
..()
When I run it in dream seeker I get the error
runtime error: Cannot read null.Sound
proc name: sound repop (/mob/proc/sound_repop)
usr: null
src: Human (/mob/characters/Human)
call stack:
Human (/mob/characters/Human): sound repop()
: Reload World()
: Start Saga()
Login()
runtime error: Cannot read null.Sound
proc name: sound repop (/mob/proc/sound_repop)
usr: null
src: Human (/mob/characters/Human)
call stack:
Human (/mob/characters/Human): sound repop()
: Reload World()
: Start Saga()
Login()
runtime error: Cannot read null.Sound
proc name: sound repop (/mob/proc/sound_repop)
usr: null
src: Human (/mob/characters/Human)
call stack:
Human (/mob/characters/Human): sound repop()
: Reload World()
: Start Saga()
Login()
runtime error: Cannot read null.Sound
proc name: sound repop (/mob/proc/sound_repop)
usr: null
src: Human (/mob/characters/Human)
call stack:
Human (/mob/characters/Human): sound repop()
: Reload World()
: Start Saga()
Login()
runtime error: Cannot read null.Sound
proc name: sound repop (/mob/proc/sound_repop)
usr: null
src: Human (/mob/characters/Human)
call stack:
Human (/mob/characters/Human): sound repop()
: Reload World()
: Start Saga()
Login()
runtime error: Cannot read null.Sound
proc name: sound repop (/mob/proc/sound_repop)
usr: null
src: Human (/mob/characters/Human)
call stack:
Human (/mob/characters/Human): sound repop()
: Reload World()
: Start Saga()
Login()
runtime error: Cannot read null.Sound
proc name: sound repop (/mob/proc/sound_repop)
usr: null
src: Human (/mob/characters/Human)
call stack:
Human (/mob/characters/Human): sound repop()
: Reload World()
: Start Saga()
Login()
runtime error: Cannot read null.Sound
proc name: sound repop (/mob/proc/sound_repop)
usr: null
src: Human (/mob/characters/Human)
call stack:
Human (/mob/characters/Human): sound repop()
: Reload World()
: Start Saga()
Login()
runtime error: Cannot read null.Sound
proc name: sound repop (/mob/proc/sound_repop)
usr: null
src: Human (/mob/characters/Human)
call stack:
Human (/mob/characters/Human): sound repop()
: Reload World()
: Start Saga()
Login()
runtime error: Cannot read null.Sound
proc name: sound repop (/mob/proc/sound_repop)
usr: null
src: Human (/mob/characters/Human)
call stack:
Human (/mob/characters/Human): sound repop()
: Reload World()
: Start Saga()
Login()
runtime error: Cannot read null.Sound
proc name: sound repop (/mob/proc/sound_repop)
usr: null
src: Human (/mob/characters/Human)
call stack:
Human (/mob/characters/Human): sound repop()
: Reload World()
: Start Saga()
Login()
runtime error: Cannot read null.Sound
proc name: sound repop (/mob/proc/sound_repop)
usr: null
src: Human (/mob/characters/Human)
call stack:
Human (/mob/characters/Human): sound repop()
: Reload World()
: Start Saga()
Login()
runtime error: Cannot read null.Sound
proc name: sound repop (/mob/proc/sound_repop)
usr: null
src: Human (/mob/characters/Human)
call stack:
Human (/mob/characters/Human): sound repop()
: Reload World()
: Start Saga()
Login()
runtime error: Cannot read null.Sound
proc name: sound repop (/mob/proc/sound_repop)
usr: null
src: Human (/mob/characters/Human)
call stack:
Human (/mob/characters/Human): sound repop()
: Reload World()
: Start Saga()
Login()
runtime error: Cannot read null.Sound
proc name: sound repop (/mob/proc/sound_repop)
usr: null
src: Human (/mob/characters/Human)
call stack:
Human (/mob/characters/Human): sound repop()
: Reload World()
: Start Saga()
Login()
runtime error: Cannot read null.Sound
proc name: sound repop (/mob/proc/sound_repop)
usr: null
src: Human (/mob/characters/Human)
call stack:
Human (/mob/characters/Human): sound repop()
: Reload World()
: Start Saga()
Login()
runtime error: Cannot read null.Sound
proc name: sound repop (/mob/proc/sound_repop)
usr: null
src: Human (/mob/characters/Human)
call stack:
Human (/mob/characters/Human): sound repop()
: Reload World()
: Start Saga()
Login()
runtime error: Cannot read null.Sound
proc name: sound repop (/mob/proc/sound_repop)
usr: null
src: Human (/mob/characters/Human)
call stack:
Human (/mob/characters/Human): sound repop()
: Reload World()
: Start Saga()
Login()
runtime error: Cannot read null.Sound
proc name: sound repop (/mob/proc/sound_repop)
usr: null
src: Human (/mob/characters/Human)
call stack:
Human (/mob/characters/Human): sound repop()
: Reload World()
: Start Saga()
Login()
runtime error: Cannot read null.Sound
proc name: sound repop (/mob/proc/sound_repop)
runtime error: Cannot read null.Sound
proc name: sound repop (/mob/proc/sound_repop)
runtime error: Cannot read null.Sound
proc name: sound repop (/mob/proc/sound_repop)
runtime error: Cannot read null.Sound
proc name: sound repop (/mob/proc/sound_repop)
runtime error: Cannot read null.Sound
proc name: sound repop (/mob/proc/sound_repop)
runtime error: Cannot read null.Sound
proc name: sound repop (/mob/proc/sound_repop)
runtime error: Cannot read null.Sound
proc name: sound repop (/mob/proc/sound_repop)
runtime error: Cannot read null.Sound
proc name: sound repop (/mob/proc/sound_repop)
runtime error: Cannot read null.Sound
proc name: sound repop (/mob/proc/sound_repop)
runtime error: Cannot read null.Sound
proc name: sound repop (/mob/proc/sound_repop)
runtime error: Cannot read null.Sound
proc name: sound repop (/mob/proc/sound_repop)
runtime error: Cannot read null.Sound
proc name: sound repop (/mob/proc/sound_repop)
runtime error: Cannot read null.Sound
proc name: sound repop (/mob/proc/sound_repop)
runtime error: Cannot read null.Sound
proc name: sound repop (/mob/proc/sound_repop)
runtime error: Cannot read null.Sound
proc name: sound repop (/mob/proc/sound_repop)
runtime error: Cannot read null.Sound
proc name: sound repop (/mob/proc/sound_repop)
runtime error: Cannot read null.Sound
proc name: sound repop (/mob/proc/sound_repop)
runtime error: Cannot read null.Sound
proc name: sound repop (/mob/proc/sound_repop)
runtime error: Cannot read null.Sound
proc name: sound repop (/mob/proc/sound_repop)
runtime error: Cannot read null.Sound
proc name: sound repop (/mob/proc/sound_repop)
runtime error: Cannot read null.Sound
proc name: sound repop (/mob/proc/sound_repop)
runtime error: Cannot read null.Sound
proc name: sound repop (/mob/proc/sound_repop)
runtime error: Cannot read null.Sound
proc name: sound repop (/mob/proc/sound_repop)
runtime error: Cannot read null.Sound
proc name: sound repop (/mob/proc/sound_repop)
runtime error: Cannot read null.Sound
proc name: sound repop (/mob/proc/sound_repop)
runtime error: Cannot read null.Sound
proc name: sound repop (/mob/proc/sound_repop)
runtime error: Cannot read null.Sound
proc name: sound repop (/mob/proc/sound_repop)
runtime error: Cannot read null.Sound
proc name: sound repop (/mob/proc/sound_repop)
runtime error: Cannot read null.Sound
proc name: sound repop (/mob/proc/sound_repop)
runtime error: Cannot read null.Sound
proc name: sound repop (/mob/proc/sound_repop)
runtime error: Cannot read null.Sound
proc name: sound repop (/mob/proc/sound_repop)
runtime error: Cannot read null.Sound
proc name: sound repop (/mob/proc/sound_repop)
runtime error: Cannot read null.Sound
proc name: sound repop (/mob/proc/sound_repop)
runtime error: Cannot read null.Sound
proc name: sound repop (/mob/proc/sound_repop)
runtime error: Cannot read null.Sound
proc name: sound repop (/mob/proc/sound_repop)
A year has passed and the earth has grown back to it's origanal state.
If you need anymore info, just ask. Thanks in advance.
~~TK6000~~
ID:173751
![]() Nov 20 2003, 9:55 pm
|
|
And use src instead? I am a little new, so if you could tell me the diff or point me to were I could read about it.
Thanks though. |
Alrighty thanks alot. src works though. I really need to find out what the diff is from usr, client, and src. I kinda understand client, but not very well.
|
usr is the mob that is assigned to the user.
mob verb text() usr << "hi" note that usr is mob mob verb text2() src << "hi" src is the mob so it shows "hi" to the one who activates the verb (or the source) obj shirt icon='shirt.dmi' layer=1 verb wear() usr << "you wear the shirt" usr.overlays += /obj/shirt this is an object. the src in hear is the obj but the usr is still the mob you assigned to the user. i think that's all needs to know. its easy after a while. |
src = The thing with the verb/procedure.
usr = The thing that called the verb/procedure. Example: obj/verb/Test() You see here, this object's verb is usable by anyone. (Because of the first set statement.) What you are doing when you use the test verb is is calling something that belongs to something else. Src is always that something that you call. In this case, an object. (src is source) Now, whoever uses the verb is always usr. (usr is user) You see? |
NO USE USR IN PROC! UNGH
I mean, ...
Usr in null, so it can't read it's Sound variable. Remove "usr." from all of the procedures that DO NOT REQUIRE IT.