View unanswered posts | View active topics It is currently Tue Mar 19, 2024 5:39 am



Reply to topic  [ 14 posts ] 
 Making guns shoot explosive projectiles 
Author Message
User avatar

Joined: Thu May 03, 2007 4:38 pm
Posts: 121
Location: I am nowhere, yet everywhere.. (Including behind you)
Reply with quote
Post Making guns shoot explosive projectiles
I could use a little modding enlightenment. I was wondering, how could you make guns shoot exploding projectiles? Could someone give me an example of what code I would need to put in to a weapon file to get it to shoot grenades or some other explosive projectile?


Fri Jul 13, 2007 10:42 pm
Profile

Joined: Mon Dec 04, 2006 3:34 am
Posts: 2378
Reply with quote
Post Re: Making guns shoot explosive projectiles
You could always look
at the Long Cannon code or
is it Flak Cannon?


Fri Jul 13, 2007 10:58 pm
Profile
Banned
User avatar

Joined: Tue Feb 27, 2007 4:05 pm
Posts: 2527
Reply with quote
Post Re: Making guns shoot explosive projectiles
For reasons I have not exactly figured out, the Frag Shell (round for the Flak Cannon) only detonates in an arc when fired by the Flak Cannon.

Anyone have any idea why this is?


Sat Jul 14, 2007 4:20 am
Profile YIM

Joined: Mon Dec 04, 2006 3:34 am
Posts: 2378
Reply with quote
Post Re: Making guns shoot explosive projectiles
Uh, momentum.


Sat Jul 14, 2007 4:22 am
Profile
User avatar

Joined: Thu May 03, 2007 4:38 pm
Posts: 121
Location: I am nowhere, yet everywhere.. (Including behind you)
Reply with quote
Post Re: Making guns shoot explosive projectiles
Also all teh 1337 c0d1ng in the Flak Cannon confuses my tiny mind. Could someone paste example explosive bullet code here and walk me through how it works?


Sat Jul 14, 2007 3:12 pm
Profile
User avatar

Joined: Tue Dec 05, 2006 1:21 am
Posts: 432
Reply with quote
Post Re: Making guns shoot explosive projectiles
Let me give you a basic idea, without the code, of how the flak cannon works. First, a standard TDexplosive with a timer is defined, in this case, Frag Shell. Then, the ammunition is made. However, rather than defining an MOPixel, the code uses a CopyOf to take all the information of the Frag Shell previously defined. Then, it's the same as other guns. A magazine is defined, it uses the round information that you just made, gun defined, etc.

The code should be in Base.rte/Devices/Flak Cannon or whatever the folder is for the Flak Cannon. It's probably Cannons or something.


Sat Jul 14, 2007 4:46 pm
Profile WWW
User avatar

Joined: Thu May 03, 2007 4:38 pm
Posts: 121
Location: I am nowhere, yet everywhere.. (Including behind you)
Reply with quote
Post Re: Making guns shoot explosive projectiles
*Whoosh sound as NFS's post goes over my head* Bwuh? Thanks for putting the effort into helping me but I didn't understand any of that :/


Sun Jul 15, 2007 2:12 pm
Profile

Joined: Sun Jun 24, 2007 6:13 am
Posts: 505
Reply with quote
Post Re: Making guns shoot explosive projectiles
Meh, then I wouldn't suggest making a cannon one of your first mods( I assume?), as they're pretty mucyh the hardest thing to do besides vehicles.


Sun Jul 15, 2007 4:40 pm
Profile

Joined: Mon Dec 04, 2006 3:34 am
Posts: 2378
Reply with quote
Post Re: Making guns shoot explosive projectiles
My first mod aside from brain edits was a modification of the Cannon...


Sun Jul 15, 2007 8:08 pm
Profile

Joined: Sun Jun 24, 2007 6:13 am
Posts: 505
Reply with quote
Post Re: Making guns shoot explosive projectiles
Yeah, but what build was this?


Sun Jul 15, 2007 8:09 pm
Profile
User avatar

Joined: Wed Nov 22, 2006 3:19 pm
Posts: 2073
Reply with quote
Post Re: Making guns shoot explosive projectiles
8, if not then 7, cause seperate RTEs came in build 8
My firsrt mod was a gun, also for build 8


Sun Jul 15, 2007 8:11 pm
Profile

Joined: Mon Dec 04, 2006 3:34 am
Posts: 2378
Reply with quote
Post Re: Making guns shoot explosive projectiles
Uh... B9... back when it was the Long Cannon. Nothing has really changed about it.
As long as you look over the code and find out the path the dependencies take it's simple.

EDIT : Might have been B8.


Sun Jul 15, 2007 8:12 pm
Profile

Joined: Sun Jun 24, 2007 6:13 am
Posts: 505
Reply with quote
Post Re: Making guns shoot explosive projectiles
Yeah, but not everyone's a genius, Alenth.


Sun Jul 15, 2007 8:33 pm
Profile
User avatar

Joined: Fri Jun 15, 2007 7:19 am
Posts: 94
Reply with quote
Post Re: Making guns shoot explosive projectiles
What's so hard about a Cannon?
The TDExplosive? The fragments?

Also, to Sithlordz... (This is a description of the dependencies Alenth mentioned)
When you're editing a weapon, look for this:
Code:
   RoundCount = 3
   RTTRatio = 0
   RegularRound = Round
      CopyOf = Round Cannon
   TracerRound = None

This is found in the Magazine, which is usually in the same .ini as the weapon.
The "RegularRound" is the type of object that's being fired. It's always a 'Round'. The "CopyOf" is more important. That determines what 'Round' you're firing. In this example, it's the 'Round Cannon'.

Let's zoom over to the Round Cannon (it's in ammo.ini).
Code:
   InstanceName = Round Cannon
   ParticleCount = 1
   Particle = TDExplosive
      CopyOf = Frag Shell
   Shell = MOSRotating
      CopyOf = Cannon Casing
   FireVelocity = 90
   ShellVelocity = 10
   Separation = 5

Most of these determine aspects about the round that are necessary for a weapon to know when it fires the round. What you're looking for is the "Particle". That determines the type of 'Particle' that will be fired. For the cannon, it's a 'TDExplosive'. Again, the "CopyOf" is more important, as it determines what 'TDExplosive' will be used when the Round is fired. In this case, it's the 'Frag Shell', the thing that you see when you fire the Flak Cannon in-game.

You can look for the Frag Shell in ammo.ini as well. It's a good example of a TDExplosive that detonates after a short time.

Warning, block o' text!
To change what a weapon fires, you first make the Particle. If it's a bomb or grenade, it's a TDExplosive. If it's a bullet, it's an MOPixel. Other choices are MOSParticle and MOSRotating. Then you give the particle a unique "Instancename" (it's just a name, really). Then you make a round for it (give it a unique instancename), and set the Round's "Particle" to the type of Particle, and the "CopyOf" to the Particle's Instancename. Then you go to the weapon's Magazine, and set the "RegularRound" to the Round's instancename.

(TracerRounds are made the same way. Tracers fire once for every few times the regular round fires, as determined by RTTRatio.)


Sun Jul 15, 2007 10:14 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 14 posts ] 

Who is online

Users browsing this forum: Google [Bot]


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:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.722s | 16 Queries | GZIP : Off ]