View unanswered posts | View active topics It is currently Thu Jul 18, 2019 10:16 am



Reply to topic  [ 11 posts ] 
 Two parralel bullets in a single shot 
Author Message
User avatar

Joined: Wed Aug 04, 2010 2:31 pm
Posts: 216
Reply with quote
Post 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?


Fri May 23, 2014 12:36 pm
Profile
User avatar

Joined: Wed Sep 09, 2009 3:16 am
Posts: 3029
Location: Somewhere in the universe
Reply with quote
Post 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)


Fri May 23, 2014 5:35 pm
Profile WWW
User avatar

Joined: Wed Aug 04, 2010 2:31 pm
Posts: 216
Reply with quote
Post Re: Two parralel bullets in a single shot
Im struggling to implement it could i get an example?


Thu Jun 05, 2014 4:09 pm
Profile

Joined: Fri Nov 23, 2012 5:42 am
Posts: 143
Reply with quote
Post 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.


Last edited by clunatic on Sat Jun 14, 2014 11:23 am, edited 1 time in total.



Thu Jun 05, 2014 5:02 pm
Profile
User avatar

Joined: Wed Aug 04, 2010 2:31 pm
Posts: 216
Reply with quote
Post 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. :)


Thu Jun 05, 2014 6:15 pm
Profile
User avatar

Joined: Thu Jan 02, 2014 10:59 pm
Posts: 15
Location: Somewhere reading books.
Reply with quote
Post 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 86 times
Sat Jun 14, 2014 1:15 am
Profile
User avatar

Joined: Wed Sep 09, 2009 3:16 am
Posts: 3029
Location: Somewhere in the universe
Reply with quote
Post 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.


Sat Jun 14, 2014 1:31 am
Profile WWW
User avatar

Joined: Thu Jan 02, 2014 10:59 pm
Posts: 15
Location: Somewhere reading books.
Reply with quote
Post Re: Two parralel bullets in a single shot
Ah, I see! Thanks for the help in both instances.


Sat Jun 14, 2014 2:39 am
Profile
User avatar

Joined: Sun Jan 28, 2007 10:32 pm
Posts: 1609
Location: UK
Reply with quote
Post 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.


Sat Jun 14, 2014 9:15 am
Profile YIM

Joined: Fri Nov 23, 2012 5:42 am
Posts: 143
Reply with quote
Post 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.


Sat Jun 14, 2014 11:22 am
Profile
User avatar

Joined: Wed Sep 09, 2009 3:16 am
Posts: 3029
Location: Somewhere in the universe
Reply with quote
Post Re: Two parralel bullets in a single shot
No problemo. Not really a big deal, everyone makes mistakes anyways.


Sun Jun 15, 2014 5:33 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 11 posts ] 

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.035s | 15 Queries | GZIP : Off ]