KSP-KOS / KOS

Fully programmable autopilot mod for KSP. Originally By Nivekk
Other
697 stars 230 forks source link

SET THROTTLE TO value. should work or show a warning. #1491

Open AlchemistCH opened 8 years ago

AlchemistCH commented 8 years ago

Basically, it's a major pitfall that does nothing else than leaves the user confused. We have LOCK THROTTLE TO expression. that controls the throttle and gets evaluated every frame, We have SET SHIP:CONTROL:PILOTMAINTHROTTLE TO value. that sets the throttle when it's not locked. But using SET THROTTLE TO value. does completely nothing, when the user might have wanted to achieve one of the aforementioned effects. Maybe we need a warning message showing that this is a wrong command and what are the correct options.

Dunbaratu commented 8 years ago

I'd rather make it work. It should be possible for the mod to know when the identifier of a set is a global variable of one of the four magic names and do something special instead.

AlchemistCH commented 8 years ago

Good thought! One of the more reasonable options may be such a difference between LOCK and SET: LOCK THROTTLE - locks it to an expression that gets reevaluated every frame. SET THROTTLE - locks it to a constant value (current result of expression provided) until the next command sets/locks it to something else

With this, the same dichotomy could be also implemented for raw controls, adding the ability to lock them to an expression.

Dunbaratu commented 8 years ago

Locking raw controls is hard because they are suffixes. If we solve the problem of locking setsuffixes theb we'd get it for free with that.