category
Counter-Strike: Source
description
Prop based cars that move very much like those seen in de_nuke.
keywords
cs, source, counter, strike, counter-strike, car, de_nuke, model, moving.
This tutorial will show you how to move a car using a models scripted sequence rather than using path_tracks.
Make a prop_dynamic entity. The car model we will have to use is: models/props/de_nuke/car_nuke_animation.mdl
Set the name to "car1" and I recommend using bounding box for collisions. you can also change the skin to your liking.
Create a "logic_relay" entity and open it up. name it "relay1" go outputs and click on add. type in the following:
OnTrigger
car1
SetAnimation
run
(delay can be added but not necassary)
We have triggered our car to succesfully drive using nothign more but an animation scripted only for this car model. Understand that valve used a much more simpler and effective way to move a model, rather then using choppy path_track entities. We have triggered our car via a trigger entity, now we have to assign whats going to trigger THAT entity.
If you havent already placed an info_player_spawn then do so. create a box covered with the trigger texture and make it a trigger_multiple. Make sure it is in teh info_player_spawn entity. open it up and go to outputs and click on add again. add the following:
OnTrigger
relay1
trigger
(delay can be added but not necassary, and make sure the "fire once only" flag is ticked off.
So thats it! when you spawn you will trigger a trigger_multiple to set off the logic_relay entity that will then set the animation for car to drive. according to your settings you can make the car drive once, or make it for an infinite sequence. If it goes well, you can place it in your CSS map. Notice that the car disappears and then reapears at its starting location, that is the animation set for the car. If you want it to be longer your going to have to edit the animation, and thats something you cannot do in hammer.