View unanswered posts | View active topics It is currently Thu Jan 09, 2025 10:41 pm



Reply to topic  [ 7 posts ] 
 Firing an explosion out of a gun 
Author Message
User avatar

Joined: Wed Jan 03, 2007 12:48 am
Posts: 163
Reply with quote
Post Firing an explosion out of a gun
I've made what is essentially an explosion cannon, but my current method of firing the debris/fire/etc is not working as well as I'd like. I've basically just got a grenade launcher that fires a shell very quickly with a minuscule delay, and all the shrapnel has InheritsVel = 1.

The problem is that in close combat, the shell will occasionally bounce off a wall or person and end up just killing everyone, or sometimes just the firer.
While funny, this is undesired.

Is there a better way to go about having a gun fire more than just bullets at one time?


Fri Jul 31, 2009 8:25 pm
Profile
User avatar

Joined: Wed Nov 22, 2006 3:19 pm
Posts: 2073
Reply with quote
Post Re: Firing an explosion out of a gun
You can use an AEmitter.


Fri Jul 31, 2009 8:26 pm
Profile
User avatar

Joined: Fri Feb 16, 2007 8:43 pm
Posts: 1695
Location: AH SHIT FUCK AUGH
Reply with quote
Post Re: Firing an explosion out of a gun
Remove the "TriggerDelay" line entirely, that will likely shave off one frame. Alternatively, do that AEmitter thing that MaximDude suggested, though this will make the shots always travel at the same speed when fired, due to them not inheriting your own velocity. This method is used for the Coalition Heavy Sniper, so you can just look at that for a template.


Fri Jul 31, 2009 9:25 pm
Profile WWW
User avatar

Joined: Wed Jan 03, 2007 12:48 am
Posts: 163
Reply with quote
Post Re: Firing an explosion out of a gun
Alright, I'll give that a whirl. Thanks!

Shook wrote:
though this will make the shots always travel at the same speed when fired, due to them not inheriting your own velocity.

Actually, I meant that I gave the gibs a velocity inheritance, not the bomb. I'd prefer that the bomb not inherit my velocity :D




EDIT: Wow I'm stupid. I changed the explosive to an emitter about a month ago, I just forgot I did so. Would there be any other way to lower it's time as a physical object, and make it explode at the exact moment I fire the weapon?

Also, I just played around some more and I made the explosion over 33 milliseconds earlier, yay.


Mon Aug 03, 2009 4:55 am
Profile
REAL AMERICAN HERO
User avatar

Joined: Sat Jan 27, 2007 10:25 pm
Posts: 5655
Reply with quote
Post Re: Firing an explosion out of a gun
function Create(self)
self:GibThis();
end

Best you can do.


Mon Aug 03, 2009 11:32 pm
Profile
User avatar

Joined: Wed Jan 03, 2007 12:48 am
Posts: 163
Reply with quote
Post Re: Firing an explosion out of a gun
I don't know any lua. Could you please tell me how to use that code?


Wed Aug 05, 2009 6:33 am
Profile
REAL AMERICAN HERO
User avatar

Joined: Sat Jan 27, 2007 10:25 pm
Posts: 5655
Reply with quote
Post Re: Firing an explosion out of a gun
Put that in <whateverscriptname>.lua, save it in your .rte.

On your projectile, the actual particle (not the round) add this line:

ScriptPath = your.rte/anyfolders/<whateverscriptname>.lua


Wed Aug 05, 2009 6:35 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 7 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.032s | 13 Queries | GZIP : Off ]