| 02-19-2006, 08:48 AM | #2 |
Your JASS triggers look like 100% conversion from GUI. How does exactly they doesn't run? random spawn trigger looks ok so should run. |
| 02-19-2006, 05:46 PM | #3 |
my triggers won't run at all, like they're not even there. |
| 02-19-2006, 05:56 PM | #4 |
sympthons sound as if something was causing the main thread to crash. but well you can just use these BJ functions: JASS://=========================================================================== function RandomDistReset takes nothing returns nothing set bj_randDistCount = 0 endfunction //=========================================================================== function RandomDistAddItem takes integer inID, integer inChance returns nothing set bj_randDistID[bj_randDistCount] = inID set bj_randDistChance[bj_randDistCount] = inChance set bj_randDistCount = bj_randDistCount + 1 endfunction //=========================================================================== function RandomDistChoose takes nothing returns integer local integer sum = 0 local integer chance = 0 local integer index local integer foundID = -1 local boolean done // No items? if (bj_randDistCount == 0) then return -1 endif // Find sum of all chances set index = 0 loop set sum = sum + bj_randDistChance[index] set index = index + 1 exitwhen index == bj_randDistCount endloop // Choose random number within the total range set chance = GetRandomInt(1, sum) // Find ID which corresponds to this chance set index = 0 set sum = 0 set done = false loop set sum = sum + bj_randDistChance[index] if (chance <= sum) then set foundID = bj_randDistID[index] set done = true endif set index = index + 1 if (index == bj_randDistCount) then set done = true endif exitwhen done == true endloop return foundID endfunction Anyways check if you don't have arrays set to have a huge index number for initial values |
| 02-19-2006, 06:39 PM | #5 |
i think the problem is in my globals i have 2 globals set at array of 8000 And i can't use those functions as randomadditem uses a integer and i need real |
| 02-19-2006, 07:57 PM | #6 |
Hmn well I don't think it should be a huge problem. Instead of 80.3 and 12.4 of weights you can use 803 and 124. But well Why do you initialize those arrays to 8000 values? You are aware that the size thing the variable editor is talking about is bullcrap and it actually refers to initializing of indexes? Cause all arrays are always of a limit of 8192 |
| 02-19-2006, 08:09 PM | #7 |
I dropped the 2 arrays down to 500 each and now my triggers work fine. |
