Have a trigger question...

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
User avatar
G3mInI
First Lieutenant
Posts: 187
Joined: Sat Jun 29, 2002 3:49 am

Have a trigger question...

Post by G3mInI »

I have this statement for a teleport trigger that I want a player to activate by using the use key.

Code: Select all

while(1)
			{
			local.player = parm.other
			local.teletrigg waittill trigger
			
			if(local.player.useheld == 1)
				{
				local.start_snd playsound beam_off
				local.player tele ( local.teleporter.end )
				local.dest_snd playsound snd_b_zing8
				local.teletrigg nottriggerable
				local.beam scale 1
				local.hum stoploopsound
				wait 25
				local.teletrigg triggerable
				local.hum loopsound beam_on
				local.beam scale 25
				}
			waitframe
			}

Everytime I test this out, the very first time I trip the the trigger or try to, I get this error in console:


Code: Select all

*Area51*G3mInI_2LT has joined the Allies
			if(local.player.useheld == 1) (global/g3mini_teleporter.scr, 59)
			if(local.player^

^~^~^ Script Error: Field 'useheld' applied to NULL listener

			if(local.player.useheld == 1) (global/g3mini_teleporter.scr, 59)
			if(local.player^

^~^~^ Script Error: Field 'useheld' applied to NULL listener

The trigger does work everytime and the player does teleport. The next time I go to the trigger, there is never anymore errors. This error only appears the very first time I try to use the trigger after the map is loaded. Any ideas why ?

G3mInI
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

local.player = parm.other

Post by tltrude »

"local.player = parm.other" should be after the trigger event.
Tom Trude,

Image
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

isn't parm.other the last person to have tripped the trigger? if not, what is?
User avatar
G3mInI
First Lieutenant
Posts: 187
Joined: Sat Jun 29, 2002 3:49 am

Re: local.player = parm.other

Post by G3mInI »

tltrude wrote:"local.player = parm.other" should be after the trigger event.

That did it. Thank you sir. Am now error free in the console. It's a pretty rare event for me, so I am going to celebrate! :shock:

Cheers,

G3mInI
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

parm

Post by tltrude »

Yes it is lizardkid, but he had it before the trigger was fired. So, "loacl.player" was NIL (no value).
Tom Trude,

Image
Post Reply