Due to large amounts of requests
one, I am going to make a guide about how to use offsets correctly and not just guess and hope to get lucky. I'm not the best at explaining things, so bear with me. If you don't know the basics of modding or even what offsets are, get out. Seriously.
OFFSETSWhat you see here is the X and Y axis for Cortex Command
-X = Right
+X = Left
-Y = Down
+Y = UpThe first thing you'll probably notice is that the X axis is switched. Rather than -X meaning left like in
the conventional grid, the kind you'll see in Algebra and the sorts, -X mean right and vice versa.
The most time you're probably going to need this is when you're changing offsets for that new gun you've just sprited. Most people try not to sprite actors larger or smaller than usual.
Imagine that this is your new weapon you've just sprited. You want it so that your clone will hold it properly. Meaning you'll need to fill out these key chucks of code. (the meanings will be in parenthesis)
Code:
SpriteOffset = Vector (This sets the origin of the sprite, should be in the very middle of your sprite)
X = ?
Y = ?
Code:
JointOffset = Vector (The placement of the main hand)
X = ?
Y = ?
Code:
StanceOffset = Vector (The placement of the shoulder when carrying the gun)
X = ?
Y = ?
SharpStanceOffset = Vector (The above but when aiming down sights)
X = ?
Y = ?
SupportOffset = Vector (Placement of secondary hand)
X = ?
Y = ?
Code:
Magazine = Magazine
CopyOf = Magazine SMG
ParentOffset = Vector (Where the magazine goes)
X = ?
Y = ?
Code:
MuzzleOffset = Vector (Where the bullets fire from)
X = ?
Y = ?
EjectionOffset = Vector (Where the shells, if any, eject)
X = ?
Y = ?
So, how are we going to find the correct coordinates?Easily.
First of all, we'll need to set the Sprite offset.
Our sprite here is 18 by 10 pixels.
Therefore...
Code:
SpriteOffset = Vector
X = -9
Y = -5
Just take half of your sprites dimensions, negate it, and plug it in. That's all you need to know for Sprite Offsets. Simple, right? This bit of code will help you a lot later on.
Note: If your sprite Offset has a decimal, just round up. There's no such thing as half a pixel.
Now, lets move onto the Joint offset.
This will be where the main hand goes. Setting this one up is a bit more trickier.
First, make a mark off where you're Sprite offset is, which should be in the middle
This is where we will start counting. Start marking how far you want your hand to the left or right.
I counted 4.
Code:
JointOffset = Vector
X = 4
Y = ?
Remember, +X means left and -X means right.
Now count how much you want to go up or down.
I counted 3.
Code:
JointOffset = Vector
X = 4
Y = -3
And for whatever reason,
JointOffsets and Parent Offsets (Which is what we are currently working on) need to be the opposite of what you want. Why, I do not know.
So:
Code:
JointOffset = Vector
X = -4
Y = 3
There, you're done. That's all you have to do to set an Offset.
Things you might have missed:- After setting the Coordinates for JointOffsets and Parent Offsets, negate them. (Negatives turn to positives, and vice versa)
- The -X mean right and +X means left
- If you've followed this tutorial and the Offset still doesn't match up, negate for good measure.
If you're still confused reread it.
If you've just reread it and are still confused, then post what you're confused about.
~No_0ne