• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

A Pet system of sorts.

Status
Not open for further replies.
Level 6
Joined
May 11, 2010
Messages
236
Hey guys. So as the title would suggest i'd like to create a pet system, i've searched the forums but the ones i've seen aren't really what i'm after. I'd like to create one similar to the one from the AoS Map EoTA, which is pretty much a pet that can be summoned and is a hero (I'm assuming as it has an experience bar). And it can't really be controlled, it simply follows the hero around, attacks enemies and every time the hero gets to a certain distance away from it, it turns and follows the hero. Also, when it dies it can be resummoned using the spell, at the same level, amount of xp etc.
+ rep for help/ideas :) :vw_unimpressed:
 
Level 30
Joined
Jan 31, 2010
Messages
3,551
You can use hero units as pets, and hide their death messages and icons. However, you should consider of pet dying when your hero dies, automatic leveling of pet's powers, blinking pet next to you when you moved over great distances, making pet ,,smart", to attack units you attack, and giving him precision to cast spells to weak heroes instead of full hp creeps.
 
Level 9
Joined
Jul 4, 2007
Messages
130
It is a simple example: it sux, it isn't mui, it is leaking.
  • Summon/rez
    • Events
      • Unit - Any unit cast a spell
    • Conditions
      • Ability being cast = pet summon
    • Actions
      • Set Master (<=unit var) = (TriggeringUnit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Pet (<=unit var) = No Unit (null)
        • Then - Actions
          • Unit - Create 1 Pet for (Owner of Master) at ((Position of Master) offset by 50.00 towards (Facing of Master) degrees) facing (Position of Master)
          • Set Pet = (Last created unit)
        • Else - Actions
          • Hero - Instantly revive Pet at (Position of (Master))
  • MouvementOrder4Pet
    • Events
      • Unit - A unit have an order with an object as target
      • Unit - A unit have an order with a point as target
      • Time - Every 5.00 seconds of game time
    • Conditions
      • ((Triggering unit) = Master) or ((Triggering unit) = Pet)
      • ((Master is alive) = TRUE) and ((Pet is alive) = TRUE)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Distance between (Position of Master) and (Position of Pet) lower than 500
        • Then - Actions
          • Wait 0.01 Seconds
          • Unit - Order Pet to Move-Attack to ((Position of Master) offset by (Random real number between 50.00 and 250.00) towards (Random angle) degrees)
        • Else - Actions
          • Wait 0.01 Seconds
          • Unit - Order Pet to Move to (Position of Master)
Description:
The summon/rez trigger will firstly create the pet unit and assign the Pet variable to it, then this trigger will be used to rez the pet (hero) with the same spell.

Everytime your pet or his master have an order, and every 5.00 seconds the pet will randomly move-attack around his master.

If the pet is too far away from his master he will be ordered to move back to his master position.

There is a short wait, so the pet can still cast spells without being canceled by the order.

Since the pet is a hero, he automatically keep his experience though dead.
 
Level 9
Joined
Jul 4, 2007
Messages
130
It is a simple example: it sux, it isn't mui, it is leaking.

Well im not sure adding "custom script - call RemoveLocation(udg_blabla)" or make it MUI will makes things easier to understand.

but your right for the fast ordered actions… it is suxing way to much actually, but it is quite short and easy to understand, and I hope it gave him an idea.
 
Level 6
Joined
May 11, 2010
Messages
236
You can use hero units as pets, and hide their death messages and icons. However, you should consider of pet dying when your hero dies, automatic leveling of pet's powers, blinking pet next to you when you moved over great distances, making pet ,,smart", to attack units you attack, and giving him precision to cast spells to weak heroes instead of full hp creeps.

Sorry for my late reply. Thanks for all the responses!
Above: Yeah that's pretty much exactly how it's done in EoTA. Anyhow. I created a trigger similar to the one Vortigon made. Works well and i've made it leakless :D Anyway, I removed the death message, i've decided to keep it's scorescreen icon up, as an easier way of checking it's health. and yes I already made the blink and pet dies when hero dies. + rep all. Oh and I classified the pet as 'ward' so you can't control it, working on the spells now. it's quite cool :)
 
Last edited:
Status
Not open for further replies.
Top