How to switch models (lights on/off)

  • Thread starter Thread starter spacedkadet
  • Start date Start date
S

spacedkadet

Guest
Hello,

I'm having trouble (dont know where to start lol) in trying to make my light model switch when the light is turned on/off.

The models im want to use are

models/props_c17/light_decklight01_on.mdl
and
models/props_c17/light_decklight01_off.mdl

I have a light entity in front that switches on/off when my logic_gametimer (its a map for source forts) tells it to which works fine. But I cant figure out how to switch between models when the light goes on/off. So basically when the light goes off i want the 2nd (off) light to display and vice versa. At the momment i have the light set to prop_static which i know is wrong - but i have no idea which entity to tie to.

Any help would be greatly appreciated.

Many thx ,
spacedkadet.
 
hm dont know but try the advance way? when switching it on set model to kill and spawn an another one or something?.........
 
I see what you mean but the prop_statis doesnt have the option "name" so ill have to set it to something else, maybe prop_physics or prop_decal ??

Pain realy when all i need is an entity that on one trigger shows one model and on another trigger shows a differant model.

The problem ive got with spawning it and killing it etc is that source forts game time is split into two parts - build time and fight time and these are cvar changable. So if i set it to delay of say 10 mins before re-spwan that would be fine as long as mp_buildtime and mp_fighttime are both on 10mins but if the server admin alters the cvar to say 15 mins then it would mess up the rotation.

Basically the light is an encaged area (with wire mesh front) that is closed during buildtime and open during fighttime. When the logic_gametimer outputs transition to fighttime the door opens and the light comes on - that works fine but i realy wanna change the model too so that during buildtime the light model is shown as off too.

Hope that makes sense :)

spacedkadet
 
You could try changing the skin number maybe. Not sure if it'll work tho.
EDIT: Nvm that didn't really make sense.
 
Ok, heres what to do.

Make 2 prop dynamics, one of the light off, and one of it on directly on top of eachother. In their properties set the one you dont want to start with to disabled.

Then you only have to use the "toggle" input on each to switch them.
 
thankyou firecrack i shall give that a go and post back :)
 
ok tried that and a few snags, for prop_dynamics there isnt a keyvalue or flag for start disabled and same for func_physics_respawnable

I can now get the model i dont want displayed to disappear but they dont come back. Under my outputs from logic_gametimer i set myoutput to "onbuild" then my target entity to the light on model to kill which does remove it and same with "onfight" for light off model to kill and these work fine.

However in the "via this input" box (where i put kill to remove the model) i dont know what to put to bring the model back, i have tried both set health and add health but neither of these work on prop_dynamics or prop_physics_respawnable. There is no toggle input or spawn object input for me to use to bring the model back.

BTW when i tried using the prop_physics_resawnable i set respawn time to 0 to stop it reapearing on its own (i cant just set this figure as described in previous post).

/me scratches head on this one.


cheers - spacedkadet
 
cant you just use the off model and when its on just let the sprite go on together with the light
 
the Specialist said:
cant you just use the off model and when its on just let the sprite go on together with the light

Yeah this is what i want to happen but i still cant get it to work. Ive just had the idea of making 2 func_doors and placing them just out of sight and making them the parents of each of the model. That way i can set the output of my gametimer to operate the door and the light model should move with it - disapearing off the map. This might work, gonna try this shortly.
 
Ok i finally got this done and this is how:

made 2x func_door with nodraw texture.
placed these next to the lights i want to move.
I set the func_doors to never open/close on their own and set to a lip of -2000 and the angle of opening to down.
I called one ammo_light_model_on_door and ammo_light_model_off_door.

I then set the actual lights (one on top of the other) to prop_dynamic and made parented them to the corosponding func_door (so they would move with the door).

Then in my logic_gametimer i set one to open on buildtime and close on fight time and vice versa for the other one.

Now when time transistions the model i done wanna see shoots off through the floor (i set speed to 100000 so u dont see it) and the model i want is left there.

It got kinda confusing with lots of outputs to setup but it works a treat :)

Ill see if i can find an easier way and if not i make make a vid tutorial to show how i did this. oh well cheers everyone i got there in the end :cheers:

spacedkadet..
 
You can change the skin of the object light with the I/O because most models like lights have a secondary skin.
 
Back
Top