# Replaced Unit won't Attack-Move

#### Widescreen

##### Member
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:

(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

#### AceHart

Well, splitting 6 minions into 3 and 3 is not "random 1 of ..."

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

#### Widescreen

##### Member
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).

#### AceHart

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

#### AceHart

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!

#### Attachments

• 43 KB Views: 104

#### Widescreen

##### Member
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
Dude! Chill out for the love of sake! I mention that it was a tower line so that means more than 1 tower. Your post was really useful and I am thankful but I can't get them to go to one of the two lines, would you mind giving the code a quick glimpse?

#### Attachments

• 411 KB Views: 83

#### AceHart

"It doesn't work" is not a very good problem description...

What are we looking at here?
When does the problem show?
How does it show?
Can I make it happen, or do I need to wait for... some magical moment?

What is sort of obvious from a look at the triggers:
- HasTowersUp and friends need to start at true, so either in some init trigger or directly in the variable editor
- UpOrDown should be initialized to 1 and there really needs to be one such variable per trigger, not one for all three
- Splitting Green probably wants to work with ...Right and ...Down rather than ...Up and ...Down

Random notes:
- Summon Roderal costs 125 mana, on a Hero that starts with 105
- Zyla can not be selected

#### Widescreen

##### Member
"It doesn't work" is not a very good problem description...

What are we looking at here?
When does the problem show?
How does it show?
Can I make it happen, or do I need to wait for... some magical moment?

What is sort of obvious from a look at the triggers:
- HasTowersUp and friends need to start at true, so either in some init trigger or directly in the variable editor
- UpOrDown should be initialized to 1 and there really needs to be one such variable per trigger, not one for all three
- Splitting Green probably wants to work with ...Right and ...Down rather than ...Up and ...Down

Random notes:
- Summon Roderal costs 125 mana, on a Hero that starts with 105
- Zyla can not be selected
Thank you very much. Yes, the game is on early stage it has become a problem that the hero will not be selected when first entering and I don't know why, maybe by duplicating the trigger?

#### AceHart

Well, some more looking:
> (Owner of (Entering unit)) Equal to (Random player from (All allies of Player 10 (Light Blue)))

Replace with:
((Triggering unit) belongs to an ally of Player 10 (Light Blue)) Equal to True

Same for the other conditions and teams

#### 3ICE

##### Cool Member
I bet "Replace" does not trigger the "unit enters region" event again. That's your problem. Edit: Elaborating: The minions being replaced with enchanted minions in the middle are already inside the region "center" when they are replaced, so technically the new units never entered center - the whole UpOrDown thing never fires. Here's a far simpler solution:
Event - Unit enters center
Condition: Unit type is Minion
Actions:
Replace unit with Enchanted Minion
If UpOrDown
Order unit to attack up
Else
Order unit to attack down

p.s.: I've seen you create "else" actions that Do nothing. Allow me to convince you to not do that: http://www.3ice.hu/blog/do-nothing-is-evil/

Last edited:
General chit-chat
Help Users
• No one is chatting at the moment.
• The Helper:
I was hoping you were going to say you wanted to be a cook and wished to open up a Food Truck there are so many opportunities for that here
• The Helper:
you can only open the bar if you sell food and a food truck in the parking lot counts
• The Helper:
here in houston
• The Helper:
most bars are struggling to build food prep and even some I know are doing there own food trucks
• The Helper:
but yeah man you should come to Houston there is so much more opportunity here than San Antonio. Just look at all the homeless people on the Riverwalk and downtown there you cannot even walk down the street without getting mobbed them
• The Helper:
check out this place apparently it is the best roommate site out there roommates.com lol
• Varine:
The homeless people reminded me of New York
• Varine:
I'll check it out, my lease expires in like a few months so I need to figure something out.
• Varine:
I tried to open a food truck in Sandpoint a few years ago but the city said no, then like two years later they passed new laws to encourage it and gave them all fucking tax breaks and shit. And at that point I didn't have enough money to go buy one so I was way too late to the game once other cities realized they could just bring their existing truck there, or sell their brick and mortar.
• Varine:
I do like food trucks though, they're way more fun than restaurants and usually I also get some of that tip money there.
• Varine:
Restaurants are really hard if you don't have a back up source of income to fund them sometimes, in my experience most owners either got really really lucky, had existing money that allowed them to buy an already successful one, or they have family money to fall back on for loans. It's few and far between to see very inspiring success stories where the person actually got it through hard work and perseverance. I thought about opening one lots and I always just end up not thinking it'll work. I would much rather just find someone that has that money and go work for them
• The Helper:
i am not talking about opening a brick and mortar I am talking about food trucks though I have seen some brick and mortar mexican places open up during covid that are doing good because there food is awesome!
• The Helper:
Food trucks are killing out here because Bars cannot open unless they sell food and the governor ok'd the use of a food truck in front as serving food
• The Helper:
Just not enough food trucks
• The Helper:
a buddy of mine just opened up a food truck and he is killing it but he is a great cook and has awesome food right in the middle of the pandemic too food trucks are immune to pandemic because they are take out in Texas you will always be able to get take out or delivery
• The Helper:
He is in the different food facebook groups in houston and posts videos of him making his food
• The Helper:
he is killing it
• jonas:
@Varine with the restaurants, there surely is a lot of luck and hard work but most restaurants fail because they suck. Flair isn't right, economics not well thought through, food is mediocre or sucks, location is bad, etc. If you're thinking about opening one, make sure you're looking at the stories of those that would be playing at your level, don't let your hopes be dragged down by all the subpar restaurants out there.
• jonas:
I'm a bit worried about the future of data science, there's an influx of incompetent people hired by incompetent managers, that can't last. But I'm sure smart data scientists will always be useful and hireable. Same as smart security people.
• jonas:
My sister in law worked in a vegan food truck, the owners were also making a killing, added several trucks and opened two restaurants over 5 years
• Ghan:
The CompTIA stuff is pretty much crap unfortunately. The places that ask for those low-level certs aren't likely places you want to work. For IT you really want a degree, but in the meantime you need to figure out some way to learn the skills. Cybersecurity is really hot right now so competition is fierce.
• tom_mai78101:
I realized I don't have anything much to say, other than "Good luck!". Compared to other places, I'm just very lucky we didn't have a lot of surges of cases coming in.
• The Helper:
My daughter just got back from school at Georgetown TX, outside of Austin and said there were 100 cases in the last week but she also said nobody was wearing a mask anywhere so people mask up and stay safe!
+2
• thewrongvine:
happy thanksgiving folks!
+1

### Members online

No members online now.