HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Bug in loop function ?

09-24-2006, 02:00 AM#1
zen87
the traditional long long way of creating creep
Trigger:
SPAWNCREEP
Collapse Actions
Unit - create 1 CREEP[1] for player 12 at LOCATION facing Default building facing
Unit group - Add (last created unit) to UnitGroup[UnitGroupNumber]
Unit - create 1 CREEP[2] for player 12 at LOCATION facing Default building facing
Unit group - Add (last created unit) to UnitGroup[UnitGroupNumber]
Unit - create 1 CREEP[3] for player 12 at LOCATION facing Default building facing
Unit group - Add (last created unit) to UnitGroup[UnitGroupNumber]
Unit - create 1 CREEP[4] for player 12 at LOCATION facing Default building facing
Unit group - Add (last created unit) to UnitGroup[UnitGroupNumber]
and it goes on.

now, im using loop function
Trigger:
SPAWNCREEP
Collapse Actions
Collapse For each (integer A) from 1 to 5, do action
Unit - create 1 CREEP[integer A] for player 12 at LOCATION facing Default building facing
Unit group - Add (last created unit) to UnitGroup[UnitGroupNumber]

this 2 suppose to be the same right ? but when i tried to spawn creep (when all unit in UnitGroup has died) the second trigger only respawn 1 creep but the 1st trigger have no problem in respawn of all the 5 creeps...

whats going wrong...
09-24-2006, 02:13 AM#2
The_AwaKening
Odd, both should work the same. Post the whole trigger, maybe something else is causing the problem.
09-24-2006, 02:33 AM#3
zen87
Trigger:
Invis
Collapse Events
Unit - a unit dies
Conditions
Collapse Actions
Collapse If (all conditions) are true then (do action) els (do action)
Collapse If - conditions
(All units of UnitGroup[1] are dead) equals to true
Collapse Then - action
Unit Group - remove all units from UnitGroup[1]
Set CREEP[1] = ice troll
Set CREEP[2] = forest troll
Set CREEP[3] = ice troll priest
Set CREEP[4] = forest troll priest
Set CREEP[5] = troll warload
Set UnitGroupNumber = 1
Trigger - Run SPAWNCREEP(which is the trigger i posted above)
Collapse If (all conditions) are true then (do action) els (do action)
Collapse If - conditions
(All units of UnitGroup[2] are dead) equals to true
Collapse Then - action
Unit Group - remove all units from UnitGroup[2]
Set CREEP[1] = footman
Set CREEP[2] = footman
Set CREEP[3] = footman
Set CREEP[4] = priest
Set CREEP[5] = sorceress
Set UnitGroupNumber = 2
Trigger - Run SPAWNCREEP(which is the trigger i posted above)
and it repeats for all the creep camp in the map
09-24-2006, 02:37 AM#4
GamesSmash
This is what I use:

Trigger:
Collapse BlaBla
Event: Bla Bla
Condition: Bla Bla
Action:
Unit- create 5 (Bla Bla) for Player (Bla Bla) at position (Bla Bla)
set blabla_group = all units within 100 range of last created unit

aah trigger tags arent working
09-24-2006, 02:46 AM#5
zen87
Quote:
Originally Posted by GamesSmash
This is what I use:

Trigger:
Collapse BlaBla
Event: Bla Bla
Condition: Bla Bla
Action:
Unit- create 5 (Bla Bla) for Player (Bla Bla) at position (Bla Bla)
set blabla_group = all units within 100 range of last created unit

aah trigger tags arent working

but that only work if i wanted to create 5 unit of the same type, now im making a creep camp with different unit type *_*