How to increase mass to dynamic asteroids?
-
Sushi, you are confusing me.
What do you mean “attach”?
You don’t attach any sur. It must just have exactly the same name as the .3db, and must be in the same folder, that is all:
e.g. asteroid1.3db; asteroid1.sur
e.g. mybigbadship.cmp; mybigbadship.sur
e.g. myblastermissile.3db; myblastermissile.sur
-
Yes, I realize that. By attach I mean in the game the missiles are without a hitbox even though there is an appropriate .sur file made. That means, to me, while in game the freelancer engine isn’t joining the .3db and .sur, for some reason, whether this be my error or not.
-
Ah, OK now I understand. (I’m easily confused these days as you all know!) lol
I guess it’s because you want to be able to destroy them with gunfire as they fly?
All missiles in the game use the li_rad_missile.3db and li_rad_missile.sur file, and torpedoes use ge_torpedo.3db and ge_torpedo.sur
Mines can be destroyed, I’ve done that, but I’m not sure about missiles, I’ve not tried that. Try giving your missiles the standard 3db and sur files and if that works you should be able to replace them with yours. Let us know what happens.
-
Vital wrote:
You can’t destroy your own missiles. Only those launched by(npcs for example).And this was the winning answer. Good to know
Thanks for all the help everyone!
-
Quick&Dirty variant:
asteroidarch.ini
[DynamicAsteroid]
nickname = badlands_large1
DA_archetype = solar\asteroids\models\badlands_large.3db
material_library = solar\ast_badlands.mat
explosion_arch = dast_asteroid_explosion
…explosions.ini
[explosion]
nickname = dast_asteroid_explosion
…
process = none
num_child_pieces = 1
…
innards_debris_num = 1
innards_debris_radius = 1
…
innards_debris_object = simple_badlands_large1[Simple]
nickname = simple_badlands_large1
DA_archetype = solar\asteroids\models\badlands_large.3db
material_library = solar\ast_badlands.mat
Mass = 10000 ; <-Our massDunno why, but despite the same DA_archetype parameters this “simple” visually bigger than asteroid itself!
P.S. More intresting - HP, not mass.
-
To the original title, I simply increased the mass in the sur file. Once I did that the dynamic asteroid behaved different…
-
Original question was “How?” but not “It works?”
-
When you export a sur you put in the mass you want. I don’t know where the value is stored in the sur file to change it with a hex editor - it could be the X, Y and Z inertia values? - anyone know?
-
Cannon writes Intertia …
How about milkshape sur import and then sur export?
There is a mass value in the form. -
mass = inertial mass, thats what I changed, I simply increased it
-
I know that “mass” value must be changed and it is simple. But wich util or method - i don’t know.
I will try again: Utf editor does not show sur contents, sur dump does not show mass.
-
Have you actually tried adding “mass = whatever” to the [DynamicAsteroid] section? It should be read (it’s part of every object), but I don’t know if it’s actually used.
To edit the mass (inertia) values in the sur, use SurDump with the -o option. That will give you the hexadecimal offset which you can plug into your hex editor.
surdump -o \Games\Freelancer\DATA\SOLAR\ASTEROIDS\MODELS\ast_ice_dynamic.sur |fgrep inertia 00040 inertia: 0.670761, 0.631842, 0.429650
-
Interesting! Will try both variants
-
@ Sushi, Gibbon can get them to work on his 3db’s because they were made with the cmp exporter, which gives them the cmp internal structure, but a regular 3db (vanilla or from the 3db exporter) has a different internal structure, which means a regular sur is of no use as FL can’t “attach” a sur with a Root to something that doesn’t have one. Use FLMT to chamge the sur type to 2 or 3 and then hex edit it to change all instances of 12688F2D or 2D8F6812 to 00000000 (can’t remember which way round the hex for Root is listed), then it should “attach” in game.
-
I simply used a hex editor to change it, the one I use has built in float conversion. I pretty much did like Adoxa does, I dumped the sur file and looked for those float values.
-
Good to see you back BJ.
Yes the root in hex is 12688F2D, so we need to reverse this to find it - 2D8F6812.
Editing the inertia: You never get a clear answer from programmers, that’s probably why I prefer engineering…
Here’s a guide for total newbs (or slow learners like me)…
Open your sur file, the locations of the inertia values are always the same - 40 to 4B… lost you already?
Uh… oh OK: 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 4A and 4B, forgot you may be a real total newbie
Starting from the beginning of the file, Icy Hexplorer and most other hex editors display the data in groups of 4 bytes, and 4 groups across the screen (10 hex bytes in a line), so come down to the beginning of the 4th line to see Hex Address 40.
Remember sprogs (system programmers) sometimes call addresses “Offsets” - it’s the same thing, the location of data “offset” by yyy, starting from xxx - this time starting from xxx=0.
Address standard-FL
40-43 FA B6 23 BF = X-inertia = 0.670760750771
44-47 61 C0 21 3F = Y-inertia = 0.631841719151
48-4B 1D FB DB 3E = Z-inertia = 0.429650217295Now it’s obvious why they bounce around like peas when hit by even a 20-tonne ship!
The sur exporter asks for the ship mass from the shiparch.ini and “divides it into the x, y and z values” - I’m not sure if it does exactly this.
I usually use the same value 3 times, and usually try to keep the same scale as my ships mass values, but I read in a tute somewhere that the author used the x, y and z Bounding box values - is this a good formula to use?
While on this subject, be aware of the “radius” value, addresses 4C, 4D, 4E, 4F: This value affects the targeting of the object from your HUD, and it also sets the distance at which your HUD shows 0 metres away from it (and how far away from it that your ship stops if you are in Goto).
-
Yep, it works! Thx to All
-
Changing the inertia values to very high ones like 200000 changes the rotation speed of the asteroids. If you crash into them with the inertia 200000 they wont rotate. No effect to the real mass.
Is there no possibility to change the real mass of the asteroid? Maybe that just battleships with mass = 100000 can push them away and normal fighters with mass = 100 will crash into them and nothing happens?