Noiredd/PEGAS

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

Closed this issue · 4 comments

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

  • A: The @CLOBBERBUILTINS on directive must be added to the top of any of the files that require the use of the r variable (similar to the @LAZYGLOBAL directive), or
  • B: The variable r must be changed to not conflict with the R() function. This is the recommended fix by the kOS devs.

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.

I found r, v, q, and mass

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.

Yeah it's short for SHIP:MASS