In my map, I have a really huge trigger and I'm planning to make about 5 more of that size...
(When I say huge I mean incredibly humongous)
Basicly, there are like 45 HUGE If/Then/Elses within the trigger.
Would it be better to make 45 triggers to act in the same way instead? I mean would it increase editor or game speed once I'll have the whole bunch of em all at once?
Or should I start learn scripting? :P (sry lol I dont use it yet...)
Sounds like that can be reduced to one fairly small trigger by using switch-case, arrays and loops.
Reverting back to my second answer... Never compare if two Reals are equal.
Maybe there is another way to achieve your goal. What exactly are you trying to do and what goes wrong?
You could use an integer variable and convert it to a real when setting the transparency. If your using reals, there is something you should absolutely not do: compare if two of them are equal, because that might not happen. Always use a tolerance. In your case I would recommend something like:
Im wondering why, whenever my real number gets to 140.52 it adds a 1.. so its, 140.521.... And when you get higher, 141.521 it becomes 141.522 any way to stop this, or change it somehow?
It could help to see your trigger, because it looks like a numeric problem.
The thing is, that for example a number such as 0.2 does not exist as a floating point number. It will convert to something like 0.19999998807907104 which is quite close to 0.2, but not exactly. That is because 0.2 is periodic in the binary system and the internal represenation of this number is finite and may be rounded. So it is always wise to use power of two numbers (if possible) like 0.0625, 0.125, 0.25, 0.5, 1, 2, 4, 8, 16, .... to avoid these problems.
@RileyStarcraft: Do you know if Starcraft 2 uses the IEEE 754 standard?
I don't know if it has been mentioned, but when a unit has time warp on it and uses an ability which isn't supposed to cost a turn, it will destroy the time warp effect.
some more bugs:
restore costed 36sp and I had exactly 36sp, but I was not able to use it.
It happens that when (Vaas) having 0Sp the bar still is not empty.
Using timewarp and then timewarp again the next round, allows to do three actions (including one timewarp). It seems that you can't take any advantage of that, but it doesn't seem to be the way it is supposed to be.
I want a unit to look bigger, so I set the Art-Scale to 2.0 for example. The problem now is, that the selection circle also increases in size, which is something I absolutely do not want. Is there a way to set the size of the selection manually? Or another way to prevent this from happening?
Thanks in advance.
EDIT: maybe its not the best solution, but it is possible to adjust the selection scale in the model under Selection Radius.
For novices like myself, here was the major issue that I never knew. I had assumed that the Condition of an Event was essentially a built in If-Then-Else statement, no different than any other. How wrong I was. Let's say you have a trigger that fires on a unit dying, and you have five different sets of actions you want to do depending on the type of unit. If you have no condition set up for that event, that event fires every time ANY unit dies, as you might expect. If you DO have a condition, and five seperate triggers (one for each unit type), only the proper trigger will fire, reducing your trigger run count by about 80% from your non-conditioned trigger, and thats assuming you only have five different unit types. Imagine how much efficiency you will have gained if you had 30!
Wouldn't it be better to just add an OR-condition including all the unit types used in that trigger? So you would still be able to do everything in one trigger, because redundant triggers are very bad style. Internally it would have to check the conditions anyway, so i am not sure about a serious performance gain, but if you want to be sure, I would recommend doing it this way:
0
Sounds like that can be reduced to one fairly small trigger by using switch-case, arrays and loops.
0
They are also required for loops:
Or more fancy stuff, like graph algorithms:
0
Alternative solution:
"index of highest number" is what you would call the "source".
0
Choose Comparison, then select unit type and there you are:
0
Reverting back to my second answer... Never compare if two Reals are equal. Maybe there is another way to achieve your goal. What exactly are you trying to do and what goes wrong?
0
You could use an integer variable and convert it to a real when setting the transparency. If your using reals, there is something you should absolutely not do: compare if two of them are equal, because that might not happen. Always use a tolerance. In your case I would recommend something like:
Where tolerance should be 0.1 or 0.01 or something like that.
or even better:
0
It could help to see your trigger, because it looks like a numeric problem.
The thing is, that for example a number such as 0.2 does not exist as a floating point number. It will convert to something like 0.19999998807907104 which is quite close to 0.2, but not exactly. That is because 0.2 is periodic in the binary system and the internal represenation of this number is finite and may be rounded. So it is always wise to use power of two numbers (if possible) like 0.0625, 0.125, 0.25, 0.5, 1, 2, 4, 8, 16, .... to avoid these problems.
@RileyStarcraft: Do you know if Starcraft 2 uses the IEEE 754 standard?
0
Yeah it works. Just added another roadtype and restarted the map and there it is. Thank you.
0
I have the same question, but I don't even manage to change the road type. How do I do that?
0
This solution doesn't work very well. Is there a way to set an absolute selection radius?
0
I don't know if it has been mentioned, but when a unit has time warp on it and uses an ability which isn't supposed to cost a turn, it will destroy the time warp effect.
some more bugs:
0
Unchecking somehow seems to disable the grid, but when its on, I am not allowed to place the structure in space.
0
Hi,
I want a unit to look bigger, so I set the Art-Scale to 2.0 for example. The problem now is, that the selection circle also increases in size, which is something I absolutely do not want. Is there a way to set the size of the selection manually? Or another way to prevent this from happening?
Thanks in advance.
EDIT: maybe its not the best solution, but it is possible to adjust the selection scale in the model under Selection Radius.
0
Yeah but when trying to place it in the editor, it can be placed everywhere. It doesn't snap to the grid.
0
Wouldn't it be better to just add an OR-condition including all the unit types used in that trigger? So you would still be able to do everything in one trigger, because redundant triggers are very bad style. Internally it would have to check the conditions anyway, so i am not sure about a serious performance gain, but if you want to be sure, I would recommend doing it this way: