Spell - Tame

Level 34
Joined
Sep 6, 2006
Messages
8,873
More spell trouble for me.

I am trying to make a spell that lets you tame a pet. You can only have one at once, and it revives when it dies. You can release it and tame another though.

It just won't work. My guess is it has to do with the unit group.

Here are all my triggers.

  • Tame
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Tame Best
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Target unit of ability being cast) Equal to (Random unit from Animals)
        • Then - Actions
          • Unit - Change ownership of (Target unit of ability being cast) to (Triggering player) and Change color
          • Unit - Remove Tame Best from (Triggering unit)
          • Unit - Add Release to (Triggering unit)
          • Set Selected_Animal = (Target unit of ability being cast)
          • Trigger - Turn on Death <gen>
        • Else - Actions
          • Unit - Order (Triggering unit) to Stop
  • Animals
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Unit Group - Add (Random unit from (Units of type Eagle)) to Animals
      • Unit Group - Add (Random unit from (Units of type Lion)) to Animals
      • Unit Group - Add (Random unit from (Units of type Panther)) to Animals
      • Unit Group - Add (Random unit from (Units of type Tiger)) to Animals
      • Unit Group - Add (Random unit from (Units of type White Tiger)) to Animals
  • Release
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Release
    • Actions
      • Unit - Change ownership of Selected_Animal to Neutral Hostile and Change color
      • Unit - Remove Release from (Triggering unit)
      • Unit - Add Tame Best to (Triggering unit)
      • Trigger - Turn off Death <gen>
  • Death
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Triggering unit) Equal to Selected_Animal
    • Actions
      • Countdown Timer - Create a timer window for (Last started timer) with title Animal Revive
      • Countdown Timer - Show (Last created timer window) for Player 1 (Red)
      • Countdown Timer - Start (Last started timer) as a One-shot timer that will expire in 30.00 seconds
      • Wait 30.00 seconds
      • Unit - Create 1 (Unit-type of Selected_Animal) for (Owner of Archer 0013 <gen>) at (Position of Archer 0013 <gen>) facing Default building facing degrees
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
You add only one random unit of those types to the groups, terefor if you tame any other unit, it won't do anything.

You should do "a unit starts to cast abiltiy....... if the unit type of ability target equal to x or y or z or a or b then...".

And just as a side note, you can just make the revive activated, no need to disable and enable.
 
Level 34
Joined
Sep 6, 2006
Messages
8,873
I don't quite follow you with the one random unit of those types.

Why do "type of ability equal to..."?

I didn't think it would, but just in case I did made it initially off.

Oh and this skill doesn't level or anything.

Edit: It works. Sometimes. I have to use it over and over unit it's tamed. And for some reason it was working when I used release, but now it doesn't release them. Err.
 
Last edited:
Level 10
Joined
Jan 5, 2007
Messages
283
You'll want to change these two triggers:

  • Tame
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Tame Best
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Target unit of ability being cast) Equal to (Random unit from Animals)
        • Then - Actions
          • Unit - Change ownership of (Target unit of ability being cast) to (Triggering player) and Change color
          • Unit - Remove Tame Best from (Triggering unit)
          • Unit - Add Release to (Triggering unit)
          • Set Selected_Animal = (Target unit of ability being cast)
          • Trigger - Turn on Death <gen>
        • Else - Actions
          • Unit - Order (Triggering unit) to Stop
  • Animals
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Unit Group - Add (Random unit from (Units of type Eagle)) to Animals
      • Unit Group - Add (Random unit from (Units of type Lion)) to Animals
      • Unit Group - Add (Random unit from (Units of type Panther)) to Animals
      • Unit Group - Add (Random unit from (Units of type Tiger)) to Animals
      • Unit Group - Add (Random unit from (Units of type White Tiger)) to Animals

What your triggers are currently doing, is at map initialization, they find ONE Eagle on the map, and add it to Animals, rather than every Eagle. This means you can only tame the ONE Eagle that got put into Animals. And when you cast Tame, it will check to see if the target is a random unit in Animals, rather than if it is just in animals.

Change them to be more like this:

  • Tame
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Tame Best
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Target unit of ability being cast) is in Animals) Equal to True
        • Then - Actions
          • Unit - Change ownership of (Target unit of ability being cast) to (Triggering player) and Change color
          • Unit - Remove Tame Best from (Triggering unit)
          • Unit - Add Release to (Triggering unit)
          • Set Selected_Animal = (Target unit of ability being cast)
          • Trigger - Turn on Death <gen>
        • Else - Actions
          • Unit - Order (Triggering unit) to Stop
  • Animals
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units of type Eagle) and do (Unit Group - Add (Picked Unit) to Animals)
      • Unit Group - Pick every unit in (Units of type Lion) and do (Unit Group - Add (Picked Unit) to Animals)
      • Unit Group - Pick every unit in (Units of type Panther) and do (Unit Group - Add (Picked Unit) to Animals)
      • Unit Group - Pick every unit in (Units of type Tiger) and do (Unit Group - Add (Picked Unit) to Animals)
      • Unit Group - Pick every unit in (Units of type White Tiger) and do (Unit Group - Add (Picked Unit) to Animals)
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
What your triggers are currently doing, is at map initialization, they find ONE Eagle on the map, and add it to Animals, rather than every Eagle. This means you can only tame the ONE Eagle that got put into Animals. And when you cast Tame, it will check to see if the target is a random unit in Animals, rather than if it is just in animals.


Yes thats what I meant, you could also not pick animals at all an just do a condition "if unit type of (target of ability being casted) equal to Animal1 or Animal2 etc...".

You don't need to activate the "Death" because anyway it checks if the unit that dies is the tamed unit.
 
Level 34
Joined
Sep 6, 2006
Messages
8,873
Thanks guys. It tames properly. Although the release is not working.

Never mind, it was because I had the set variable before the change unit. It's fixed.

+rep
 
Top