Change Animation Speeds of a Equipment Dynamically

Your forum for all discussions around Modding.
Rocket09
Posts: 1
Joined: Fri Nov 10, 2023 4:29 pm

Change Animation Speeds of a Equipment Dynamically

Post by Rocket09 »

I know that animation nodes get its rotation speed value from the rotSpeed attribute in the animationNode tag in XML file of the Equipment. I was poking around in the debugger and I found that under some specialization traits in the self variable in the LUA script that there is a animationNodes table. In that table the animation nodes start with index 1 and do have the rotSpeed attribute however it is a completely different speed than what is in the XML file. The speed is a float with a value of something like 0.03456 for example, instead of 800.
Is there a formula that can calculate the float that is needed for a specific RPM? Or is there another way that you are supposed to change animation speeds?
Ziuta Modding
Moderator
Posts: 995
Joined: Sun Jul 17, 2016 9:40 am

Re: Change Animation Speeds of a Equipment Dynamically

Post by Ziuta Modding »

The value after loading from XML is written to the script variable with the formula * 0.001, the difference in value between XML and the real one is due to the fact that some function additionally modifies this variable (e.g. wind speed)
Post Reply