| 03-04-2004, 04:11 AM | #1 |
From everything that I have been taught about programming from my brothers and you guys is that an array really doesn't need a size assigned to it. Why did blizzard add a GUI array size thing? I don't get it. Arrays still work properly if you leave the size at 1 (or whatever is default). When coding in JASS I never go local unit array size 100 them = GetUnitsWithinLocAll() because we all know that would give multiple compile errors. So, back to my original point, why did blizzard put this seemingly useless function into Warcraft? [edit] another little JASS qeustion I had was: When strings get stored into the string thing that Warcraft generates with your map, when you delete the action that calls that string does that mean that that string is deleted? Because if that wasn't the case I would have a lot of extra strings just laying around taking up space. |
| 03-04-2004, 05:59 AM | #2 |
The problem was that using uninitialized variables causes a thread crash. An example: local integer array I set I[0] = I[0] + 1 ----> Thread Crash Normally, when you only assign a value to that var there's no problem. Example: local integer I set I[0] = 1 ----> Works of course Blizzard changed it so array variables would be initialized for the specified range at map initialization eg. set I[0] = 0 so set I[0] = I[0] + 1 won't cause a thread crash any more coz it's already got a value Regarding the other question: Yes, strings are deleted from the wts file when there's no reference to them any more. |
| 03-04-2004, 01:48 PM | #3 |
Ohhh.... So they did do it for some stupid reason for the general public. I c now. Anyone know about the string question? |
| 03-04-2004, 03:33 PM | #4 | |
Quote:
Note though that Blizzard did a pretty stupid thing there as this initialization is done in the main initialization thread and this thread is cancelled like any other thread when it runs too many statements. So if you set the array size very high, it causes the thread to be stopped before it reaches the InitTrig functions of all the triggers, so the triggers are not registered or initialized. |
| 03-04-2004, 03:49 PM | #5 | |
Quote:
It is good to know that |
| 03-04-2004, 10:05 PM | #6 |
Ahhh.... I take what I can do in JASS for granted then. I never even thought that I couldn't do this in GUI. Code:
local group them = CreateGroup() |
| 03-05-2004, 07:21 AM | #7 | ||
Quote:
.......... Quote:
|
| 03-05-2004, 01:55 PM | #8 |
Sorry my bad. This thread has served its purpose, could some mod delete it plz? |
| 03-05-2004, 02:04 PM | #9 |
I will definitely not delete this thread as it contains some useful information that should be available via the search function. |
