• 🏆 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!

Pet Summoning Need Help

Status
Not open for further replies.
Level 1
Joined
Apr 13, 2014
Messages
1
Hey guys, I'm trying to create a pretty simple pet system but I got stumped early on, I cant figure out why my triggers not working.

So first I'll explain what I'm trying to do.
At some point in my map you're able to purchase an Empty Cage that allows you to catch critters which can be summoned as pets. There will be multiple pet options but you can only have a single pet at one time.
There are two types of item: the Empty Cage, which has the Tame Beast dummy ability (Storm Bolt), and the Full Cages (eg. Turtle Cage, Lizard Cage etc) which are Spellbooks with 3 abilities: Summon Pet, Dismiss Pet and Release Pet.
When the Empty Cage is used on a critter I want to replace the empty cage with a full cage based on the units type, which I'll probably accomplish with If/Then/Else functions

So! Like I said I got stuck pretty early on.

  • Unit finishes casting an ability
  • Ability being cast equal to Tame Beast
  • Action:
  • Set variable PetSummoner equals Casting Unit
  • If (All conditions are true) then do (Then Actions) else do (Else Actions)
  • If Unit type of (Target unit of ability being cast) equal to Turtle
  • Then - Actions
  • Remove (Target unit of ability being cast) from the game
  • Hero: Drop (Item carried by PetSummoner of type Empty Cage) from PetSummoner
  • Remove Last Dropped Item
  • Hero: Create Turtle Cage and give it to PetSummoner
  • Else:
  • Next cage type
The spell makes contact (I can see the target art) but nothing happens. No unit removal, no item swap. What am I doing wrong?
Thanks very much for any help, and if anyone has any useful tips for the next triggers (Release, Dismiss, etc.) that'd be really handy too.

Thanks!
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
Unit finishes casting an ability
There is no "Target unit of ability being cast" as there is no ability being cast. The event fires when the ability finishes casting so you can only get the triggering unit (the unit who stopped casting the ability) and maybe what ability was finished casting.

You need to use an event like begins effect as that does give you a target. Unfortunately this causes animation problems as it would trigger when the projectile is launched instead of landed.
 
Status
Not open for further replies.
Top