Data Realms Fan Forums
http://forums.datarealms.com/

Two parralel bullets in a single shot
http://forums.datarealms.com/viewtopic.php?f=1&t=45715
Page 1 of 1

Author:  Cybernetic [ Fri May 23, 2014 12:36 pm ]
Post subject:  Two parralel bullets in a single shot

As i understand shotguns fire multiple bullets from one point but giving each a different angle. Is it possible to fire multiple bullets from different points of the gun as with the repeater where the bullets are parallel but unlike the repeater these bullets are all fired at once. Is this possible and if so how can i go about doing so?

Author:  dragonxp [ Fri May 23, 2014 5:35 pm ]
Post subject:  Re: Two parralel bullets in a single shot

Using two AEmitter attached to a(n) MOSRotating/AEmitter at the distance apart you would like.
Your gun would fire the MOSRotating/AEmitter and the AEmitters attached would emit the desired particles. (Which can include smoke and etc)

Author:  Cybernetic [ Thu Jun 05, 2014 4:09 pm ]
Post subject:  Re: Two parralel bullets in a single shot

Im struggling to implement it could i get an example?

Author:  clunatic [ Thu Jun 05, 2014 5:02 pm ]
Post subject:  Re: Two parralel bullets in a single shot

This is actually a briliant way to solve this problem. I was thinking you'd have to use lua and complex trigonometry to get a gun to fire parralel bullets, but using AEMitters attached to a MOSRotating is a briliant way of letting cortex command do all the hard work for you.

Please excuse the terrible example sprite:
Image

What you want is for the gun to fire a MOSRotating, the red bar, (that doesn't do anything) with 2 AEMitters attached, the blue bars, that emmit the actual particles that do damage (the green lines).

Code wise you need something like this:

(Note if copy/pasting from these forums into an ini file, you'll need to change the spaces in front of each line to tabs)

You'll need to put in all the names and probably also tweak various values, especially for the emitted particle. The parent offsets for the AEmitters might need to be tweaked as well. The AIFireVel and AILifeTime may not be needed at all, these are used purely by the ai for figuring out how to aim a weapon.

Edit: Fixed the code errors.

Author:  Cybernetic [ Thu Jun 05, 2014 6:15 pm ]
Post subject:  Re: Two parralel bullets in a single shot

Thank you so much for the help! :D I thought i was just trying my luck when i requested an example. You will soon see this well used Thanks. :)

Author:  Lobsterman [ Sat Jun 14, 2014 1:15 am ]
Post subject:  Re: Two parralel bullets in a single shot

I know it's not a good idea to necro, but I didn't want to create a new thread to ask the same question again.

I used the template posted here to create a large weapon that fires 5 bullets at the same time, but before I have a chance to test it in-game, I get an error:

"Wrong type in Reader when passed to Serializable::Create() Error happened in Taipan.rte/Taipan/Devices/Taipan.ini at line 93!"

So, what exctly does this mean, and how could I fix it?
Included is the file so you can see exactly what's going on.

Attachments:
File comment: Here's the file.
Taipan.zip [525.9 KiB]
Downloaded 359 times

Author:  dragonxp [ Sat Jun 14, 2014 1:31 am ]
Post subject:  Re: Two parralel bullets in a single shot

Clunatic made a mistake in the example code.

On line 93 the line AddAttachable = AEmitter is written.
You just need to correct all instances of this mistake to AddEmitter = AEmitter

An easy mistake to make, probably because Clunatic wrote it without testing. Although we're all prone to these mistakes. Very difficult to compile the code without any errors present.

Also, it isn't objectively "bad" to "necro" a thread. As long as what you have to say is relevant to the thread or if you have similar problems and voice them accordingly then it's okay to revive a thread. A "bad" necro would've been something like saying "you're dumb" or contributing almost nothing. Eg. Mod thread comment: "Awesome". As long as you feel that what you have to say is worthwhile, say it.

Author:  Lobsterman [ Sat Jun 14, 2014 2:39 am ]
Post subject:  Re: Two parralel bullets in a single shot

Ah, I see! Thanks for the help in both instances.

Author:  Arcalane [ Sat Jun 14, 2014 9:15 am ]
Post subject:  Re: Two parralel bullets in a single shot

Lobsterman wrote:
I know it's not a good idea to necro, but I didn't want to create a new thread to ask the same question again.


One week totally doesn't count, especially if you have a legitimate question related to the topic at hand, or something constructive and useful to add.

As a sidenote for anyone working on this, don't do what I did and have an aemitter that makes emits a bullet straight ahead, plus ones offset directly above and directly below 0,0. I forget if this was through having only one AE with emissionoffsets, or a nested setup - I think it was the former. The MOSRot base sidesteps the issue neatly though, by the looks of things.

Anyway, what I ended up with a gun that shot in a sort of a 'T' shape (one straight forwards, one up, one down), which was kinda silly. I think I tried shifting them forwards a step and ended up with a gun that shot in a kind of \|/ pattern which was equally awkward.

Author:  clunatic [ Sat Jun 14, 2014 11:22 am ]
Post subject:  Re: Two parralel bullets in a single shot

Oops, my bad :oops:

Like Dragonxp said I never bothered to test the code, but since it was copy/pasted/edited from a working mod of mine I thought that would be fine. I just completely forgot about the "AddEmitter" code. Anyway, I'll fix it in my original example, for any future explorers. Thanks for correcting me, Dragonxp.

Author:  dragonxp [ Sun Jun 15, 2014 5:33 am ]
Post subject:  Re: Two parralel bullets in a single shot

No problemo. Not really a big deal, everyone makes mistakes anyways.

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/