• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Controlling mass units

Status
Not open for further replies.
Level 4
Joined
Jul 25, 2005
Messages
48
This isn't giving the units back, why is this?

Code:
Tidal Control
    Events
        Unit - A unit Begins casting an ability
    Conditions
        (Ability being cast) Equal to Tidal Control 
    Actions
        Set Targetedpoint = (Target point of ability being cast)
        Unit Group - Pick every unit in (Units within 800.00 of Targetedpoint matching ((((Matching unit) belongs to an enemy of (Owner of (Casting unit))) Equal to True) and ((((Matching unit) is A Hero) Equal to False) and (((Matching unit) is A structure) Equal to False)))) and do (Actions)
            Loop - Actions
                Set Unit = (Picked unit)
                Set PLAYER = (Owner of Unit)
                Unit - Change ownership of (Picked unit) to (Owner of (Casting unit)) and Change color
                Wait 1.00 seconds
                Unit - Change ownership of Unit to PLAYER and Change color
 
Level 5
Joined
Jun 22, 2004
Messages
109
Keiga said:
This isn't giving the units back, why is this?

Code:
Tidal Control
    Events
        Unit - A unit Begins casting an ability
    Conditions
        (Ability being cast) Equal to Tidal Control 
    Actions
        Set Targetedpoint = (Target point of ability being cast)
        Unit Group - Pick every unit in (Units within 800.00 of Targetedpoint matching ((((Matching unit) belongs to an enemy of (Owner of (Casting unit))) Equal to True) and ((((Matching unit) is A Hero) Equal to False) and (((Matching unit) is A structure) Equal to False)))) and do (Actions)
            Loop - Actions
                Set Unit = (Picked unit)
                Set PLAYER = (Owner of Unit)
                Unit - Change ownership of (Picked unit) to (Owner of (Casting unit)) and Change color
                Wait 1.00 seconds
                Unit - Change ownership of Unit to PLAYER and Change color

Code:
Tidal Control
    Events
        Unit - A unit Begins casting an ability
    Conditions
        (Ability being cast) Equal to Tidal Control 
    Actions
        Set Targetedpoint = (Target point of ability being cast)
        Unit Group - Pick every unit in (Units within 800.00 of Targetedpoint matching ((((Matching unit) belongs to an enemy of (Owner of (Triggering Unit))) Equal to True) and ((((Matching unit) is A Hero) Equal to False) and (((Matching unit) is A structure) Equal to False)))) and do (Actions)
            Loop - Actions
                Set Unit = (Picked unit)
                Set PLAYER = (Owner of Unit)
                Unit - Change ownership of (Unit) to (Owner of (Triggering Unit)) and Change color
                Wait 1.00 seconds
                Unit - Change ownership of Unit to PLAYER and Change color

i m not sure if that will change n e thing, but try it it doesnt hurt.
 
Level 4
Joined
Jul 25, 2005
Messages
48
That didn't work this is what
I have and it still isn't giving back control.

