KSP scripting error, "callback type not allowed" cant solve

Aelm
Aelm Member Posts: 1 Newcomer
edited October 22 in Kontakt

So I'm attempting to make a simple script that takes the state of the soft pedal and when pressed lowers the velocity values by 15 points. I'd prefer 20% but this seems simpler.


I keep getting the error "error (line 17): callback type not allowed in this context" referring to the "on note" use and even GPT cant figure it out. Thoughts? Anyone have a better idea how to implement this?

-------------------------------------------

on init

   declare $softPedalEngaged

   declare $VELOCITY

   $softPedalEngaged := 0

end on


on controller

   if ($CC_NUM = 67)

       if ($CC_VALUE >= 64)

           $softPedalEngaged := 1

       else

           $softPedalEngaged := 0

       end if

   end if

end on


on note

   if ($softPedalEngaged = 1)

       if ($VELOCITY > 15)

           $VELOCITY := $VELOCITY - 15

       end if

   end if

end on

This discussion has been closed.
Back To Top