Page 1 of 1

null listener

Posted: Sun Jun 06, 2010 9:30 pm
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.

Posted: Tue Jun 08, 2010 4:49 pm
by jv_map
Maybe the bulbs are static objects in radiant? You can't refer to static objects in your script.

Posted: Wed Jun 09, 2010 9:26 pm
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?

Posted: Thu Jun 10, 2010 9:32 pm
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!

Posted: Thu Jun 10, 2010 9:45 pm
by Killerdude
Thank you JV for sharing your knowledge.

Posted: Sat Jun 12, 2010 8:23 am
by jv_map
No problem! Cool it's still useful to some :)