Code:
Tidal Control
    Events
        Unit - A unit Begins casting an ability
    Conditions
        (Ability being cast) Equal to Tidal Control 
    Actions
        Set Targetedpoint = (Target point of ability being cast)
        Unit Group - Pick every unit in (Units within 800.00 of Targetedpoint matching ((((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True) and ((((Matching unit) is A Hero) Equal to False) and (((Matching unit) is A structure) Equal to False)))) and do (Actions)
            Loop - Actions
                Set Unit = (Picked unit)
                Set PLAYER = (Owner of Unit)
                Unit - Change ownership of Unit to (Owner of (Triggering unit)) and Change color
                Wait 1.00 seconds
                Unit - Change ownership of Unit to PLAYER and Change color

Also I am trying to make it so that everytime I gain control of a unit using this ability I lose 10% of my max life, but it isn't working and I don't know how to make it only for this ability. So far nothing is hgapeening when I do this, I think it is a problem with the max life thing because I put it on periodic event and still nothing happened.

Code:
Lose life Tidal
    Events
        Unit - A unit Changes owner
    Conditions
        ((Triggering unit) belongs to an enemy of (Owner of Legendary Tidal Dragon 0000 <gen>)) Equal to True
    Actions
        Advanced - For Legendary Tidal Dragon 0000 <gen> Decrease life maximum by ((Integer((Max life of Legendary Tidal Dragon 0000 <gen>))) / 10)
        Advanced - For Legendary Tidal Dragon 0000 <gen> Decrease mana maximum by ((Integer((Max mana of Legendary Tidal Dragon 0000 <gen>))) / 10)

Lastly I am trying to make it so that once the units die or the owner loses control of the unit that was taken control by this ability, the Dragon that has the ability gains back the max life he lost. Still nothing happens when I do this, does this max life thing really work?

Code:
Lose life Tidal
    Events
        Unit - A unit Changes owner
    Conditions
        ((Triggering unit) belongs to an enemy of (Owner of Legendary Tidal Dragon 0000 <gen>)) Equal to True
    Actions
        Advanced - For Legendary Tidal Dragon 0000 <gen> Decrease life maximum by ((Integer((Max life of Legendary Tidal Dragon 0000 <gen>))) / 10)
        Advanced - For Legendary Tidal Dragon 0000 <gen> Decrease mana maximum by ((Integer((Max mana of Legendary Tidal Dragon 0000 <gen>))) / 10)
 
Level 5
Joined
Jun 22, 2004
Messages
109
the way i see it for the last 2 abilities, instead of usiong Legendary Tidal Dragon 0000 <gen> u should go back to the first trigger make a variable for the caster, so DragonCaster = Casting Unit, then use the dragonCaster variable instead of

Legendary Tidal Dragon 0000 <gen>

Also

Tidal Control
Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to Tidal Control
Actions
Set DragonCaster = (Casting Unit)
Set Targetedpoint = (Target point of ability being cast)
Unit Group - Pick every unit in (Units within 800.00 of Targetedpoint matching ((((Matching unit) belongs to an enemy of (Owner of (DragonCaster))) Equal to True) and ((((Matching unit) is A Hero) Equal to False) and (((Matching unit) is A structure) Equal to False)))) and do (Actions)
Loop - Actions
Set Unit = (Picked unit)
Set PLAYER = (Owner of Unit)
Unit - Change ownership of Unit to (Owner of (DragonCaster)) and Change color
Wait 1.00 seconds
Unit - Change ownership of Unit to PLAYER and Change color

i think if u changed that...the first trigger may work aswell, try it out and tell me.
 
Level 4
Joined
Jul 25, 2005
Messages
48
Ok, still this isn't returning the controlled unit back:

Code:
Tidal Control
    Events
        Unit - A unit Begins casting an ability
    Conditions
        (Ability being cast) Equal to Tidal Control 
    Actions
        Set DRAGONCASTER = (Casting unit)
        Set Targetedpoint = (Target point of ability being cast)
        Unit Group - Pick every unit in (Units within 800.00 of Targetedpoint matching ((((Matching unit) belongs to an enemy of (Owner of DRAGONCASTER)) Equal to True) and ((((Matching unit) is A Hero) Equal to False) and (((Matching unit) is A structure) Equal to False)))) and do (Actions)
            Loop - Actions
                Set Unit = (Picked unit)
                Set PLAYER = (Owner of Unit)
                Unit - Change ownership of Unit to (Owner of DRAGONCASTER) and Change color
                Wait 1.00 seconds
                Unit - Change ownership of Unit to PLAYER and Change color


I am getting somewhere with the gainn and lose life thing, I think my conditions are messed up, with these, if a unit changes owner or dies DRAGONCASTER just gains life and never loses the max life:

Code:
Lose life Tidal
    Events
        Unit - A unit Changes owner
    Conditions
        ((Triggering unit) belongs to an enemy of (Owner of DRAGONCASTER)) Equal to True
    Actions
        Advanced - For DRAGONCASTER Decrease life maximum by ((Integer((Max life of DRAGONCASTER))) / 10)
        Advanced - For DRAGONCASTER Decrease mana maximum by ((Integer((Max mana of DRAGONCASTER))) / 10)

Code:
Gain Life Tidal
    Events
        Unit - A unit Changes owner
        Unit - A unit Dies
    Conditions
        ((Triggering unit) is owned by (Owner of DRAGONCASTER)) Equal to True
        ((Triggering unit) is A Hero) Equal to False
    Actions
        Advanced - For DRAGONCASTER Increase life maximum by ((Integer((Max life of DRAGONCASTER))) / 10)
        Advanced - For DRAGONCASTER Increase mana maximum by ((Integer((Max mana of DRAGONCASTER))) / 10)

My conditions for these must be messed up
 
Status
Not open for further replies.
Top