Project Perfect Mod Forums
:: Home :: Get Hosted :: PPM FAQ :: Forum FAQ :: Privacy Policy :: Search :: Memberlist :: Usergroups :: Register :: Profile :: Log in to check your private messages :: Log in ::


The time now is Tue Mar 19, 2024 8:46 am
All times are UTC + 0
(**) Primary/SecondaryFireFLH, TurretOffset & PBarrelLength
Moderators: Global Moderators, Tiberian Sun Moderators
Post new topic   Reply to topic Page 1 of 1 [2 Posts] Mark the topic unread ::  View previous topic :: View next topic
Author Message
Lin Kuei Ominae
Seth


Joined: 16 Aug 2006
Location: Germany

PostPosted: Thu Dec 13, 2012 9:53 am    Post subject:  (**) Primary/SecondaryFireFLH, TurretOffset & PBarrelLength Reply with quote  Mark this post and the followings unread

After you've created a new voxel and gave it some cool new weapons in rules.ini, you surely noticed that the bullets don't start from the same point where the barrel ends.

This tutorial will show you, how you can set the right bullet starting point for your unit and will cover the art.ini keys
PrimaryFireFLH
SecondaryFireFLH
TurretOffset
PBarrelLength
SBarrelLength


This is rated with 2 stars as it's quite time consuming in the beginning, but with a bit practice this is a very easy and fast job and could be rated with 0 stars.

Finding the right FireFLH values
I.
Make sure you've turned on in the game controls the option "Target Lines". This shows you a green line from the unit to the moving point and a red line from the unit to the target point. We are only interested in the red line as it starts from the exact PrimaryFireFLH position on the unit. Use force fire to show the red line whenever you want.

II. PrimaryFireFLH
Add to your units entry in art.ini the key
Code:
PrimaryFireFLH=0,0,0
.
FLH stands for Forward, Lateral and Height and the distance is measured in leptons. This is an engine specific scale unit, that is not related to the size of a voxel or a pixel.

-There is no way to calculate the correct FLH value.
-To find the right FLH values you have to trial and error and look each time ingame, if the value is correct.

Go in 3 steps to find the right FLH values, beginning with the Forward value, then the Lateral and finally the Height value.
I prefer to use a multiple of 8 to come fast closer to the right value, e.g. 8, 16, 32, 64, 128 and then slowly reduce or raise the value with 8 until i have the exact position.
1. Forward: Let the unit face to the west or east ingame and force fire straight to the west/east, to see if you have the right F value.
the number in the top left shows the used F value (the red line has been changed to white for a better visibility)
Adjust the F value to move this way the bullet starting point forwards/backwards along the body centre line, until it's on the exact position of the barrel end. (positive values to move forwards, negative to move backwards)
Note: some muzzleflash anims are a bit bigger and to avoid that they are shown half in the barrel, you have to move the F value a bit more forward.

2. Lateral: Let the unit face north or south ingame and force fire straight to north/south.
the number in the top left shows the used L value (the red line has been changed to white for a better visibility)
Adjust the L value to move this way the bullet starting point left/right, until it's on the sideward position of the barrel. (positive value for left, negative for right side of the unit)
If you have Burst=2 (or more) on your weapon, the unit automatically switches the sides for each shot from left to right and vice versa (in this case it's irrelevant if you use negative or positive values on the L value)

3. Height: Let the unit face to the west or east ingame and force fire straight to the west/east.
the number in the top left shows the used H value (the red line has been changed to white for a better visibility)
Adjust the H value to move this way the bullet starting point up/down, until it's on the exact height of the barrel end.

III. SecondaryFireFLH
Use the same technique as described in II for the PrimaryFireFLH.
Since the red target line isn't shown for secondary weapons and always shows the PrimaryFireFLH, you have find the position with the primary weapon and then copy the FLH values to the SecondaryFireFLH key.


III. TurretOffset
If your unit uses a turret which shouldn't be placed on the centre of the chassis, you can use this key to move the turret forwards or backwards along the body centre line. Positive values move the turret forwards and negative values backwards. The graphical placement of the turret with this key works only for voxel units.
However the FireFLH position is messed up for turrets which aren't in the centre. This is a calculation error of the TS engine and can't be fixed.
The best is to find the FireFLH with TurretOffset=0 and then move the Turret along the body centre line.

IV. PBarrelLength & SBarrelLength
If your unit has a voxel barrel, you should use these keys to define the bullet starting point for the primary (PBarrelLength) and secondary (SBarrelLength) weapon.
Since voxel barrels stand in a different angle for closer and farther targets, these 2 keys are used to compensate the rotation of the tilting voxel barrel.

To make them work you have to set the FireFLH key to the exact pivot of the barrel.
Lets show this on the original Titan, which has even in the latest version 2.03 wrong FireFLH and PBarrelLength values and uses
Code:
[MMCH]
PrimaryFireFLH=250,-50,100
PBarrelLength=250
SBarrelLength=250
TurretOffset=-16

1. we can remove the key TurretOffset which is wrong, as the turret is in the centre of the unit and remove the key SBarrelLength as the Titan has no secondary weapon
2. we change temporarily the key PBarrelLength to 0
3. Lets find the correct FireFLH using step I and II, so the bullet starts on the end of the barrel.
PrimaryFireFLH=250,-50,128 is better
4. Since the barrels Pivot is on the centre of the unit, we can set PrimaryFireFLH=0,-50,128 and use now the removed 250 of the Forward value for the PBarrelLength key. If you have a tank with a big turret you have to keep a small Forward value so the FLH is again on the pivot of the barrel. Then use PBarrelLength to compensate the length of the Barrel.

The result for the MMCH are the following settings.
Code:
[MMCH]
PrimaryFireFLH=0,-50,128
PBarrelLength=250


Since the Titan barrel doesn't tilts that much like a tank or artillery barrel, it gives in this case better results ingame to use PrimaryFireFLH only
Code:
[MMCH]
PrimaryFireFLH=250,-50,128



This tutorial is sponsored by tibweb.


Key Words: #Tutorials #Modding #TiberianSun #Firestorm #RedAlert2 #YurisRevenge #Art.INI 

_________________
SHP Artist of Twisted Insurrection:  Nod buildings

Public SHPs
X-Mech Calendar (28 Mechs for GDI and Nod)
5 GDI, 5 Nod, 1 Mutant, 1 Scrin unit, 1 GDI building

Tools
Image Shaper______TMP Shop______C&C Executable Modifier

Last edited by Lin Kuei Ominae on Mon May 20, 2019 12:01 pm; edited 1 time in total

Back to top
View user's profile Send private message
Wolfsangel
Cyborg Soldier


Joined: 25 Jul 2014
Location: Unkown

PostPosted: Fri Aug 15, 2014 9:54 am    Post subject: Reply with quote  Mark this post and the followings unread

Thanks LKO! I did it ^^

_________________
Call me as " Xenaga "

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [2 Posts] Mark the topic unread ::  View previous topic :: View next topic
 
Share on TwitterShare on FacebookShare on Google+Share on DiggShare on RedditShare on PInterestShare on Del.icio.usShare on Stumble Upon
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 vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © phpBB Group

[ Time: 0.1773s ][ Queries: 11 (0.0076s) ][ Debug on ]