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.
[07:31 pm]
Dem0n -- Oh_Man
Oh_Man shouted: i wonder how they did grand moff tarkins voice in star wars
Got someone to do a decent impersonation and then used professional audio engineers to make it sound like the original actor
[2024-3-01. : 8:11 pm]
IlyaSnopchenko -- Sure doesn't sound perfect... nothing is. I know it's better than my own attempts at voiceacting (but I'll have to resort to that, too; I've just been putting that off for ages).
[2024-3-01. : 2:58 pm]
Oh_Man -- i wonder how they did grand moff tarkins voice in star wars
[2024-3-01. : 2:58 pm]
Oh_Man -- oh right, yeh if ur trying to do additional dialogue for dead or unavailable actors then its ur only option. it still doesnt sound perfect though
[2024-2-29. : 8:30 pm]
IlyaSnopchenko -- I'm 99% satisfied with the results Jun3hong was able to extract from Elevenlabs for our project... but of course YMMV
[2024-2-29. : 8:29 pm]
IlyaSnopchenko -- It is a good solution for original characters, I guess, but if you want to visit a canon character, there's bound to be issues.
[2024-2-29. : 11:05 am]
Oh_Man -- the alternative is go on voices dot com or some pay to play sites and hire some cheap talent
[2024-2-29. : 9:18 am]
Sila12 -- Nothing
[2024-2-29. : 5:20 am]
IlyaSnopchenko -- Mind you, it was almost impossible to get decent expressions for Zeratul, mostly because he is very much emotionless most of the time in his real voice lines. Which is understandable for story reasons, of course, but not beneficial for our purposes. :-)
[2024-2-29. : 5:18 am]
IlyaSnopchenko -- I feel it's good enough, and the alternative is having nothing at all. And sometimes, in our case, Jun3hong got surprisingly good performance out of the AI. You can ask him how many attempts it took him.
Please log in to shout.


Members Online: RaNer