| 08-09-2004, 02:23 PM | #1 |
Right now, im testing what the possibilities with the trigger "For each integer A" is. I've never used it before, so i dont know much about what you can do with it. Is there a way to apply a camera for all players through a loop? I dont really see how you would do the "for player" part. Anyway, i hope someone can help me |
| 08-09-2004, 02:52 PM | #2 |
Simply, by looping from 1 to the max player number in a map, and then converting the For Loop Integer A to a player index. |
| 08-09-2004, 03:12 PM | #3 |
For loops are similar to any of the "pick all ****..." functions. Both are Loops. That is to say that they repeat the same action across a set number of times. For- loops are most commonly used in any good spawn trigger. Instead of making a block of 40 troops spawn, picking all units within the spawn region then issuing a move order, what you should do is have a for-loop loop 40 times creating each individual unit and ordering each individual unit as it is created. Like so: Code:
Event:
<whatever>
Condtions:
<whatever>
Actions:
For each integer 1-40 do:
Unit-create 1 footman at <Spawnloc> facing default building angle
Unit issue order targeting a point- Order <last created unit> to <attack-move> to <targetloc>That's just one example though, there are many many other uses for for-loops. But be careful with loops because if they are badly coded they can create massive mem leaks or overtax your processor. |
| 08-09-2004, 03:28 PM | #4 |
Like this: "Camera - Apply Cam <gen> for (Player(1)) over 0.00 seconds" ? |
| 08-09-2004, 04:54 PM | #5 | |
Quote:
|
