:: Home :: Get Hosted :: PPM FAQ :: Forum FAQ :: Search :: Memberlist :: Usergroups :: Register :: Profile :: Log in to check your private messages :: Log in ::
Do you want to advertise at Project Perfect Mod. Find out how to do it HERE.

The time now is Wed Oct 18, 2017 7:46 am
All times are UTC + 0
 Forum index » Modding Central » Tiberian Sun Editing Forum » Tutorials Factory
(**) Primary/SecondaryFireFLH, TurretOffset & PBarrelLength
Moderators: Global Moderators, Tiberian Sun Moderators
Post new topic   Reply to topic Page 1 of 1 [2 Posts] 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

Lin Kuei Ominae wrote:

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. Main Nod building SHP creator.

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

Tools
TMP Shop
C&C Executable Modifier

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

Thanks LKO! I did it ^^

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] View previous topic :: View next topic
 Forum index » Modding Central » Tiberian Sun Editing Forum » Tutorials Factory
Jump to:  
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

Wildcard SSL Certificates
[ Time: 0.1185s ][ Queries: 11 (0.0066s) ][ Debug on ]