Author |
Message |
The_Blog
Joined: Tue Sep 20, 2011 10:03 pm Posts: 14
|
Making an Automatic Gun. Help?
Hi everyone,
I need some help. I just started to add some guns to Cortex Command. Now I just found out how to create a simple pistol, but I don't get how to make an automatic gun like an Assault Rifle or a Sub Machine Gun.
Maybe some could help me.
I'm from Germany so my English skills are not really well.
The_Blog
|
Tue Sep 20, 2011 10:21 pm |
|
|
Duh102
happy carebear mom
Joined: Tue Mar 04, 2008 1:40 am Posts: 7096 Location: b8bbd5
|
Re: Making an Automatic Gun. Help?
There's a property in HeldDevice definitions named FullAuto, set it to 1: FullAuto = 1
|
Wed Sep 21, 2011 7:16 pm |
|
|
The_Blog
Joined: Tue Sep 20, 2011 10:03 pm Posts: 14
|
Re: Making an Automatic Gun. Help?
I got. *facepalm* Now my Gun works fine but I have another problem. When I try to make the offsets my gun started looking weird. I looked through some tutorials but I don't get it. Screenshot: Here is the .rte: http://www.mediafire.com/?4blkx551hz91x4l(This weapon sprite is not my work!) The_Blog
|
Wed Sep 21, 2011 7:50 pm |
|
|
Duh102
happy carebear mom
Joined: Tue Mar 04, 2008 1:40 am Posts: 7096 Location: b8bbd5
|
Re: Making an Automatic Gun. Help?
The held offsets are somewhat guesswork, you just have to play with them until they look right. +x is right, +y is down for those.
SpriteOffset, MuzzleOffset, and MagazineOffset, or whatever the last one is called, are more fomulaic. SpriteOffset is simply -(sprite width/2), -(sprite height/2), rounding to the nearest pixel. The other two are then however many pixels you need to go from the middle of the sprite to wherever on the gun you want them to go, using the same +x,+y for right,down.
|
Thu Sep 22, 2011 5:26 am |
|
|
Asatruer
Joined: Thu May 28, 2009 3:59 pm Posts: 209
|
Re: Making an Automatic Gun. Help?
Azukki made a good offset tutorial here viewtopic.php?f=1&t=19092
|
Thu Sep 22, 2011 5:56 am |
|
|
The_Blog
Joined: Tue Sep 20, 2011 10:03 pm Posts: 14
|
Re: Making an Automatic Gun. Help?
I created a new gun based on the SMG Code (MP5), to test it. But it's still weird. I understand what you said Duh 102 ,but in my case it seems to be inverted O.o So that +x and +y are left and up. Also there are some other strange things, but after a while I made it:
|
Thu Sep 22, 2011 4:28 pm |
|
|
Azukki
Joined: Sat Nov 03, 2007 9:44 pm Posts: 1916 Location: Flint Hills
|
Re: Making an Automatic Gun. Help?
Here's an explanation for the offsets you wound up with, when you uploaded your mod. Code: SpriteOffset = Vector X = -12 //the center of mass will be 12 rightward and Y = -5 // 5 downward, from the top left corner of the sprite JointOffset = Vector X = -6 // the primary hand will hold the gun in a position 6 leftward Y = 3 // and 3 downward, from the sprite offset position SupportOffset = Vector X = 7 //the support hand will hold the gun in a position 7 rightward Y = 3 //and 3 downward, from the sprite offset position MuzzleOffset = Vector X = 14 //the muzzle of the device will be in a position 14 rightward Y = 1 // and 1 downward, from the sprite offset position EjectionOffset = Vector X = -5 //the ejection port of the device will be in a position 5 leftward Y = 1 // and 1 downward, from the sprite offset position StanceOffset = Vector X = -12 //when sharp aiming, the FG hand of the operator of the device will be 12 leftward Y = 1 // and one downward, from that arm's joint offset, ei, his shoulder SharpStanceOffset = Vector X = -9 //when not sharp aiming, the FG hand of the operator of the device will be 9 leftward Y = 1 // and one downward, from that arm's joint offset, ei, his shoulder This applies when facing rightward, so holding the gun with a stance 12 or 9 leftward is the most obvious problem. And also, its seems that none of the other offsets are exactly at the positions I'm guessing you wanted them. You could just tweak it to what you want, or leave it as is if it's good enough, but I'd suggest marking off where you want each one on a copy of the sprite, and then following my guide to get them right where you marked them.
Attachments:
File comment: Visualizing offsets as being boxes with the dimensions of the offset, overlapping the intended position's pixel and touching corners with the pixel of the base position (where it's offset from [usually the sprite offset]) has always helped me.
outsetwalkthrough.bmp [ 344.99 KiB | Viewed 5162 times ]
|
Thu Sep 22, 2011 6:36 pm |
|
|
The_Blog
Joined: Tue Sep 20, 2011 10:03 pm Posts: 14
|
Re: Making an Automatic Gun. Help?
Ok Thanks. I think I got it now. The only thing I dont really get is StanceOffset and SharpStanceOffset. Cause you don't know on wich position your shoulder is. But that's not a great problem. But why this only applies wehn facing rightwards? It's looking like this now:
|
Thu Sep 22, 2011 11:28 pm |
|
|
Azukki
Joined: Sat Nov 03, 2007 9:44 pm Posts: 1916 Location: Flint Hills
|
Re: Making an Automatic Gun. Help?
Because when you face leftward, it gets flipped. Increasing Xs would be leftward, rather than rightward, and vice versa.
So it's not so much rightward, really, but forward, towards where the gun is pointed. But in the sprite, it points rightward.
And the stances are just where the primary hand (holding the gun at the joint offset) is in relation to primary shoulder, I think. Sharp stance for when you're sharp aiming, the other stance when you're not.
|
Fri Sep 23, 2011 2:10 am |
|
|
The_Blog
Joined: Tue Sep 20, 2011 10:03 pm Posts: 14
|
Re: Making an Automatic Gun. Help?
AAAAAnnnnddd another problem ^^ I tried to make a Energy Pistol which has infinite ammo and more than one frame. Also the gun is supposed to have an Bullet with anown sprite. Not just a created line like in MOPixels. So I tried to make some with MOSParticle. It wasn't animated so I reduced it to just one frame. But the gun itself doesn't change theire frame. It just stuck in the first frame. Yes its firering but without the animation. Here is the .ini and the Files: The_Blog
|
Fri Sep 23, 2011 9:05 pm |
|
|
Azukki
Joined: Sat Nov 03, 2007 9:44 pm Posts: 1916 Location: Flint Hills
|
Re: Making an Automatic Gun. Help?
Unless you do something special with it (scripting, or using the the ini variables used on the coalition gatling gun) the sprites of guns will always just animate between the first and second frame, with the second frame displaying for the frame of firing.
You've got three frames, so that last one's doing nothing.
It looks like what you're animating on the gun is really just a muzzle flash sort of effect, so maybe you should just make a custom muzzle flash attachable instead of animating the gun itself.
|
Fri Sep 23, 2011 11:53 pm |
|
|
The_Blog
Joined: Tue Sep 20, 2011 10:03 pm Posts: 14
|
Re: Making an Automatic Gun. Help?
Ya, sounds good. I will try it. Thanks for your help. Do you know why the animating of the Bullet doesn't work?
|
Sat Sep 24, 2011 1:17 am |
|
|
Azukki
Joined: Sat Nov 03, 2007 9:44 pm Posts: 1916 Location: Flint Hills
|
Re: Making an Automatic Gun. Help?
Well, you set the bullet to only have one frame, so that would stop any animation.
Also if you want your bullet to rotate in relation to the direction it's flying, it can't be a MOSParticle anyways. Gotta be a MOSRotating, or something of 'greater complexity'. And that means it can't wound like bullets do. So that will be bit of a problem. The effect that I imagine you want is doable I'm sure, but not very easy.
|
Sat Sep 24, 2011 3:53 am |
|
|
|