Gather Spawned Troops and Move Out

Archideas

Active Member
Reaction score
32
Alright, yet another problem I've stumbled upon that I just can't seem to fix and thus turn to the people of this lovely forum.

What I'm trying to do is to every 30 second spawn 3 melee units and 1 ranged, add them to a unit group and then order that group to attack move to a destinated point.

Now, as far as the spawning goes, it's all fine. BUT, the problem is, after about the 3rd to 5th time the desired units are spawned, there's a chance the created units will either move out or stay dumbfolded where they're created. This is what my triggers look like so far.

Trigger:
  • Events
    • Time - Every 30.00 seconds of game time
    • Conditions
    • Actions
      • Unit - Create 3 Soldier for Player 11 (Dark Green) at (Center of Zandar Force Spawn <gen>) facing 90.00 degrees
      • Unit - Create 1 Wizard for Player 11 (Dark Green) at (Center of Zandar Force Spawn <gen>) facing 90.00 degrees
      • Unit Group - Pick every unit in (Units in Zandar Force Spawn <gen>) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • ((Picked unit) belongs to an ally of Player 11 (Dark Green)) Equal to True
                • (Unit-type of (Picked unit)) Equal to Soldier
                • (Unit-type of (Picked unit)) Equal to Wizard
              • Then - Actions
                • Unit Group - Add (Picked unit) to ZandarForces
                • Unit Group - Order ZandarForces to Attack-Move To (Center of Azrethak Boss <gen>)
              • Else - Actions


Thanks in advance for answers!
 

Avaleirra

Is back. Probably.
Reaction score
128
You forgot to add them to the unit group :p


EDIT:nvm

EDIT2: does dark green have any allies?
 

Archideas

Active Member
Reaction score
32
Dark Green has allies, yes. They're Red, Blue, Teal, Purple and Yellow just FYI. :p

*EDIT*

Also, Dark Green is the CPU and the allies are players. I'll change the first condition to Belongs to Dark Green instead of Belongs to an ally.
 

Avaleirra

Is back. Probably.
Reaction score
128
Ya I was gonna say that cuz I was having problems on my map with the ally of (player) thing :)
 

Archideas

Active Member
Reaction score
32
Somehow I doubt it's that that's causing the problem, or am I wrong? It just seems weird that after 3-5 times some units just stand still while others do what they're supposed to. :S
 

Avaleirra

Is back. Probably.
Reaction score
128
Hmmmm, random guess but could it be that your condition has 2 "picked unit" functions and picked unit can only be used for one? (totally random guess)
 

Archideas

Active Member
Reaction score
32
I have completely no idea. I'm not really that set in to it, thus I've turned to the forum for help. I'd like to avoid having too many triggers for such a simple task so I'd rather not make two different triggers for each unit type if it's avoidable.
 

Bloodydood

New Member
Reaction score
14
Trigger:
  • Untitled Trigger 001
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Wait 30.00 seconds
      • Unit - Create 3 Soldier for Player 11 (Dark Green) at (Center of Zandar Force Spawn <gen>) facing 90.00 degrees
      • Unit - Create 1 Wizard for Player 11 (Dark Green) at (Center of Zandar Force Spawn <gen>) facing 90.00 degrees
      • Set Temp_Group = (Units in Zandar Force Spawn <gen> matching (((Owner of (Matching unit)) Equal to Player 11 (Dark Green)) and (((Unit-type of (Matching unit)) Equal to Soldier) or ((Unit-type of (Matching unit)) Equal to Wizard))))
      • Unit Group - Pick every unit in Temp_Group and do (Actions)
        • Loop - Actions
          • Unit - Order (Picked unit) to Attack-Move To (Center of Azrethak Boss <gen>)
      • Custom script: call DestroyGroup (udg_Temp_Group)
      • Trigger - Run (This trigger) (ignoring conditions)


I think this should do it.
 

Avaleirra

Is back. Probably.
Reaction score
128
Ya I can't see the problem... Maybe upload your map so that people can see? (I can't because I'm on my iPod)

EDIT: what bloodydood did looks right
 

Bloodydood

New Member
Reaction score
14
You can ignore the "Wait 30 seconds" and "Run This Trigger (Ignoring Conditions)" and keep the Periodic Event. I don't think there's a problem with either.
 

Archideas

Active Member
Reaction score
32
I'll try it out right away, Bloody. I'll let you know if it works or not.

*EDIT*

Works perfectly now! Thanks Bloody and Avaleirrra for your support. + rep to you both.

**EDIT**

Instead of making a new thread, I figured I'd put another question here.

I basically want to create a spell that makes the hero with a certain ability to gain Invisibility if an enemy hero casts a spell within 800 range of said hero. How do I most efficiently work this out? I'm stuck at the part where I can efficiently add and remove units from a Unit Group that I've made for this specific spell in question.

After hero1 learns the skill it runs a trigger that checks ever 0.5 second for enemy heroes within 800 range of hero1 and if it finds one, it'll be added to the Unit Group.

I have no idea now how to remove the unit if it goes outside of range of hero1. If there's a better way to do this, please share cuz I'm stumped. :(
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top