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

PetSystem v0.2 [GUI] Multiplayer

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
Pet System v0.2 [Mult-Player][GUI]
by Mainy


-- General Information --
Adopte an pet.


  • Adopt
  • Unit - A unit Acquires an item
  • (item-type of (item being manipulated)) Equal to Grizzle
  • Set PETOwner = (Triggering unit)
  • Set PETOwnerLoc = (Position of PETOwner)
  • Item - Remove (Item being manipulated)
  • Trigger - Turn on PetSurge <gen>
  • Trigger - Run PetSurge <gen> (checking conditions)
  • Custom script: call RemoveLocation (udg_PETOwnerLoc)
  • PetSurge
  • Unit - Remove PETDummy[(Player number of (Owner of PETOwner))] from the game
  • Game - Display to (All players controlled by a ((Owner of PETOwner) controller) player) the text: You have adopted a Grizzle.
  • Unit - Create 1 Grizzle for (Owner of PETOwner) at PETOwnerLoc Facing Default building facing degrees
  • Set PETDummy[(Player number of (Owner of PETOwner))] = (Last created unit)
  • Unit - Order PETDummy[(Player number of (Owner of PETOwner))] to Right-Click PETOwner
  • Unit Group - Pick every unit in (Units within 200.00 of PETOwnerLoc matching (((PETDummy[(Player number of (Owner of PETOwner))] is alive) Equal to True) and (((Owner of PETDummy[(Player number of (Owner of PETOwner))]) Equal to (Owner of PETOwner)) and ((Picked unit) Not equal to PETOwner) and do (Actions)
    • Loop - Actions
      • Set PETGroup = (Last created unit group)
  • Custom script: call DestroyGroup (udg_PETGroup)
  • PetDie
  • Unit - A unit Dies
  • (Dying unit) Equal to PETOwner
  • Unit - Kill PETDummy[(Player number of (Owner of PETOwner))]
  • Game - Display to (All players controlled by a ((Owner of PETOwner) controller) player) the text: Your Grizzle is dead.


It uses the Game - Value Of Real Variable event as its method of activating other triggers, and passes the event responses through a few globals.

-- How To Implement --
Be sure "Automatically create unknown variables while pasting trigger data" is enabled in the World Editor general preferences.
Copy the trigger category from the demo map and paste it into your map. (Alternately: create the variables listed below.) Copy ability, item.


Keywords:
Pet, System, Servant, Adopt, Master, Beast, Lord, Friend, Follower.
Contents

Pet System [GUI] (Map)

Reviews
14:44, 16th Jun 2010 Hanky: Your system got some leaks and it's just to simple to be a real system. Add more stuff to your system otherwise I can't approve it.

Moderator

M

Moderator

14:44, 16th Jun 2010
Hanky:
Your system got some leaks and it's just to simple to be a real system. Add more stuff to your system otherwise I can't approve it.
 
Level 8
Joined
Jun 18, 2007
Messages
214
Ok, this is one very bad system, badly scripted (if you can call that a script), leaks a lot, and pets can not be 'adopted', but purchased. No commands for the pets, you can't control it in any way, you can't revive it or heal it.


  • Set PETOwnerLoc = (Position of PETOwner)
not removed:
  • call RemoveLocation(udg_PETOwnerLoc)
  • Unit - Create 1 Grizzle for (Owner of PETOwner) at PETOwnerLoc facing Default building facing degrees
- leaks a location. Again.

  • Unit Group - Pick every unit in (Units within 200.00 of PETOwnerLoc matching (((PETDummy[(Player number of (Owner of PETOwner))] is alive) Equal to True) and (((Owner of PETDummy[(Player number of (Owner of PETOwner))]) Equal to (Owner of PETOwner)) and ((Picked unit) Not equal to PETOwner) and do (Actions)
    • Loop - Actions
      • Set PETGroup = (Last created unit group)
- leaks a group and a location.


This system has no advance usage at all, it most certainly is not easy to use, and it is highly primitive.

My suggestion:

- Develop an AI for the pet, get rid of the Locust ability. Add some documentation, more features (right now, I'm not even sure you have a feature). Remove leaks and improve your scripting a lot.

My rating for this 'system' would be 1/5. I'm sorry, but this is very bad and primitive.
 
Level 13
Joined
Mar 6, 2008
Messages
525
Well...
I don't like the locust ability for such thing...
Make the grizzle uncontrollable but selectionable...
Make it MUI and MPI man...

First of all fix this, the idea is great anyway...

EDIT: I think you can use hastables (unit key ID) (to make it mui and mpi), then make that when the owner of the pet attacks, the pet attacks too... and then make that the pet follow the owner...
 
Level 10
Joined
May 27, 2009
Messages
494
I also want to use this system for my map..... Could you please post the changelogs of this system so I can know which things are changed so we can not ask for another which you have already fixed.

Btw. I like pippo's recommendation about how the pet is controlled or move. Like how the pet attacks.....

Hope you improve this more....

2/5
 
Level 12
Joined
Mar 10, 2008
Messages
869
I made my own pet system for my RPG that allows you to controll the pet, but whenever it goes more than 200 range from the owner its ordered to move back to the owner, and over 400, it is teleported to the owner.
Wouldn't that just be better?

Plus it's MPI (I didn't make it MUI because its supposed to be 1 hero only)

The purchasing mechanism can be greatly simplified.
Try something like mine:
  • BuyPet
    • Events
      • Unit - A unit Sells a unit
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Unit-type of (Sold unit)) Equal to Pet (Cat)
              • (Unit-type of (Sold unit)) Equal to Pet (Dog)
          • PlayerBag[(Player number of (Owner of (Buying unit)))] Equal to No unit
        • Then - Actions
          • Set PlayerBag[(Player number of (Owner of (Buying unit)))] = (Sold unit)
          • Unit Group - Add (Sold unit) to CameraGroup
        • Else - Actions
          • Unit - Remove (Sold unit) from the game
          • Custom script: call DisplayTextToPlayer((GetOwningPlayer(GetSoldUnit())), 0, 0, "You already have a pet!")
          • Player - Add 100 to (Triggering player) Current gold
 
Level 20
Joined
Jul 12, 2010
Messages
1,717
the system is very good and could proove useful !! 4/5 :thumbs_up:
i gave 4/5 because i found a leak
the below action leaks

  • Unit - Create 1 Grizzle for (Owner of PETOwner) at PETOwnerLoc Facing Default building facing degrees
so you should create another custom script like the one below to clean it

  • Custom script : call RemoveLocation(udg_PETOwnerLoc)
im not an expert GUIer but i couldn't miss that lol
if i find any other leaks i will inform you asap ;p
 
Top