null listener

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
Killerdude
Sergeant Major
Posts: 110
Joined: Fri May 11, 2007 12:16 am

null listener

Post by Killerdude »

Here is Wackos light flicker code with modifications

Code: Select all

flickerlights:
   $flickerlight1 light 1 1 0.24 512 
   $flickerlight2 light 1 1 0.24 512 
   local.on = 0
   while(1)
   {
      if (local.on == 1)
           {local.on = 0
            $bulb1 hide 
            $bulb2 hide}
      else {local.on = 1
            $bulb1 show
            $bulb2 show}
      level.radius = 200-randomfloat 50
      $flickerlight1 lightRadius (level.radius)
      $flickerlight2 lightRadius (level.radius)
      waitframe // don't change the light within one frame
   }
end
bulb1 & bulb2 are targetnames added in radiant to coronas. Does anyone know why do I get an error that show and hide are applied to a null listener?

It must be something simple, but I just dont see it.
[Rome wasn't mapped in a day!]
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Maybe the bulbs are static objects in radiant? You can't refer to static objects in your script.
Image
Killerdude
Sergeant Major
Posts: 110
Joined: Fri May 11, 2007 12:16 am

Post by Killerdude »

Yes, I was trying to hide a static object :roll:

I have since tried a script object and script model. It seems that whenever I give it the corona model, the entity disappears. When I check entity info the object is listed, but the coordinates are bogus. I have used another .tik and the entity does not dissapear. Weird!

Have you heard of that happening JV?

Furthermore, I looked in the .map file and found this entity ....

Code: Select all

// entity 8
{
"origin" "99999 99999 99999"
"targetname" "flickerlight1"
"classname" "script_model"
}
Obviously that is bad to. Can I simply delete it from the .map file and have it go from entity 7 to entity 9 or will that mess up radiant?
[Rome wasn't mapped in a day!]
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Yes there are known nasty bugs in radiant with script_models. It will also go bogus if you remove the model key and save the map :P.

Definitely get rid of that entity in your .map file, it's safe. But make a copy before you do it anyway ;). Radiant will renumber your entities when you load/save the map again.

To get your light bulbs showing/hiding as originally intended you'd need a new .tik. Hmm I though there was one like fx/corona.tik? Of you may have to make one yourself... Good luck!
Image
Killerdude
Sergeant Major
Posts: 110
Joined: Fri May 11, 2007 12:16 am

Post by Killerdude »

Thank you JV for sharing your knowledge.
[Rome wasn't mapped in a day!]
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

No problem! Cool it's still useful to some :)
Image
Post Reply