Dependent Variables in 'wait'

everything.is.fine
everything.is.fine Member Posts: 2 Newcomer
edited January 2023 in Scripting Workshop

Hi guys. I'm trying to define a dependent variable in KSP and use it for 'wait' as $waiting_time. Here's a simple example. The error message is 'ERROR (line 7): variable "$x" was not declared. I can't see what's wrong with it. Thanks in advance.


on init
declare $Time := 5
declare $x := 2 * $Time
end on

on note
wait($x)
end on


Comments

  • everything.is.fine
    everything.is.fine Member Posts: 2 Newcomer

    I just solved it:

    on init
    declare $Time := 5
    declare $x
    $x:= 2 * $Time
    end on
    
    on note
    wait($x)
    end on
    

    Thanks

Back To Top