| 02-07-2007, 01:24 AM | #1 |
Sorry about the spelling, but what does that mean? How can you fix it? Its coming up on a couple of my locals.. heres one of them JASS:local player aa local integer a loop exitwhen a == 12 set aa = Player(a) if GetPlayerSlotState(aa) == PLAYER_SLOT_STATE_EMPTY then call MultiboardSetItemValueBJ( udg_Multiboard, 1, GetPlayerId(aa) + 2, "|c00959697" + "<<Empty>>" + "|r" ) call MultiboardSetItemValueBJ( udg_Multiboard, 2, GetPlayerId(aa) + 2, "|c00959697" + "--" + "|r" ) call MultiboardSetItemValueBJ( udg_Multiboard, 3, GetPlayerId(aa) + 2, "|c00959697" + "--" + "|r" ) call MultiboardSetItemValueBJ( udg_Multiboard, 4, GetPlayerId(aa) + 2, "|c00959697" + "--" + "|r" ) endif set a = a + 1 endloop |
| 02-07-2007, 01:26 AM | #2 |
I'm not sure exactly what you mean. Perhaps you should post some code? |
| 02-07-2007, 01:32 AM | #3 |
JASS:local integer a = 0 It means you were using a variable without ever setting it equal to something. |
| 02-08-2007, 09:14 PM | #4 |
Why do I have to have the local set to something with it when i delare it instead of declaring the local later on in the trigger?? |
| 02-08-2007, 09:27 PM | #5 |
You can declare it later if you want. It just saves a line of code to initialize it right away. JASS:local integer a loop exitwhen a == 12 set aa = Player(a) if GetPlayerSlotState(aa) == PLAYER_SLOT_STATE_EMPTY then call MultiboardSetItemValueBJ( udg_Multiboard, 1, GetPlayerId(aa) + 2, "|c00959697" + "<<Empty>>" + "|r" ) call MultiboardSetItemValueBJ( udg_Multiboard, 2, GetPlayerId(aa) + 2, "|c00959697" + "--" + "|r" ) call MultiboardSetItemValueBJ( udg_Multiboard, 3, GetPlayerId(aa) + 2, "|c00959697" + "--" + "|r" ) call MultiboardSetItemValueBJ( udg_Multiboard, 4, GetPlayerId(aa) + 2, "|c00959697" + "--" + "|r" ) endif set a = a + 1 endloop Note, before you've initialized the variable, 'a' has no value. Therefore how can you add 1 to a nonexistent number? You can't, ergo the error. You could solve it a few ways, as shown below. JASS:local integer a = 0 loop exitwhen a == 12 set aa = Player(a) if GetPlayerSlotState(aa) == PLAYER_SLOT_STATE_EMPTY then call MultiboardSetItemValueBJ( udg_Multiboard, 1, GetPlayerId(aa) + 2, "|c00959697" + "<<Empty>>" + "|r" ) call MultiboardSetItemValueBJ( udg_Multiboard, 2, GetPlayerId(aa) + 2, "|c00959697" + "--" + "|r" ) call MultiboardSetItemValueBJ( udg_Multiboard, 3, GetPlayerId(aa) + 2, "|c00959697" + "--" + "|r" ) call MultiboardSetItemValueBJ( udg_Multiboard, 4, GetPlayerId(aa) + 2, "|c00959697" + "--" + "|r" ) endif set a = a + 1 endloop JASS:local integer a set a = 0 loop exitwhen a == 12 set aa = Player(a) if GetPlayerSlotState(aa) == PLAYER_SLOT_STATE_EMPTY then call MultiboardSetItemValueBJ( udg_Multiboard, 1, GetPlayerId(aa) + 2, "|c00959697" + "<<Empty>>" + "|r" ) call MultiboardSetItemValueBJ( udg_Multiboard, 2, GetPlayerId(aa) + 2, "|c00959697" + "--" + "|r" ) call MultiboardSetItemValueBJ( udg_Multiboard, 3, GetPlayerId(aa) + 2, "|c00959697" + "--" + "|r" ) call MultiboardSetItemValueBJ( udg_Multiboard, 4, GetPlayerId(aa) + 2, "|c00959697" + "--" + "|r" ) endif set a = a + 1 endloop |
