# World Editor keeps creating mystery problem.

Status
Not open for further replies.

#### ventuz

Level 2
I can't stand it anymore.. I'm pretty close to finishing up my map.

I change "count down" trigger to make debugging go quicker and figure out whats the problem in map, which I already solved. I tried to go change back count down trigger the way it was before. Now what happen?.. It didn't restore.

I mean before when I was debugging, count down was only 1 second. I wanted to fix it that new count down is 10 seconds, but it still only doing 1 second. I mean WTF, is it ignoring "Integer A from 1 to 10"? It WAS working before.

• Set countdownint = 10
• For each (Integer A) from 1 to 10, do (Actions)
• Loop - Actions
• Game - Display to (All players) for 1.00 seconds the text: (String(countdownint))
• Set countdownint = (countdownint - 1)
• Wait 1.00 seconds
• Game - Display to (All players) for 3.00 seconds the text: Go!
Explanation - this is ONLY small part of whole trigger, the reason I'm using countdownint is that I couldn't do Integer A from 10 to 1, it won't work.

#### YoshiRyu

Level 9
i'm pretty sure that "from 10 to 1" was never working, because A is incremented at each execution of the loop and so, it never reach 1 starting from 10...

You should improve your mathematical skill:
A go from 1 to 10, and you want a countdown going from 10 to 1,
that's pretty easy... display (11-A)
A=1 -> 11-A=10
A=2 -> 11-A=9
A=3 -> 11-A=8
...
A=9 -> 11-A=2
A=10 -> 11-A=1

anyway, their is countdown object in warcraft 3, you sould use it instead

#### ventuz

Level 2
what you talkin about? you clearly didn't read my trigger. I don't like usual Blizzard countdown because it's ugly and doesn't work along with my command trigger.

first line is countdownint = 10, it's an integer

second line is For each integer A from 1 to 10, should execute 10 times! followed by:
Game display message (countdownint).. so it say 10 first time
Set countdownint = countdownint - 1, what's wrong with my math?
Wait 1 second for next number obviously.

3rd line is simple game message to everyone "GO" when For each is over.

#### YoshiRyu

Level 9

first, "from 1 to 10", there is only 9 instances of the loop.
then, i just say you that you're "countdown" is equal to 11-A, so it is an useless variable, a simple substraction can replace it, that was the laius about math.
and finally, i say you that A has always been incremented at each instance of the loop, so it has never be able to go from 10 to 1, because by adding 1 as many time as you want to 10, you never reach 1, you do an infinite loop.

i have no idea about what your trigger doesn't work, it sould work, but maybe you souldn't copy "only a small part" of it...

#### Los_Tacos

Level 7
first, "from 1 to 10", there is only 9 instances of the loop.

I'm pretty sure there's 10.

For things like this I'd rather use Jass. The gui loop is sketchy and can only count up, unless you use subtraction but that only makes it more confusing.

Also having a "wait" in a gui loop could be problematic because Integer A is a global variable.

Code:
``````local integer n = 10
loop
exitwhen n<=0
call BJDebugMsg(I2S(n))
set n = n-1
call TriggerSleepAction(1)
endloop``````

#### ventuz

Level 2
first, "from 1 to 10", there is only 9 instances of the loop.

After reading this, I'm no longer taking advice from you. From 1 to 10 is 10 instances. I merely only was looking for answer to why trigger NO LONGER WORKS for no reason. But you came to post saying "your math suck, why don't you use blizzard's count down", these aren't what I'm looking for.

Also having a "wait" in a gui loop could be problematic because Integer A is a global variable.

Code:
``````local integer n = 10
loop
exitwhen n<=0
call BJDebugMsg(I2S(n))
set n = n-1
call TriggerSleepAction(1)
endloop``````

NOW that explains it. Thanks, I'm not good with JASS, it just that too many Blizzard's function to memorize causing me refuse to go learn JASS. Maybe I'll try learn, but I don't got much time anyway.

#### YoshiRyu

Level 9
I'm pretty sure there's 10.
I'm pretty sure... that i was too tired when i had written that...
of course the warcraft loop include both bounds, that's not c++ -_-

as you wish, i don't care about your life on the hive (i will probably still answer you because i never read the poster's nick when i read a message, but you're free to ignore my advice, you're also free to think i'm stupid, i don't care)
PS: i've never said "you're math suck", but if you asume that i'm just flamming you, that's probably what you read when i'm juste writing that "you should improve you math skill"

so now an advice you won't read : if the probleme is because interger A is a global (i dunno, i never use integer A or B) just use a loop on a local integer, to do this, declare à global variable like loop_integer, then, at the begining of the actions, write the custom script "local integer udg_loop_integer", and then, use your loop with "loop_integer" and it should work. (and stay almost fully GUI)

Last edited:

#### ventuz

Level 2
I already have another method in head, but I'm not interested on working on map anyway. GUI always increasingly pain in the ass.

Status
Not open for further replies.

Replies
7
Views
1K
Replies
4
Views
694
Replies
5
Views
570
Replies
7
Views
3K
Replies
1
Views
702