Rotation via JS
Moderators: winston, another_commander
Rotation via JS
Right now i working in a strange kind of asteroid. What i want is this asteroid to be placed in the system with both the populator and via a script. Ihave noticed that when it placed through a script it does not ratate but when the populator add it then it rotates. How i can force it to rotate when it is placed with a script
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
Is your asteroid using dumbAI? If you’re using a custom AI, the ENTER handler of your GLOBAL state should contain performTumble.
E-mail: [email protected]
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
Re: Rotation via JS
It should just work. Probably you didn't give it a dumbAI.plist? That starts with a performTumble and does the rotation. It rotates over two axes with speeds defined in shipdata as: pitch & roll.Ark wrote:Right now i working in a strange kind of asteroid. What i want is this asteroid to be placed in the system with both the populator and via a script. Ihave noticed that when it placed through a script it does not ratate but when the populator add it then it rotates. How i can force it to rotate when it is placed with a script
UPS-Courier & DeepSpacePirates & others at the box and some older versions
Re: Rotation via JS
It uses the nullAI.plist. Strange that when it is added by the populator it rotates and when by the script it does not. I had some very difficult time until I finally understood why some asteroid billboards rotate and some others not. Maybe it has to do with the role. When it is added by the populator it has the role of asteroid , when by the script the role of asteroid billboardEric Walch wrote:It should just work. Probably you didn't give it a dumbAI.plist? That starts with a performTumble and does the rotation. It rotates over two axes with speeds defined in shipdata as: pitch & roll.Ark wrote:Right now i working in a strange kind of asteroid. What i want is this asteroid to be placed in the system with both the populator and via a script. Ihave noticed that when it placed through a script it does not ratate but when the populator add it then it rotates. How i can force it to rotate when it is placed with a script
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
Re: Rotation via JS
It’s actually not possible to rotate around more than one axis at a time in 3D.Eric Walch wrote:It should just work. Probably you didn't give it a dumbAI.plist? That starts with a performTumble and does the rotation. It rotates over two axes with speeds defined in shipdata as: pitch & roll.
To be clear, performTumble sets pitch and roll to random values within the range defined by max_flight_pitch and max_flight_roll, then switches to the BEHAVIOUR_TUMBLE AI behaviour (which simply applies the current pitch and roll values without paying attention to anything going on around the ship).
Eric mentioned elsewhere that it’s not possible to set a specific constant rotation. This should be quite easy to implement as a JS command. It could be done as an AI command too, but the problem there is that you can’t use any sort of calculated value for the parameters.
E-mail: [email protected]
Actually I do not want something that complicated. I just want the asteroid billboards to not be completely immobile.
By replacing the AI everything works fine now but I am still not sure why the ones added by the populator did rotate even with nullAI.plist that does not contain the command perform Tumble. Since I finally got what I wanted I think I will leave the explanation for the above to someone with a far better understanding of oolite mechanism that me
Thanks again !!
By replacing the AI everything works fine now but I am still not sure why the ones added by the populator did rotate even with nullAI.plist that does not contain the command perform Tumble. Since I finally got what I wanted I think I will leave the explanation for the above to someone with a far better understanding of oolite mechanism that me
Thanks again !!
Asteroids auto_AI to dumbAI.plist, which has performTumble as it's global ENTER state.
The ones added by the populator therefore switch over to dumbAI.plist, but the other ones don't. Hence the difference.
The ones added by the populator therefore switch over to dumbAI.plist, but the other ones don't. Hence the difference.
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
Just a side note, if you set its shipdata pitch or roll to 0 it will not rotate at all... happend to me with the jump gates
Bounty Scanner
Number 935
Number 935