dim3 Forum

Full Version: Flamethrower
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am going to make a flamethrower for my game. Is it possible to make the projectiles (flames) spawn an object (more fire) when they hit something, and then have that object spawn a short-range melee attack so everything that walks through it is burned?
SpaceMarine Wrote:I am going to make a flamethrower for my game. Is it possible to make the projectiles (flames) spawn an object (more fire) when they hit something, and then have that object spawn a short-range melee attack so everything that walks through it is burned?

No, spawning objects is too heavy to do it on the fly. This might actually take some changes in the core; you could probably fake it with a lot of scripting but might never get it right.

Do you want damage or the object to actually catch on fire?

[>] Brian
Misread the post -- Can't you just spawn a melee off of the projectile instead of destroying it on impact, then destroy it afterwards?
I wanted it to be so that if you hit a wall or floor with the flame stream, it would make some flames come and stay there for 10-20 seconds, burning anything that ran through them. The object that ran through the fire would not catch on fire though.
That can be done. Use the stick command (its in the mine script) when it hits a wall or floor, then set a timer at about 1/3 of a second. Every time it goes off have it spawn a melee, and after it goes off say 30 times, then destroy the projectile. Though from what you say it sounds more like napalm than a flamethrower. Rolleyes
Btw the last sentence in your post makes no sense. You want the object that shot it to not get hurt?
I mean that if someone ran through the fire, they would take damage from the melee attacks, but they would not have the flames stick to them.
SpaceMarine Wrote:I mean that if someone ran through the fire, they would take damage from the melee attacks, but they would not have the flames stick to them.

What Gordon says would work, though it would be exactly flame thrower like. One other thing you could do is setup a timer when the fire DOWN event comes in, and stop it when the fire UP event comes in.

In this timer, keep re-launching particle effects and melees at a certain rate (like maybe every 1/2 a second, to many and everything else would slow down.) This will give you a "press and hold" flamethrower like effect.

You can do this same thing without a timer by setting up a repeating fire (look at the machine gun) and relaunching on the repeat instead of a timer (which would probably be easier.) Work on the timing so it looks more consistent then "stutter-y".

[>] Brian
So make a weapon that shoots projectiles that spawn particle effects and melee attacks, and stick to things when they hit. sounds good.
Reference URL's