View unanswered posts | View active topics It is currently Tue Apr 23, 2024 1:00 pm



Reply to topic  [ 21 posts ]  Go to page 1, 2  Next
 Gun Coding 
Author Message
User avatar

Joined: Mon Feb 11, 2008 4:45 am
Posts: 69
Reply with quote
Post Gun Coding
I've been trying to follow the "Modders Bible", and every time I load up CC I get an error. It doesn't tell me what the error is, all it tells me is that CC has encountered an error and needs to close.

I'm pretty sure I followed every step correctly, but I can never get my gun to load correctly. Can I get some help? The file attached is the gun sprite.


Attachments:
Gauss Rifle 000.bmp [6.62 KiB]
Downloaded 45 times
Sun Apr 12, 2009 8:21 am
Profile
User avatar

Joined: Wed Jan 07, 2009 10:26 am
Posts: 4074
Location: That quaint little British colony down south
Reply with quote
Post Re: Gun Coding
Set FrameCount = 0
Take the 000 from the name.


Sun Apr 12, 2009 8:22 am
Profile WWW
User avatar

Joined: Mon Feb 11, 2008 4:45 am
Posts: 69
Reply with quote
Post Re: Gun Coding
I get the same error...you didn't really tell me anything from that other than take away the 000.


Sun Apr 12, 2009 8:30 am
Profile
User avatar

Joined: Wed Jan 07, 2009 10:26 am
Posts: 4074
Location: That quaint little British colony down south
Reply with quote
Post Re: Gun Coding
Okay, so it doesn't return any error apart from the needs to close?
Have you set MuzzleFlash = None if it is appropriate?


Sun Apr 12, 2009 8:37 am
Profile WWW
User avatar

Joined: Mon Feb 11, 2008 4:45 am
Posts: 69
Reply with quote
Post Re: Gun Coding
I'm using what the Modders Bible New Persons Guide is giving me, which isn't much.

This is all what it told me put.

Code:
AddDevice = HDFirearm
   InstanceName = Guass Rifle
   GetsHitByMOs = 1
   SpriteFile = ContentFile
            FilePath = StarCraft.rte/Gauss Rifle.bmp
   AtomGroup = AtomGroup
            AutoGenerate = 1
            Material = Material
              CopyOf = Military Stuff
            Resolution = 2
            Depth = 0
   Magazine = Magazine
            CopyOf = Magazine Pistol
   RateOfFire = 500
   Set FrameCount = 0


Sun Apr 12, 2009 8:39 am
Profile
User avatar

Joined: Wed Jan 07, 2009 10:26 am
Posts: 4074
Location: That quaint little British colony down south
Reply with quote
Post Re: Gun Coding
That's missing ALOT.
Try looking at the Base.rte .ini s to see what you're missing. You're missing tonnes...
The error you're getting is because you're not giving about 2/3rds of the neccessary values...
Code:
AddDevice = HDFirearm   //Defines as a weapon
   PresetName = <Name of weapon>   //Defines the name of the weapon. This shows up in the buy menu and is used to reference the weapon later on, but you don't really have to worry about it now. Try to get a somewhat unique name to save difficulty
   AddToGroup = Weapons   //Good idea to have
   Mass = <Mass of weapon>   //How much the thing weighs, in kilograms.
   HitsMOs = <1/0>   //Whether or not you can push things with the gun
   GetsHitByMOs = <1/0>   //Whether or not the gun can get hit by bullets
   SpriteFile = ContentFile   //Tells the game the next tabbed bit is your sprite
      FilePath = <Filepath>   //Sprite filepath
   FrameCount = 1   //How many frames, don't worry about this yet
   SpriteOffset = Vector   //Where the centre of gravity of the gun is
      X = <X>   //Defined. This shouldn't be too hard if you did basic maths. The origin is the top left pixel, the X axis is inverted
      Y = <Y>   //Defined.
   EntryWound = AEmitter
      CopyOf = <Name of wound>   //Wounds for your weapon, just use Dent Metal for now
   ExitWound = AEmitter
      CopyOf = <Name of wound>
   GoldValue = <Cost>   //How much it costs, in gold
   AtomGroup = AtomGroup
      AutoGenerate = 1
      Material = Material
         CopyOf = Military Stuff   //What it's made of, just use Military Stuff for now
      Resolution = 4
      Depth = 0
   DeepGroup = AtomGroup
      AutoGenerate = 1
      Material = Material
         CopyOf = Military Stuff   //Deep group, see last comment
      Resolution = 4
      Depth = 10
   DeepCheck = 1   //Ignore
   JointStrength = 75   //How hard you hold it, bigger number=harder to drop
   JointStiffness = 0.5   //If someone lands on your gun, how much of the force goes to your arm.
   JointOffset = Vector
      X = <X>   //Where the gun is held, relative to the SpriteOffset, X is not inverted, Y is.
      Y = <Y>
   DrawAfterParent = <1/0>   //Whether the gun is in front of the guy or not.
   OneHanded = <1/0>   //One handed, if yes then you can use it with a shield
   StanceOffset = Vector
      X = <X>   //Where the shoulder is when the gun is held, relative to the JointOffset. X is inverted, Y is
      Y = <Y>
   SharpStanceOffset = Vector
      X = <X>   //Where the shoulder is when Sharp Aiming, the thing with the three yellow dots.
      Y = <Y>
   SupportOffset = Vector
      X = <X>   //Where the second hand is, relative to SpriteOffset
      Y = <Y>
   SharpLength = <Number>   //How far you can see with the Sharp Aim
   Magazine = Magazine
      CopyOf = <Magazine>   //What magazine to use, this will define what it fires. You'll need your own magazine if you want a decent weapon
   Flash = Attachable
      CopyOf = <Muzzle Flash>   //What Muzzle Flash to use, if there isn't one then usse "Flash = None"
   RateOfFire = <Number>   //How many rounds you can get off in, say, a minute, I'm not sure
   ReloadTime = <Number>   //How long a reload takes, in Milliseconds
   FullAuto = <1/0>   //Full Auto or Semi Auto
   FireIgnoresThis = <1/0>   //Whether bullets will hit the gun if they intersect, I reccomend 1
   ShakeRange = 13   //How shaky your hands are when you hold it
   SharpShakeRange = 3   //Above, but when Sharp Aiming
   NoSupportFactor = 1.5   //No idea
   ParticleSpreadRange = 3   //How innaccurate th bullets are
   ShellSpreadRange = 8   //How the shells come out, ignore this for now
   ShellAngVelRange = 2   //See above
   MuzzleOffset = Vector
      X = <X>   //Where the bullets fly out, X is not inverted, Y is. Relative to SpriteOffset
      Y = <Y>
   EjectionOffset = Vector
      X = <X>   //Where the casings fly out, see above
      Y = <Y>
