Replaced Unit won't Attack-Move

Discussion in 'World Editor Help' started by Widescreen, May 4, 2019.

  1. Widescreen

    Widescreen Member

    Ratings:
    +0 / 0 / -0
    Hello, I have a wave of minions that as soon at it appears it will Attack-Move to one of two enemy tower lines, but once it reaches the middle it will be replaced by another minion. Everything good so far. My problem is that the replaced minion will stay still once it is converted, this is the code I have which is wrong:

    [​IMG]

    (The spirit tower is the Final tower or "Nexus")

    I would like for the minions, once they have converted, to attack-move to a random 1 of two enemy lines. the waves consist of 6 minions and the ideal will be for 3 to go to one enemy line and the other 3 to the other(once they are replaced).

    Thank you for your time
     
  2. AceHart

    AceHart Your Friendly Neighborhood Admin

    Ratings:
    +1,483 / 0 / -0
    Well, splitting 6 minions into 3 and 3 is not "random 1 of ..." :p


    For a perfect split, something like this might do:

    On Map Init, prepare a point array with the positions of those towers:
    Set Towers[1] = Position of pre-placed-tower-1
    Set Towers[2] = Position of pre-placed-tower-2

    And some integer variable that starts at 1 (I called it CurrentTower below)


    The sending them off part could then be:
    Unit - Order (Last replaced unit) to ... to Towers[CurrentTower]
    Set CurrentTower = 3 - CurrentTower
     
  3. Widescreen

    Widescreen Member

    Ratings:
    +0 / 0 / -0
    I didn't understand can you be more specific, please? The target of the replaced minion are 3 towers (three on one side and 3 on the other) not 1, and there should be something for when the first tower or second and even the last one is destroyed to move on to the next one (if the last one is not destroyed).
     
  4. AceHart

    AceHart Your Friendly Neighborhood Admin

    Ratings:
    +1,483 / 0 / -0
    This is the rant post, a helpful reply will follow below:

    Oh, really?
    THEN WHY THE DAMN CRAP WAS THAT INFO NOT IN POST #1???
    Do you really think that anyone would just randomly guess what the problem is?
    Are people really that out of sync with reality?
    We are not mindreaders here...

    Basically, posts #1 and #3 and mutually exclusive... wtf
     
  5. AceHart

    AceHart Your Friendly Neighborhood Admin

    Ratings:
    +1,483 / 0 / -0
    Well, that of course changes everything... you should have started there.

    This just needs a bit of fine-tuning then.
    As in, you need to keep track of what tower is currently the "first" in each line, and adjust as needed.
    Then use the splitting system from above as long as there are towers in both lines, and ... as needed if one line is empty.

    I have attached a demo-map here.
    You can kill towers, and footman, by clicking them, so it's easy to test it out in all variations.
    Note: only ever kill the towers in order!
     

    Attached Files:

Share This Page