Staredit Network > Forums > SC2 General Discussion > Topic: [Info] "For each" Undocumented Change 2.0.10
[Info] "For each" Undocumented Change 2.0.10
Aug 8 2013, 2:49 am
By: Ahli  

Aug 8 2013, 2:49 am Ahli Post #1

I do stuff and thingies... Try widening and reducing the number of small nooks and crannies to correct the problem.

"For each integer/real" works differently after 2.0.10.

After finishing the loop, the variable won't end with the end value that you set in that function anymore (or the last correct value it had before).

For example, the following code ends with A being set to 10.0 after the loop:
Code
General - For each real A from 0.0 to 9.0 with increment 1.0, do (Actions)


Due to the way sc2 translates GUI to mapscript's galaxy code, maps can only be bugged when you update them. So, if you've updated your map or plan to update it, you might be adding bugs to it without being aware of that.

So, please check your maps for possible side effects. Note that this can only be a problem when you re-use the current value of the loop's variable.




Aug 8 2013, 8:33 am TF- Post #2

🤙🏾

Shouldn't this be getting fixed?

Probably not worth a thread but a thing I noticed is if you're changing a unit's max energy, its current energy gets set to the max energy now. Made for a small bug in my mod.



🤙🏾

Aug 8 2013, 9:46 am Lanthanide Post #3



It's a bit crap of Blizzard to change behaviour of a functional item like that, but I'd also suggest that if you were using "foreach", you shouldn't have been expecting variable A to have any particular value at the end of the loop.

Foreach has a distinctly different semantic meaning compared to a for loop which explicitly increments the counting variable and uses a test against that variable in order to exit the loop. Foreach literally just means "do this thing on all of the items in this loop", theoretically your use-case shouldn't care in what order the action is performed, just as long as it is performed exactly once for each item - the resulting value of the variable used to control the loop therefore shouldn't be assumed (unless the API indicates the value to expect). A for loop on the other hand is much less structured, and since it is simply checking against a variable value to decide when to exit the loop, the variable can be manipulated in numerous different ways within the body of the loop to give different exit behaviours, as well as for loops often being explicitly used to determine the appropriate value of the variable for further use (eg, count the number of characters in a string).



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[08:36 am]
Brusilov -- Hey, what happened to EUDDB? Is there a mirror for it somewhere? Need to do a little research.
[11:31 pm]
Vrael -- :wob:
[08:42 pm]
Ultraviolet -- :wob:
[2024-5-08. : 10:09 pm]
Ultraviolet -- let's fucking go on a madmen rage bruh
[2024-5-08. : 10:01 pm]
Vrael -- Alright fucks its time for cake and violence
[2024-5-07. : 7:47 pm]
Ultraviolet -- Yeah, I suppose there's something to that
[2024-5-06. : 5:02 am]
Oh_Man -- whereas just "press X to get 50 health back" is pretty mindless
[2024-5-06. : 5:02 am]
Oh_Man -- because it adds anotherr level of player decision-making where u dont wanna walk too far away from the medic or u lose healing value
[2024-5-06. : 5:01 am]
Oh_Man -- initially I thought it was weird why is he still using the basic pre-EUD medic healing system, but it's actually genius
[2024-5-06. : 3:04 am]
Ultraviolet -- Vrael
Vrael shouted: I almost had a heart attack just thinking about calculating all the offsets it would take to do that kind of stuff
With the modern EUD editors, I don't think they're calculating nearly as many offsets as you might imagine. Still some fancy ass work that I'm sure took a ton of effort
Please log in to shout.


Members Online: DiearAnother, Brusilov, eksxo