This should give you a working weapon. The next step is to define your own bullets and magazine to load into the weapon. Then to add effects, gibs and sounds.


Sun Apr 12, 2009 8:49 am
Profile WWW
User avatar

Joined: Mon Feb 11, 2008 4:45 am
Posts: 69
Reply with quote
Post Re: Gun Coding
Regardless of what I add or remove, I still get the same error in the same place of the load screen. I have no idea what I'm doing wrong.


Sun Apr 12, 2009 9:16 am
Profile
User avatar

Joined: Wed Jan 07, 2009 10:26 am
Posts: 4074
Location: That quaint little British colony down south
Reply with quote
Post Re: Gun Coding
See above post. You need to replace everything in triangle brackets with some values and you should get a somewhat working weapon. Then you just need to make your own Magazine and Rounds.


Sun Apr 12, 2009 9:19 am
Profile WWW
User avatar

Joined: Mon Feb 11, 2008 4:45 am
Posts: 69
Reply with quote
Post Re: Gun Coding
And I did just that, yet I still get an error.


Sun Apr 12, 2009 9:26 am
Profile
User avatar

Joined: Wed Jan 07, 2009 10:26 am
Posts: 4074
Location: That quaint little British colony down south
Reply with quote
Post Re: Gun Coding
Show us your code please...


Sun Apr 12, 2009 9:35 am
Profile WWW
User avatar

Joined: Sun Jul 13, 2008 9:57 am
Posts: 4886
Location: some compy
Reply with quote
Post Re: Gun Coding
CC crashes like that sometimes if you doubledefine a presetname. upload your mod so someone can debug it please.


Sun Apr 12, 2009 11:12 am
Profile WWW
User avatar

Joined: Wed Jan 07, 2009 10:26 am
Posts: 4074
Location: That quaint little British colony down south
Reply with quote
Post Re: Gun Coding
I've found that double defining a presetname just overwrites it.


Sun Apr 12, 2009 11:17 am
Profile WWW
User avatar

Joined: Sun Dec 09, 2007 3:08 pm
Posts: 481
Location: Islamic Republic of Bradistan, Yorkshire, England
Reply with quote
Post Re: Gun Coding
One thing though, it's not the X that's inverted, it's the Y. That's what I find anyway.


Sun Apr 12, 2009 11:51 am
Profile
User avatar

Joined: Wed Jan 07, 2009 10:26 am
Posts: 4074
Location: That quaint little British colony down south
Reply with quote
Post Re: Gun Coding
It depends on what you're doing. Alot. Like ridiculously. This is why everyone hates offsets.


Sun Apr 12, 2009 11:58 am
Profile WWW
User avatar

Joined: Sun Jul 13, 2008 9:57 am
Posts: 4886
Location: some compy
Reply with quote
Post Re: Gun Coding
y is "inverted" (negative is up) and x is not (negative is left) always. for limbs, it just seems different because the sprites are rotated. i still hate offsets though, that stupid engineer has ♥♥♥♥ 5 attachables on the body, one of them is a sub attachable and rawr. then all the gib offsets.. ><


Sun Apr 12, 2009 12:21 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 21 posts ]  Go to page 1, 2  Next

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