• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Spell] Aura with Orc flag attachment

Status
Not open for further replies.
Level 2
Joined
Jul 14, 2012
Messages
15
I recently tried making a Roar-like aura ability which, instead of the "Roar" caster effect, adds a Battle Standard to my Heroes back. I succeeded in a way, but the Battle Standard seems stationary and does not face the way the Hero faces. I tried an Orc Flag, Capture the Flag model, and it has an attachment point to the right hand. Trying to make it attach to the body, so it looks like a Blademaster, makes the model disappear entirely. I am now stuck with either a stationary Battle Standard or an Orc Flag attached to the hand. There are two solutions:

-Make the Battle Standard face the way my Hero is facing.

-Make the Orc Flag somehow attach to the back or body.

Bonus (bad one): I need to make it so when my Hero learns this skill, either one of those flags appear on him. I have done so, but it requires me to have the units included in the trigger on the map area, which isn't good, because then there will be a Hero on map start. How do I make the trigger use units that exist, but are not yet on the playing field, instead of units pre-placed on the field without disabling the trigger?

I am aware this is very long and bothersome, but I thank anyone who will reply with even the most simple advice in advance.
 
Special effects attached on units usually follow the bones of the unit, if the latter are moving. If they are stationary (e.g. origin), they will also remain stationary. Chest for example is almost never stationary and so is the effect attached on it. The reason why the effect disappears is that the enumerated unit doesn't have the attachment point that you want the engine to search for in the nearby units.

In order to achieve this effect, you will have to use a looping trigger (or Bribe's IsUnitMoving system) that enumerates the aura-affected units. Then, add (Picked unit) [aka. enumerated] in the local group that you have created when the aura-bearer has learned the skill at level 1.
  • Tr
  • Events
    • Unit - A unit learns a skill
  • Conditions
    • (Hero learned skill) Equal to Roar
    • (Level of Roar for (Triggering unit)) Equal to 1
  • Actions
    • Custom script: local group g = CreateGroup()
    • Custom script: call SaveGroupHandle (udg_Hashtable, GetHandleId(GetTriggerUnit()), 0, g)
    • Custom script: set g = null
This is the way to create the local group and store it on the aura-bearer.
Your next priority is to enumerate all the targets allowed (by the spell) in an AoE (Area of effect that is determined in the Object editor) of the hero's position.
  • Set Point1 = (Position of Hero)
  • Custom script: set udg_Group = LoadGroupHandle (udg_Hashtable, GetHandleId (udg_Hero), 0)
  • Custom script: set bj_wantDestroyGroup = true
  • Unit Group - Pick every unit within XXX of Point1 matching (Matches here, e.g. (Matching unit) belongs to an ally of (Owner of Hero)) Equal to True) and ((Matching unit) is in Group) Equal to False))
    • Loop - Actions
      • Unit - Add (Picked unit) to Group
  • Custom script: call RemoveLocation (udg_Point1)
The next step would be to enumerate the units that are in the locally created group, in order for you to check if they are still affected by your aura (and thus not moved away from the aura source - your hero).
  • Custom script: set udg_Group = LoadGroupHandle (udg_Hashtable, GetHandleId (udg_Hero), 0)
  • Unit Group - Pick every unit in Group and do (Actions)
    • Loop - Actions
      • Set Unit = (Picked unit)
      • Set Flag = (Load 1 of (Key(Picked unit)) from Hashtable)
      • If (All conditions are true) then do (Actions) else do (Actions)
        • If - Conditions
          • (Unit has buff Roar) Equal to False
        • Then - Actions
          • Unit Group - Remove Unit from Group
          • Unit - Kill Flag
        • Else - Actions
          • Set Point2 = (Position of Unit)
          • Unit - Move Flag instantly to Point2, facing (Facing of Unit)
          • Custom script: call RemoveLocation (udg_Point2)
The trigger above will destroy the flag (which is actually a unit that moves every 0.03 second to the affected units' position and ordered to face the (affected unit's facing - 180 - or something, don't recall what facing the flags' models have).

Well, you get the concept. I don't know how far you can get it and how efficient it will turn out to be though :/
 
Status
Not open for further replies.
Top