Post your scripting questions / solutions here
Moderator: Moderators
Salombo
Sergeant
Posts: 61 Joined: Mon Jun 05, 2006 1:30 pm
Location: New York
Post
by Salombo » Mon Mar 24, 2008 8:34 pm
Hello
I get this error that's spamming the qconsole log a lot.
while (!level.sh_murderer.sh_ingame) (global/horror.scr, 279)
while (!level.sh_murderer^
^~^~^ Script Error: Field 'sh_ingame' applied to NULL listener
the relevant part of the code is:
Code: Select all
select_murderer:
if (level.sh_selecting)
end
level.sh_selecting = 1
local.lastmurderer = level.sh_murderer
local.murderer = local.lastmurderer
murderer_tryagain:
if ($player.size < 2)
local.murderer = $player
else
{
while ((local.murderer == local.lastmurderer || local.murderer.dmteam == spectator) && $player.size > 1)
{
local.murderer = $player[randomint($player.size) + 1]
waitframe
}
}
if (local.murderer == NIL || local.murderer == NULL)
{
waitframe
goto murderer_tryagain
}
level.sh_murderer = local.murderer
while (!level.sh_murderer.sh_ingame)
waitframe
level.sh_selecting = 0
//local.murderer join_team spectator
local.murderer join_team axis
local.murderer respawn
waitframe
I was wondering if there was a fix for that. The mod works very well, it's just the spamming part that's a bit annoying. I've fixed a few null listener errors but this one is a bit tricky.
Thanks
Salombo
Sergeant
Posts: 61 Joined: Mon Jun 05, 2006 1:30 pm
Location: New York
Post
by Salombo » Thu Mar 27, 2008 1:07 pm
No luck i guess ... was hoping Rookie would have an answer/idea
Rookie One.pl
Site Admin
Posts: 2752 Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:
Post
by Rookie One.pl » Thu Mar 27, 2008 3:42 pm
I know this error and to be honest I never understood why it appears at all, since there are checks for local.murder not being NULL or NIL.
There were numerous things in this mod that worked against logic, I'm afraid.
What you could try is to change this:
Code: Select all
while (!level.sh_murderer.sh_ingame)
waitframe
to this:
Code: Select all
while (1) {
if (level.sh_murderer.sh_ingame)
break
if (!level.sh_murderer)
goto murderer_tryagain
waitframe
}
Last edited by
Rookie One.pl on Thu Mar 27, 2008 8:11 pm, edited 1 time in total.
Salombo
Sergeant
Posts: 61 Joined: Mon Jun 05, 2006 1:30 pm
Location: New York
Post
by Salombo » Thu Mar 27, 2008 4:28 pm
Ok thanks
Will give it a shot
Rookie One.pl
Site Admin
Posts: 2752 Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:
Post
by Rookie One.pl » Thu Mar 27, 2008 8:12 pm
Lol, why the hell did I write "I'm glad" instead of "I'm afraid"?
Tell us if it stopped the error spam or not.