Noiredd / PEGAS

Powered Explicit Guidance Ascent System - a KSP & RO autopilot using the Space Shuttle guidance algorithm, UPFG
http://forum.kerbalspaceprogram.com/index.php?/topic/142213-pegas-powered-explicit-guidance-ascent-system-devlog
MIT License
113 stars 31 forks source link

PEGAS uses variables that conflict with built-in functions, breaking the script on newer versions of kOS #49

Closed Razgriz1 closed 1 year ago

Razgriz1 commented 1 year ago

As of kOS v1.4.0.0, the default behavior of kOS does not allow for variables to be named the same as a built-in function. In particular, this breaks scripts that use r as a variable, as that conflicts with the function R() which creates a direction based on an Euler rotation. As PEGAS uses r as a variable, this causes the script to crash on newer versions of kOS.

Alongside this change, the @CLOBBERBUILTINS directive was added, that restores the old functionality and lets variables overwrite the built-in function. In order for PEGAS to work on newer versions of kOS, either

Noiredd commented 1 year ago

Are you aware of any other variables that cause issues? I suppose v would also be an offender. I'd rather do a simple search&replace, it seems like a cleaner solution.

Razgriz1 commented 1 year ago

I found r, v, q, and mass

Noiredd commented 1 year ago

Seriously there's a builtin called mass?
Alright, I'm gonna have to update to 1.4 and see all this for myself.

Thanks for looking into it.

Razgriz1 commented 1 year ago

Yeah it's short for SHIP:MASS