Important Message

You are browsing the archived Lancers Reactor forums. You cannot register or login.
The content may be outdated and links may not be functional.


To get the latest in Freelancer news, mods, modding and downloads, go to
The-Starport

Custom Weapons - Fix, Rev and Pris nodes

The general place to discuss MOD''ing Freelancer!

Post Fri Jul 18, 2003 11:34 pm

Custom Weapons - Fix, Rev and Pris nodes

Does anyone know anything about any of the nodes under Cmpnd in a weapons .cmp file? I have searched here and in tutorials but there doesnt seem to be anything about them.

To be honest its mainly the 'Pris' node i am stumped with. The Rev and FIx nodes appear very similar, both specify a parent object (for weapons the guns base) and a child object (the turret/barrel part of the gun). There are barely a few hundred bytes apart from that. The only part i understand is the x, y, z coordinates for the location of the child object. However thats the only bit i have ever needed to change so far so i havnt investigated the rest of it.

I am fairly certain the axis that a guns turret/barrel rotates on is somewhere in the Rev or Pris nodes. Apart from the x, y, z location of the turret relative to the base there is nothing in the Rev node which looks big enough to be an axis location (i am assuming the axis will be a minimum of a y and a z coordinate, if not and x, y and z therefore a minimum of 8 bytes, max of 12). This leads me to believe it is in the Pris node but i am having no luck finding it there.

If anyone has any info on the format/content of these nodes that would be great.

Post Sat Jul 19, 2003 1:17 am

check in the Noob questions thread. That guy (cant remember his name) is reaaly good about answering questions about modding

We pray for one last landing on the globe that gave us birth, let us rest our eyes an fleecy skies and the cool green hills of Earth!

Post Sat Jul 19, 2003 3:46 am

Yes, i see Accu-o-shot has been answering alot of queries, but i think it might be a bit cheeky to post this as a noob question I was hoping someone had maybe come across this themselves but not worked out enough to start a post on it.

As it happens i am not so sure that the axis is in the 'Pris' node anyway. A second look shows that the Pris node is in the same format as the Rev/Fix node. It has the turret as the parent node and the gun as the child. The x, y, z coordinates of the child are in the same place. If you replace all the data in the Pris node with 00's except 3 sets of 4 bytes which control the x, y, z scale of the child object and the 12 bytes which code the x, y, z location of the child, nothing appears to change.

Here is a summary of the basic layout of the Pris and Rev nodes :

Parent object name - Starts at offset 0
Child object name - Starts at offset 64
X, y, z coordinates of child object - Starts at offset 128 (3 floats = 12 bytes)
Second x, y, z coordinates - Starts at offset 140. Unsure of purpose for this, it is usually at 0, 0, 0 but changing it has the same effect as changing the above values.
X scale of child object - Starts at offset 152
Y scale of child object - Starts at offset 168
Z scale of child object - Starts at offset 184

The Fix node is the same except there is no second set of x, y, z cordinates so the offsets for the x, y and z scales are 12 bytes earlier (i.e. 140, 156, 172).

The scale data is always the same - 00 00 80 3F which is 1 as a float. What the point of this is eludes me, but if you mess around with it the object is displayed normally (bigger or smaller) but the gun wont fire.

Like i said replacing all the data with 00 means the gun is not displayed (actually it is except the scale is 0 instead of 1 so you dont see it) however the turret rotates on the same axis. It occured to me that replacing everything with 0's might not be disrupting the axis (it could have been o's before or floats that were very close to 0) so i replaced all the data with FF's. Again the gun was not displayed but the turret rotated as normal on the same axis.

This leads me to belive the axis is somewhere else, probably in the Animation nodes somewhere. The only nagging doubt i have about this is that if you delete the Pris node completely the gun disappears and the turret is still there (as you would expect) but the turret does not rotate up and down anymore.

The plot thickens....

EDIT - Well turns out that the axis is not anywhere in the Animations nodes. Completely deleting the Animations node certainly makes no difference to the rotation of the barrel and seems to make little difference to anything at all. Back to the drawing board.

Edited by - redeye on 19-07-2003 05:32:35

Post Tue Jul 22, 2003 4:07 am

I will try and add a proper custom weapons bit to the Ships/Weapons with multiple components tutorial soon, but in the meantime here is the axis info.

As usual it had been staring me in the face the whole time. The axis the turret/barrel rotates on is just the x, y, z origin of the component. As i had assumed i knew what that bit did i had never thought to mess around with it. Normal weapons are coded the same way as ships with the coordinates for all the components as if they were all built around the origin as separate models instead of being different parts of the same model. So if you could import the .cmp for the Blood Dragon into milkshape you would only see the hull because the wings/tail/engine would be centred on the origin and hidden by the hull.

As this would have been alot of trouble to simulate with custom models i had simply been making the model as normal (in this case i am actually working with one of Wanderer's models) then changing the origin for the component to 0, 0, 0 and the parts fitted together correctly. So to pick the axis for a gun you will either have to design it the way the game weapons are, and fiddle about to find the correct origin for you component (probably by sticking a few fake Hps on the main body of the gun) or just make the model with the turret/barrel axis on the origin and use 0, 0, 0 for the components origin.

EDIT - I am sure the fact that only Rev + Pris nodes have a second set of floats for x, y, z location of component is significant here. As the only difference between a Rev/Pris node and a Fix node is that the objects in the Rev/Pris node can rotate around an axis and the Fix ones cant i'm sure it will turn out to be relevant. In retrospect this was another obvious clue i missed

Edited by - redeye on 22-07-2003 05:11:10

Return to Freelancer General Editing Forum