Set acquisition range of units targeted by sheep spell

Hello, I am making a 4 player custom coop map and ran into an issue:

I have enemy unit attack waves (ghouls, crypt fiends, necromancers etc.) with “attack-move”- and a few are “patrol” command to a region. There is an issue: if you use sorceress to sheep enemies they don’t move afterwards and just stand still rest of the game. Same issue when enemies finish cannabilize ability they just stand still and don’t continue attack-moving to area.

Is it possible to make something like this?:
Event: “Unit gets sheeped”
Condition: “Unit is owned by red, pink, yellow or orange”
Action: “Set acquistion range of sheeped unit to 5000”

Any help would be appreciated as I just can’t seem to solve how to make such a trigger.
Regards Dani

It is pretty hard to make since Event only recongnized specific units that have been placed in the map not by triggers.

You can put each of the units created by trigger in a variable unit Unitcount that has enought count to fill them all.

For example:
Trigger X

Events : Map initialization
Actions :
For each integer A 1 to 20
Create a unit sorceress
add Last created unit to Unitcount[Integer A]

Trigger Y

Event : Every 1 second of the game
Condition :
Action :
Foreach integer A 1 to 20
If unit issue order Unitcount(Integer A) equals to stop then issue order matching unit to attack move into (0,-20000) else to do nothing

1 Like

hi tested the thing i posted here and noticed unit issue order comparator doesnt work. i build work-around for this but my work crashed and second time it wouldnt allow me to save (weird).

there is also a much more simple solution (not so delicate) for your issue
and its simply make event : every 1 second of game
action: pick every unit owned by cpu and make issue order into random point.

there are slight negative downsides on this like it interrupts targeted spells and it interrupts their animation but aside from that its best for beginner to slightly advanced user.

if you want to make things in a professional way. you need to modify trigger y from previous post following way:

First create new variable point named UnitPos[20] with amount of room for all units that are being detected in the same time:

Event : Every 1 second of the game
Condition :
Action :
Foreach integer A 1 to 20
set Point UnitPos[Integer A] to current position of Unitcount[Integer A]
wait 0.5 seconds
For each integer A 1 to 20
if Current position of UnitCount[Integer A] equal to UnitPos[Integer A] then
do nothing else to do issue order UnitCount[Integer A] to attack move into (0,-20000)

In my testes this worked fine except when units start attacking other units and stop their movement speed and detector think they idle. To work around this you need also another detector that detects if the unit is attacking other unit. However for some reason reforged did not allow me to use 3 times “for each Integer A x to z” loop in a same trigger. so we might wanna abondom the idea of making it too complicate. (its bugged or whatever).

edit. little spell mistake corrected

Thank you for all the time spent. I’ve developed my map since november and this is just too advanced to solve. I was hoping there was a simple and optimized way hence I’ve been asking around for any tips. A workaround would be to change sorceress spell sheep into necromancers cripple spell/or hydromancer crushing wave, and cannibalize for ghoul and abomination to always regen health even when not on blight for the computer slots not controlled by AI.

I think this is pretty simple

Event: Unit finishes casting a spell
Condition: Unit type of casting unit equal to sorceress
Unit issue order triggering/casting unit to attack move into *point(0,0)

*(put original position here where you meant to attack move him)

if this doesnt work put a little wait time before making an action hence there could be some animation delay. (i just wrote it here without testing)

something like wait 0.2 seconds

OR if the sorceress are not part of enemy wave units.

Then

Event: Unit finishes casting a spell
Condition:Ability being cast equal to polymorph
Action: Unit issue order ‘targeted unit’ attack-move into point(x,x)

yet again polymorph buff can take some amount of milliseconds to allow targeted unit to take a move order so you might wanna set up a little waiting time before issuing a command.

Optional use acuising range instead of attack-move order but I dont know why would you wanna do that.

I have used editor 20 years and for some reason: begin channeling spell, start channeling spell ect doesnt actually work and you can only use ‘finishes casting a spell’.

Ofcourse I help you for free for the love of the world editing <3

edit. little fix on text

oh wait nothing works. maybe its devil thing that prevents me helping you.
…(2 days later)
ok figured it out
must use event: “a unit starts the effect of an ability” instead of “finishes casting an ability”

Event: a unit starts the effect of an ability
Condition:Ability being cast equal to polymorph
Action:
set variable ‘unit’ = targeted unit of ability being cast
wait 61 seconds
Unit issue order ‘unit’ attack-move into region x

where variable unit is a variable typed unit

1 Like

Thanks! I did like this:

Events:
Unit - A unit Starts the effect of an ability
Conditions:
(Ability being cast) Equal to Polymorph
Or - Any (Conditions) are true
Conditions
(Owner of (Target unit of ability being cast)) Equal to Player 1 (Red)
(Owner of (Target unit of ability being cast)) Equal to Player 6 (Orange)
(Owner of (Target unit of ability being cast)) Equal to Player 8 (Pink)
Actions:
Set VariableSet “NAME OF VARIABLE TYPE UNIT” = (Target unit of ability being cast)
Wait 0.01 seconds
Unit - Order “NAME OF VARIABLE TYPE UNIT” Move To (Random point in REGION)
Wait 61.00 seconds
Unit - Order “NAME OF VARIABLE TYPE UNIT” Attack-Move To (Random point in REGION)

This makes the ghouls, crypt fiends etc. move instantly when doing mass polymorph with multiple sorceress. When polymorph ends only 1 of the targets sheeped will “attack-move”. However this is perfect so no need to further edit this trigger. Just the “move after 0.01 seconds” basically fixes the issue with units standing still forever since its better if units move and suicide rather than wait 61 seconds and then attack-move. And having conditions “owner equal to specific players” prevents creeps from being affected by this.

I’m so happy right now :smiley:

it´s still not perfect thought because if you have many time hex casted during this 61 sec that this one trigger is running the the most recent one unit is going to overlapse the pervious and the previous unit gets stuck.

to combat this issue. you need to add counter that increses by 1 each time this trigger is being called.

Event: a unit starts the effect of an ability
Condition:Ability being cast equal to polymorph
Action:
set counter = counter + 1
set variable ‘unit’ [counter] = targeted unit of ability being cast
if counter equals to 20 then set counter = 0,
(where 20 is number of spells you want to enable simultaneously within 61 second timeframe)

then create second trigger that only gives order to those units that have been added into variables

For every 1-2 seconds of the game
For each integer A 1 to 20
Unit issue order ‘unit’ [integer a] attack-move into region x,
(where 20 is number of spells you want to enable simultaneously within 61 second timeframe)

by the way if you find this helpful credit would be nice but not needed