• 🏆 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!
  • ✅ Time to vote for the top 3 models! The POLL for Hive's 6th HD Modeling Contest: Mechanical is now open! 📅 Poll close on July 16, 2024! 🔗 Cast your vote now!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

Force a friendly unit to become hostile?

Status
Not open for further replies.
Level 1
Joined
Jan 22, 2011
Messages
7
Is there a way to force a friendly unit to become hostile?

Basically what i would ultimately want to do is have a Hero with a friendly unit, like an elemental for example. (the elemental would not be summoned it would be out all the time). I would then want the Hero to have the ability to "release" the elemental which would cause it to attack everyone! (ideally it would change form making it stronger while attacking everyone. So freeing it makes it very powerful but it is risky because it could also harm you in that process)

Then the hero could rebind it and it would be friendly once again. For this side i could edit the Possession ability...

Thoughts?
 
Level 1
Joined
Jan 22, 2011
Messages
7
Is there a way to change the owner of a unit in-game?

I would want the elemental to become hostile to all players.
 
Level 2
Joined
Dec 22, 2010
Messages
16
Eedit: Aww Poo you beat me too it while i was typing this up -_-"

Try this:

For the Release ability:
  • Release Elemental
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Release Elemental
    • Actions
      • Unit - Change ownership of Elemental to Neutral Hostile and Change color
And to be able to release it after it is tamed:
  • Tame
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Charm
    • Actions
      • Set Elemental = (Target unit of ability being cast)
And if you want the elemental to change,

Try this for Release:
  • Release Elemental
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Release Elemental
    • Actions
      • Unit - Change ownership of Elemental to Neutral Hostile and Change color
      • Unit - Replace Elemental with a NewElemental using The old unit's relative life and mana
Your could keep the above taming trigger, but if you want the elemental to revert to its weaker tamed version use this instead:
  • Tame
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Charm
    • Actions
      • Set Elemental = (Target unit of ability being cast)
      • Unit - Replace Elemental with a OldElemental using The old unit's relative life and mana
OldElemental = the weaker tamed unit
NewElemental = the stonger untamed unit

And that should do it :D!
 
Level 1
Joined
Jan 22, 2011
Messages
7
I followed what was posted by Maxwell Murder. However, for the second Tame trigger posted, its not executing the "charm" AND the "change unit" to the other unit.

when i do this
Event: "unit - starts the effect of an ability"
Cond: ability being cast = charm
Action: Unit - Replace Elemental with a NewElemental...

then the unit successfully gets replaced but the "charm" never gets cast.


When i do this
Event: "unit - finishes casting ability"
Cond: ability being cast = charm
Action: Unit - Replace Elemental with a NewElemental...

then the charm gets cast, the unit becomes mine, but it doesn't change to the other weaker form.

I've also tried using a dummy spell for the condition instead of "Charm" and making the actions be both of these:
Unit - Change ownership of *Elemental* to Player 1 (Red) and Chng clr
Unit - Replace *Elemental* with a NewElemental using The old unit's relative life and mana

this didn't work either.

(*Elemental* is a variable set to "target unit of abilty being cast")

Maxwell, did you test the examples you posted in game and get them to work successfully? if so, i must be missing something..
 
Level 1
Joined
Jan 22, 2011
Messages
7
defskull, could you elaborate on what you are saying just a bit?

is this so that i'm not telling the unit to change back to Player 1 (red) , but instead i would be causing it to change to match the owner of my unit that is casting the tame spell on it?
 
Level 2
Joined
Dec 22, 2010
Messages
16
thats probably because the unit no longer exists, and the charm has nothing to charm, at least that is what I think.

Give me a little bit and I'll fix it, can i ask as to how the elemental is created? is it just charmed from the wilderness or does the hero summon it?
 
Level 1
Joined
Jan 22, 2011
Messages
7
Its wouldnt be a summon. it would be like an rpg scenario and the elemental would exist from the game start with the hero, i think if it functioned the same i would want to make the elemental a hero also. Ive been playing with that a little bit but i was getting some strange results.

Here is what happened:
I would release the elemental (i was using the firelord model, so it was a hero)
it got bigger (exchange with custom firelord unit with increased scaling)
i then tamed it with curse but couldnt get the model to swich back..
THEN when i did this again i was left with some sort of phantom attacker.. the firelord attack is some fireball thing that he shoots at you and once i released him the second time he was shooting two sets of firballs at me and then when i tamed him the second time there was a leftover fireball shooting at me from a nonexistent source and it would actually follow me around but it had no source... it was weird.

If you look at the attached screen shot the firebolt heading for Jaina is coming from a place near where my cursor is.. but there is no unit there and it follows her all over the map... this only happened when i released and tamed a Hero class. and if i released and tamed the unit again there would be two phantom fireball sources...
 

Attachments

  • Picture 8.png
    Picture 8.png
    1.9 MB · Views: 85
Level 1
Joined
Jan 22, 2011
Messages
7
I just figured out one thing based on what i think defskull was saying;

i dont understand why but..

this works:
Set Elemental = (target unit of ability being cast)
Unit - Change ownership of Elemental to neutral hostile and Change color

this doesnt: (not sure why)
Set Elemental = (target unit of ability being cast)
Unit - Change ownership of Elemental to Player 1 (Red) and Change color

and this works: (seems like a roundabout way but it works)
Set Caster = Casting unit
Unit - Change ownership of Elemental to (owner of Caster) and Change color

i still havent gotten it to replace unit and change team
 
Level 1
Joined
Jan 22, 2011
Messages
7
Ok i got this to work with three triggers:
1st to release the elemental:
attachment.php



then this one changes the owner and triggers the unit change...
attachment.php


this one starts "off" and is just for changing the unit, since i couldn't get them both to execute when they were in the same trigger:
attachment.php


still get the phantom fireballs SOMETIMES.. its like i need to drop aggro somehow when the elemental shifts.
 

Attachments

  • Bind.png
    Bind.png
    26.1 KB · Views: 116
  • ChangeUnit.png
    ChangeUnit.png
    13.8 KB · Views: 145
  • Unbind.png
    Unbind.png
    21.5 KB · Views: 162
Level 33
Joined
Mar 27, 2008
Messages
8,035
You are using a wrong base spell, Charm
Because, Charm does practically to change the owner of the targeted unit, to yours
If you're doing the Action of Change Ownership in that Trigger Editor based on default Charm ability, you are doing it TWICE the work of "Change Ownership" Action, making the game cannot interpret the second Action (by Trigger Editor) because you already have casted Charm ability, which is changing the ownership of the targeted unit
Try base it off Chain Lightning

Also, use (Triggering unit) instead of (Casting unit)
It has the same function but (Triggering unit) performs more efficiently
Also, remove the usage of "Wait" as they can cause a "delay" in the game if you play it multiplayer
It will cause a delay in-between of each player to be sync'd and this will ruin the game
What for did you use the Wait for ?
Tell me, maybe I can do it for you
 
Status
Not open for further replies.
Top