PDA

View Full Version : A Few Questions



Delta4907
April 19th, 2009, 01:58 AM
Whoever has played Left 4 Dead will know the tank. Well, out of boredom, I wanted to try to imitate it, but using the hunter biped. So far I've created a new animation tag with sped up running\walking animations, compiled tank dialog from L4D, and set up the dialog tag. I've also set up the biped, actor and actor_variant tags so that it will only melee the player until the player dies. It is not vulnerable in its weak spot. Now I have a few questions.

1. Is it possible to make it so once the unit sees the player, a .sound_looping will play, and once the unit dies, the .sound_looping stops?

2. I don't think this is possible, but can you make it so if the hunter is doing its running animation, the ground will shake?

3. I know that AI's running speed is based on its animation, so after creating the new animation tag, with all the same animations except the ones I changed (four JMA's and two JMT's), I went to test the biped in sapien, and for some reason its doing a T pose, meaning something is wrong the animation, and its not playing it. However if I lift the spawn up, it plays the falling animation. I have not modified an idle animation, so I'm not sure whats going on here.

4. As (whoever has played L4D and have encountered the tank) will know, when the tank melees someone, it knocks them back about 10 feet (depending on the location). I know this is done in the hunters melee damage effect, but I don't know what value changes how far it pushes the player.

+rep to anyone who figures these out.

FluffyDuckyâ„¢
April 19th, 2009, 02:04 AM
No Idea, just wanted to say that it's a good idea! Hope people can help you. :)

Syuusuke
April 19th, 2009, 12:53 PM
For 1. (gonna psuedo code because I don't know actual scripting) can't you run a continuous script to keep a check on the unit's vitality and have it play the sound and when you do a check on its vitality (that its equal to 0) then stop it?

Can't really help you out with the rest, but there should be a tag property on the hunter's melee. If you want you can create a "fake" explosion upon impact to knock the player back (in case you can't find the force property for melee's).

Inferno
April 19th, 2009, 12:59 PM
Look in HS doc and see if there is a AI awareness command. If you find one I can write a script for the sound.

Rentafence
April 19th, 2009, 01:11 PM
Look in HS doc and see if there is a AI awareness command. If you find one I can write a script for the sound.

(ai_status <ai>)

returns the most severe combat status of a group of actors (0=inactive, 1=noncombat, 2=guarding, 3=search/suspicious, 4=definite enemy(heard or magic awareness), 5=visible enemy, 6=engaging in combat.

Inferno
April 19th, 2009, 01:14 PM
(if ( > (ai_status "name of your encounter") 0 )
(begin (sound_looping_start "sound" "object" 1) )
(begin (sound_looping_stop "sound" "object") )
)

That should work but I'm not sure what you are going to attach the sound to since I don't think you cant attach sounds to a ai in a encounter. If you put "none" in the object slot though it will play no matter where you are on the map.

Rentafence
April 19th, 2009, 01:22 PM
Would you want the state to be 4? If it's at 0, the sound would play when the ai is inactive, thus play all the time, right?

Inferno
April 19th, 2009, 01:23 PM
It says > than 0. So it plays if the state is greater than 0.

Rentafence
April 19th, 2009, 01:25 PM
Oh alright. I missed that part.

Delta4907
April 19th, 2009, 02:08 PM
This is what I have so far with the sound script:

(script startup hunter_tank
(ai_place hunter_tank)
(if ( > (ai_status "hunter_tank") 0 )
(sound_looping_start "sound\music\tank_theme\tank_theme" none 1)
(sleep_until (= (ai_living_count hunter_tank) 0) 15)
(sound_looping_stop "sound\music\tank_theme\tank_theme")
)

Inferno
April 19th, 2009, 02:10 PM
Make the ai_place a separate start up script and the sound script continuous.

Delta4907
April 19th, 2009, 05:03 PM
Make the ai_place a separate start up script and the sound script continuous.
Ok then. Anybody know the answer to my other three questions?