HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Creating units problem

07-02-2005, 10:03 PM#1
Limb_Smasher
Hey the situtation im in is that its like a traditional footman wars kinda deal, you get a building and units spawn around the building. Except my problem is that when 2 of the same people have the same building the units spawn at weird and random intervals. What i mean by this is that P1 will get 1 footman and then P2 will get 1 footman and then another right after that and then another and then P1 will get his second. Which this leads to an unbalanced amount of units. Heres an example of my triggers:
Code:
Footman O2
    Events
        Time - Every 8.00 seconds of game time
    Conditions
    Actions
        Player Group - Pick every player in (All players) and do (Actions)
            Loop - Actions
                If (((Region centered at ((Picked player) start location) with size (384.00, 384.00)) contains (Random unit from (Units of type Keep of War))) Equal to True) then do (Unit - Create 1 Footman for (Picked player) at ((Picked player) start location) facing Default building facing degrees) else do (Do nothing)

The "Keep of War" is the name of the building
07-02-2005, 10:19 PM#2
Guest
Code:
Random unit from (Units of type Keep of War)
I think this is your problem. Every 8 seconds or so, this may be true for one player but not for the other. I'm not sure exactly what you're trying to do, as I've never played Footman Wars, but I'm fairly confident this is your problem. Try to change it to something else maybe.
07-02-2005, 10:34 PM#3
Gurrgel
Try this instead, it should work.

Code:
Footmen Trigger Test
    Events
        Time - Every 8.00 seconds of game time
    Conditions
    Actions
        Unit Group - Pick every unit in (Units of type Keep of War) and do (Actions)
            Loop - Actions
                Unit - Create 1 Footman for (Owner of (Picked unit)) at (Position of (Picked unit)) facing Default building facing degrees

As eclips)e said, the problem is that you're using Random Unit from Unit Group, therefore, it will pick a new unit of that kind every time, so if you have more than one of the building on your map, it won't work, since the randomly picked building might be another one than the one in the region.
07-02-2005, 10:54 PM#4
Limb_Smasher
ah shouldve seen that one, thanks