"Variable not defined" in KSP multi script

Hello, I'm stumped by a compile error in my multi script. This is my first KSP project, and my ultimate goal is to create melody and bass couplers to use with Impact Soundworks' Fredonia Grand Organ. (I don't have the intended behaviour working yet--this script simply splits a keyboard into 3 zones and distributes them across 4 MIDI channels.)
The error is "Error (line 236): variable "$melody_to_out4" was not declared." That variable is defined on line 84, and Notepad++ recognises them as being spelled identically.
All variables are global in KSP, right? I don't understand why the compiler doesn't recognise $melody_to_out4.
Comments
-
I am with you. I don't see why either, and it seems the issue is with all of your "on ui_control " variables. I deleted "on ui_control ($melody_to_out4_switch)" block and then it complained about $melody_to_out3, etc.....
You could eliminate the redundancy of passing the melody_to_out#_switch variable to the melody_to_out# and just use the _switch variable directly. This would eliminate the need for all of your "on ui_control" code and all the extra declare lines in the init.
0 -
The culprit are these lines:
You cannot inline declare a variable with a value of another variable - you can only inline declare it with a constant or literal value.
That said, I don't know why you have these extra variables when you can use values from switches directly? You just need to make them all persistent.
0
Categories
- All Categories
- 19 Welcome
- 1.5K Hangout
- 65 NI News
- 819 Tech Talks
- 4.2K Native Access
- 17K Komplete
- 2.1K Komplete General
- 4.4K Komplete Kontrol
- 5.9K Kontakt
- 1.6K Reaktor
- 390 Battery 4
- 872 Guitar Rig & FX
- 440 Massive X & Synths
- 1.3K Other Software & Hardware
- 5.9K Maschine
- 7.6K Traktor
- 7.6K Traktor Software & Hardware
- Check out everything you can do
- Create an account
- See member benefits
- Answer questions
- Ask the community
- See product news
- Connect with creators