Game Development Community

Creating multiple projectiles/Projectile spread

by Gary Fieldman · in Torque Game Engine · 01/18/2003 (7:03 pm) · 6 replies

This is driving me nuts, but it is needed for the game we are currently developing. First off, I went scouring the forums for a solution and the closest I could find was an ancient post on creating a matrix to be able to get projectiles to spread here:

http://www.garagegames.com/index.php?sec=mg&mod=forums&page=result.thread&qt=2138

As this did not work at all, I find myself going crazy trying to figure this out. Does the engine have support for multiple mounts firing at the same time? Can multiple projectiles be fired (shotgun effect) from one single weapon? Can multiple projectiles be fired from the same gun in a stream without adjusting the weapon's intial firing rate?

If you guys know and can lend a hand, it would be much appreciated. Also, if this has been done it would be great to know how you were able to implement this.

Is it possible without modding the engine? I would perfer to figure out how to script this.

Thanks in advance.

#1
01/18/2003 (7:26 pm)
Have you checked out this resource?

http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=1714

Hope this helps :)
#2
01/18/2003 (7:46 pm)
Umm, yeah you are a god. Yay! Got it working. Only had to adjust the line:

if(%projectile.isShotGun)

to

if(%this.isShotGun)

and it worked like a charm for the shotgun effect.

Hot Damn, thanks a ton.
#3
01/18/2003 (7:54 pm)
On the other questions, how can you get the player to shoot 4 mount points simulatneously?
#4
01/20/2003 (9:35 am)
Bump, anyone know?
#5
01/20/2003 (1:41 pm)
I'm assuming you mean activate 4 mounted images at once, so...

Do:

%player.setImageTrigger(,);

I did this with a few multi-image T2 guns I made. Just a note, the slots that are keyboard/mouse controlled (like gun and pack) take inputs from there only, so this method doesnt really work for the first few slots. If you do this operation on a slot, you also have to make sure you turn it off when you want to turn it off, or else you will keep shooting all day long. With some complex state sequences, you can make this pretty seamless though.

There are some other things that can get in the way of using this method. For the non-main slot gun I'd heavily simplify the states and use the main gun as a kind of controller. Also, you have to make sure they think they are loaded. Just make a new onMount for each of the little added images that does a %player.setImageAmmo(%slot,true); for that slot.
#6
01/21/2003 (8:07 am)
Ok. We have built 4 mounting points for weapons, and would perfer to allow the player to shoot simultaneously from them. They will all be the same image, Thanks. I 'll give it a whirl and let you know.