Warcraft III resources & community, 2003–2006 · archived

Help! Got a triggering problem...

10 posts
#1

Help! Got a triggering problem...

I don't know how many times I'v come across this, but in many trigger faq it says:

If <Something> then do <something> else do (Actions)

What does they mean by the last one? Okay, it might be simle, but I have missed something.
And also under some of this it says:

Loop - Actions

What does that mean? Where do I finde this?
#2
Well, hmm...the else actions are ones that are done in case that the first one aren't. For example,
If [music_playing=true](this is var) then do [Sound - Stop Music] else do (now another If/Then/Else) If [music_playing=false] than do [Sound - Play Music] else [Do nothing]
#3
here it is: if ALL conditions are true, then the actions after "then" are being executed. if any of the conditions fails, so in any other case, the actions after "else" are being executed.

So whenever you have an IF/THEN/ELSE statement, either stuff stated after "then" or after "else" is being run. small example:

IF:
- Dummy_Integer_Variable == 1
THEN:
- Send text message to all players -> "Variable is 1"
ELSE:
- Send text message to all players -> "Variable is not equal 1"

gl,

klovadis
#4
I think you missunderstood me there. I know what if/then/else is. But in some tutorials and other stuff like that there could be a trigger like:

If Dying unit equel to Footman then do create footman else do (Action)

I mean what the part 'Else do '(Action)'' is. Can't finde that option in the action-list.
#5
this "Else do '(Action)" serves as a spaceholder, it is not a valid command but just says "do whatever you want here". if you don't want to do anything, select "Do Nothing".

klovadis
#6
Okay, then we enter my second question...
What does they meen with 'Loop-Actions' ?
I'v seen screenshots from other trigger where they have that command and a whole lot of triggers after that. It seams like I need this trigger to get my multiboard to work.
#7
Loop Ations doesn't really mean anything like in this

Loops Actions
Events
Map initialization
Conditions
Actions
Player Group - Pick every player in (All players) and do (Actions)
Loop - Actions
Game - Display to (All players) the text: Loop Actions don't ...
-------- Unless --------
For each (Integer A) from 1 to 10, do (Actions)
Loop - Actions
For each (Integer B) from 1 to 5, do (Actions)
Loop - Actions
Unit - Create 1 Forum_Variable[(Integer B)] for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing (270.0) degrees
It will make 10 of Forum_Varible 1-5 for Player 1

I'm pretty sure I did that right...
#8
Loop actions in general are used for doing a few commands multiple times, depending on few variables that change. I.e. we want to display the number from 1 to 10 to the users so we create a trigger:

For each (Integer A) from 1 to 10, do (Actions)
Loop - Actions:
- Display to (All Players) the text: String(Integer A)

This action, or any actions in the for-each>loop are being executed 10 times. In the case of your multiboard, I think these loops refer to every player (> the player number is a variable) or to every row/item.


klovadis
#9
it inately is joined to a For loop (often For Loop Integer A/B)

i suppose you could also do a while loop, but in waredit that would probably have to be done recursively
#10
Thanks for your help everyone. Now I can get on with my map. :)