KSP SCRIPT WARNING, help please!
Hello,
I am new to KSP but I cannot seem to find the answer to this problem I am having in the KSP manual or online. If somebody could assist I would be most grateful. Thank you
I have a menu with left and right scroll buttons. 128 groups. If I press the left arrow / button when group 1 is selected or the right button when group 128 is selected I get this script warning. " SCRIPT WARINING ( Line: xxxx, Script : 0): Invalid ui_menu value! Assignment has no effect. My question is why and how do I stop this from happening?
Comments
-
It looks like you forgot to treat those cases in your logic.
If you decrease the menu value counter forever, soon enough you will hit a number that is not there. Same for increasing the value of the counter.
Resolved with a simple conditional statement like (pseudo-code)
dec(counter) if counter < min_menu_value then min_menu_value - min_menu_value
same for the increasing side.
0 -
Hi Gablux,
Thank you for your reply. I get the idea but I'm not quite sure where this code goes. Is it under $PrevMenu := 0 ie: if($PrevMenu1 < 0 then 0 - 0). Sorry but like I say I'm really new to all of this but, this is the last issue as far as I can tell with my custom instrument which has taken me a couple of weeks to code from scratch ( with the help of many great posts in the forums :) )
on ui_control($PrevMenu1) $menu1 := (get_control_par(get_ui_id($menu1),$CONTROL_PAR_NUM_ITEMS)+$menu1-1) mod get_control_par(get_ui_id($menu1),$CONTROL_PAR_NUM_ITEMS) $PrevMenu1 := 0 $i := $LAYER1_FIRST while ($i<=$LAYER1_LAST) purge_group($i,0) inc($i) end while purge_group($menu1,1) purge_group($menu2,1) end on
0 -
Ok managed to sort it out. Thank you.
0
Categories
- All Categories
- 19 Welcome
- 1.4K Hangout
- 60 NI News
- 761 Tech Talks
- 4K Native Access
- 16.2K Komplete
- 2K Komplete General
- 4.2K Komplete Kontrol
- 5.6K Kontakt
- 1.6K Reaktor
- 373 Battery 4
- 831 Guitar Rig & FX
- 423 Massive X & Synths
- 1.2K Other Software & Hardware
- 5.6K Maschine
- 7.1K Traktor
- 7.1K 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