How do you make physical effects on ships such as spinning

I am trying to make a ship spin when it is damaged or just spin forever.

If anyone does find a solution, could this be applied to the fully built Kushan Research Ship?


I liked it when it could spin :frowning:


All hail the spinning science donut!

Also, you are looking for MAD and madstate stuff. MAD file holds the animation info (not readable) and madstate file (human readable) holds the calls for the animations.

I cant find the .madstate file in the ship i want (Tai_Carrier)

Grab one from another ship and use it as a template.

I think the question is about the whole ship spinning, so wouldn’t that be an effect rather than a mad animation? I thought mad animations were for parts of a ship moving?

Got an idea how to do it or is it not implemented in the game?

Isn’t this in one of the other topics about complaints/requests for the official game?

1 Like


1 month later and still no idea…

There is a SobGroup_Tumble function. Might work.

Where do you put this?

You can look for an example of its usage in the Taiidan field generator files (tai_fieldgeneratordummy), but I can tell you that it will not work the way you want it and if you do the necessary adjustments to make it work you will find far more limitations for it to be practical.

But you can always experience it first hand , its good for learning, also if someone say something is impossible don’t completely agree until you have tried it yourself.


@nathanielmattock PARTIALLY SOLVED: I too was looking for a solution and finally found one in the Balcora Gate.

Here is one way to get your ship (or component) to rotate (spin):

Copy both the meg_balcoragate.mad and the meg_balcoragate.madstate files to the same folder as the ship that you wish to have “spin”. Rename both files to reflect the new ship (i.e. hgn_exampleship.mad, hgn_exampleship.madstate).

Open the hgn_exampleship.madstate file in any text editor and change the MEG_BALCORAGATE_Normal_OnSet = function(ship) to the name of your ship (e.g. HGN_EXAMPLESHIP_Normal_OnSet = function(ship)). Be sure to capitalize the ship’s name.

Below that, you can see that there are two instructions:

startAnim(ship, "RotateInnerRing")
setLoopCount(ship, "RotateInnerRing", 100000)   --infinite looping

Change the quoted “RotateInnerRing” in both to “SPIN” so that they now read:

startAnim(ship, "SPIN")
setLoopCount(ship, "SPIN", 100000)   --infinite looping

Now comes the slightly more difficult part. If you do not currently have the Homeworld MADEditor (created by the profoundly prolific, magnificently talented and sagaciously forgiving radar3301) you can download it here.

Once opened, you will want to open your hgn_exampleship.mad.

Under Animations at the top left you will see RotateInnerRing. Select it and rename it to SPIN (All Caps).

Below that is a section called Joints. Select InnerRing and rename it to the name of the joint on your ship that you wish to spin. If you wish to spin the entire ship, create a joint in the hod file, ensure that its parent is root and then rename InnerRing (in the MADEditor) to reflect that joint. Ensure that any capitalization is the same between the hod’s joint and the joint you name in the MADEditor.

As you can see in the Channel References, in the setup for the Balcora Gate the spin axis is Z… the axis that runs from front to back of the ship. If you wish to change this you must modify the channels at right and their associated keyframes which is quite beyond the scope of my intended instructions here.

I really hope that this is helpful as I too struggled with this very problem.

If anyone has any questions or suggestions as to how I might modify/simplify these instructions, please feel free to ask/suggest away.

1 Like

The problem is the collision mesh. MAD animations do not share the collision mesh. So for a ring object like balcora that works fine, but for a more complex ship shape, it will make the collision mesh wrong most of the time…


@Dom2: In what way does it create a problem with the collision mesh? Might one leave the collision mesh out of those components that rotate?

He’s saying the collision mesh won’t rotate.

Going back to the first post in the thread though, he appears to be asking about two different things:

Damaged/dead spinning - Sob_Tumble (probably)
Constant spinning - MAD animations

1 Like

Ah yes, I think I understand. Thank you sasrei!

So, for instance, in the case of a rectangular prism extending from the ship and rotating, the hod’s collision mesh will remain stationary and not follow the rotation, correct?

1 Like