Page 1 of 1

Firing Gun Smoke

Posted: Mon Jul 28, 2003 5:11 pm
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.

Posted: Mon Jul 28, 2003 8:36 pm
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.

Posted: Tue Jul 29, 2003 7:42 am
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.

Posted: Tue Jul 29, 2003 5:05 pm
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.

Posted: Tue Jul 29, 2003 6:31 pm
by Bilko
its ok, i realise now the gun has a `fire` anim, lol.
Silly mistake.

Bilko.