Survival/Horror

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
Salombo
Sergeant
Posts: 61
Joined: Mon Jun 05, 2006 1:30 pm
Location: New York

Survival/Horror

Post by Salombo »

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 8-)
Image
Salombo
Sergeant
Posts: 61
Joined: Mon Jun 05, 2006 1:30 pm
Location: New York

Post by Salombo »

No luck i guess ... was hoping Rookie would have an answer/idea :cry:
Image
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 »

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.
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
Salombo
Sergeant
Posts: 61
Joined: Mon Jun 05, 2006 1:30 pm
Location: New York

Post by Salombo »

Ok thanks
Will give it a shot :D
Image
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 »

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.
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
Post Reply