Firing Gun Smoke

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
Bilko
Colour Sergeant
Posts: 91
Joined: Sat May 24, 2003 3:06 pm
Location: UK
Contact:

Firing Gun Smoke

Post by Bilko »

Hi, I've made myself a gun that aims and fires at a preset target and I'm happy with it. However, the gun doesn't have any fire effect so I'm tryin to add some barrel smoke when it fires.
Here's what I've got (gun1_init is called before spawn):

gun1_init:

$gun1_smoke glue $gun1
$gun1_smoke anim stop

goto gun1

end

gun1:

wait 5

$gun1 setAimTarget $aim1
$gun1 waittill ontarget

wait 0.2

$gun1_smoke anim start

wait 0.2

$gun1_smoke anim stop
$gun1_fire anim start
radiusdamage $gun1_fire 256 384

wait 5

$gun1 setAimTarget $aim_normal
$gun1 waittill ontarget

goto gun1

end

What I have is continuous smoke from the smoke effect's beginning location, so it's not binding and its not start/stopping. Some generally not working. All the targetnames etc are correct. Any ideas?
Thanks.

Bilko.
User avatar
Alcoholic
General
Posts: 1470
Joined: Sat May 17, 2003 5:57 am
Location: California
Contact:

Post by Alcoholic »

you are glueing the smoke to the gun. when you glue something to a parent, its origin is changed to the parents own origin, no matter where it started off. what you want is to bind the entity. that will adjust the entity's offset with the parent.

also, when you want the smoke to stop, you should run this line:

$gun1_smoke delete

since this is only a oneshot thing, you should delete it so it doesnt keep eating up the memory.
Bilko
Colour Sergeant
Posts: 91
Joined: Sat May 24, 2003 3:06 pm
Location: UK
Contact:

Post by Bilko »

I wasn't sure about the glue and bind, thanks.
It isn't a one shot thing, it loops over and over...

Bilko.
Slyk
Lieutenant Colonel
Posts: 361
Joined: Sun Jul 14, 2002 12:42 am
Location: Elizabethtown, PA

Post by Slyk »

I think you should move this line:

$gun1_smoke anim stop

up to just after your 'PRESPAWN' header. Then it should appear again in the script just after the gun fires to stop the smoke.
Bilko
Colour Sergeant
Posts: 91
Joined: Sat May 24, 2003 3:06 pm
Location: UK
Contact:

Post by Bilko »

its ok, i realise now the gun has a `fire` anim, lol.
Silly mistake.

Bilko.
Post Reply