• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] Multiple spawning destinations for units.

Status
Not open for further replies.
Level 2
Joined
Aug 30, 2007
Messages
23
I am working on a map project that fuses elements from hero arenas, dota, footman frenzy. I have the unit spawning down, and then I got another idea to make the map even more insane. Instead of two sides, have 4. Now, the only problem with this, is that I don't know how to make the spawn point destinations selectable. I want it to be configurable so that people can configure thier spawns so that they will attack one of the 3 other peoples bases. I am not sure how to do this, but I will post an example of how my nits are spawned.

  • Events
  • Time - Every 20 seconds of game time
  • Conditions
  • Actions
    • Player Group - Pick every player in Player Group - Player 1 (Red) and do (Actions)
      • Loop - Actions
      • If (All conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Region Centered at ((Picked player) start location) with size (384.00, 384.00)) contains (Random unit from (Units owned by (Picked player) of type Barracks))) Equal to True
        • Then - Actions
        • Unit - Create 1 Swordsman for (Picked Player) at Center of (Region centered at (Player 1 (Red) start location) with size (384.00, 384.00) facing default building facing degrees.
        • Unit - Order (Last Created unit) to attack-move to (Center of (Region centered at (Player 8 (pink) start location) with size (3840.00, 384.00)
        • Unit - Create 1 Swordsman for (Picked Player) at Center of (Region centered at (Player 1 (Red) start location) with size (384.00, 384.00) facing default building facing degrees.
        • Unit - Order (Last Created unit) to attack-move to (Center of (Region centered at (Player 8 (pink) start location) with size (3840.00, 384.00)
      • Else - Actions
        • Do Nothing
      • If (All conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Region Centered at ((Picked player) start location) with size (384.00, 384.00)) contains (Random unit from (Units owned by (Picked player) of type Firing Range))) Equal to True
        • Then - Actions
        • Unit - Create 1 Gunsman for (Picked Player) at Center of (Region centered at (Player 1 (Red) start location) with size (384.00, 384.00) facing default building facing degrees.
        • Unit - Order (Last Created unit) to attack-move to (Center of (Region centered at (Player 8 (pink) start location) with size (3840.00, 384.00)
        • Unit - Create 1 Gunsman for (Picked Player) at Center of (Region centered at (Player 1 (Red) start location) with size (384.00, 384.00) facing default building facing degrees.
        • Unit - Order (Last Created unit) to attack-move to (Center of (Region centered at (Player 8 (pink) start location) with size (3840.00, 384.00)
      • Else - Actions
        • Do Nothing


Thats a small segment of the code for player 1, and only for the units created at his base (It does the same thing for 5 other players as well, with the same amount of units exept for the 'flank' people which spawn only 1 unit. Note that it is the same for the second force as well) The triggers for reds team mates are the same as well, so if player 2 also had a barracks, they would both have 4 footman at each base, for a total of 8 down the center lane. There are 5 paths in total, and so far, I have 13 repetitions for different units in the coding, as I shortened the coding for the example, and took out the other 11 units. Now, As stated, and a reminder, I want the essential same thing, but for 4 players, and the option to make the spawns run to one of the other 3 enemy bases. Also, If there is any more efficient code to reduce possible lag that others may experiance (I have a rather high end computer, so it is non existant for me in war 3, unless somebody hosting another game that I am in lags.)

Also, if possible, I would like the unit to carry on its previous action if it is issued a new one for right clicking (Like in castle fight, note that I already have all spawns classified as wards so that MIGHT be enough of a deterent, but they can still be commanded)

Once I can get this thing up, I am planning on posting a rough beta, and plan on recruiting people if possible.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
Attacking has nothing to do with the spawning.

To attack you can simply pick all the units in a region and order them to attack-move to the base you want.

You should check your leaks though. You leak 10 points every 20 seconds (maybe also 10 region leaks ? don't know about them).
You also don't need those 2 "Do Nothing" as they do nothing and take your memory.
 
Status
Not open for further replies.
Top