[Bug] [Fixed] Low gravity utility does not work in Gravity script

No replies
Wuzzy
Wuzzy's picture
User offline. Last seen 3 days 15 hours ago. Offline
Joined: 2012-06-20
Posts: 1301
If you use the Gravity script and set the gravity (e.g. “g=75”) and then start the game, using the “Low gravity” utility does nothing. The gravity is simply unchanged, thus making Low gravity useless. I know the Gravity script works by setting the gravity again and again, which of course means that the effect of the Low gravity utility is instantly overwritten. My proposed fix would be for the script to store when a Low gravity utility has been used (for the rest of the turn), from that point on (until the next turn starts) the gravity the script would normally set is multiplied by 0.5 (current Low gravity factor). The idea is to make the Low gravity utility work on top of the existing gravity modification. For instance, if you have “g=75” set as script parameter, the gravity is set to 75%. As soon the low gravity utilty is used, the script instead sets it to the half of that, resulting in an absolute gravity of 37.5% for the rest of the turn. When the next turn starts, it goes back to 75%. For the weird random or osciallating mode, this should go similar: Just multiply the gravity the script would normally set by 0.5 after the player activated low gravity.
Hi, I am a Hedgewars developer. Smile
Copyright © 2004-2023 Hedgewars Project. All rights reserved. [ contact ]