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

Heretic Unit Issues

Status
Not open for further replies.
Level 5
Joined
Mar 24, 2020
Messages
80
Hi!

I have created a custom unit using "Heretic". The unit has a custom spell based on Rain of Fire and should cast it when attacked by a unit, and that unit has another unit standing close by that is an enemy.

Currently, in the object manager the unit has no abilities other than Rain of Fire. However, in game the unit casts it's default spells (Carrion Swarm and Raise Dead). The unit on map is definitely the custom unit, not the original. Does anyone know why this could be?

Also, the Rain of Fire trigger doesn't work. Find below.

  • HereticROF
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacked unit)) Equal to Heretic
    • Actions
      • Set VariableSet AttackPoint = (Position of (Attacking unit))
      • Set VariableSet ROFTargets = (Units within 300.00 of AttackPoint matching (((Matching unit) belongs to an enemy of (Owner of (Attacked unit)).) Equal to True).)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in ROFTargets) Greater than or equal to 2
        • Then - Actions
          • Unit - Order (Attacked unit) to Neutral Pit Lord - Rain Of Fire AttackPoint
        • Else - Actions
      • Custom script: call RemoveLocation(udg_AttackPoint)
 
Level 12
Joined
Mar 13, 2020
Messages
421
Ok first thing... there are a lot of things you should check...

on the Unit in object Editor:
cast backswing
cast point
Mana

on the spell:
Manacost

on the trigger:
Before set variables turn it off the trigger
Set a variable for attacked unit before set the point
Turn it at the end on again with a loop trigger after .. - .. seconds i don’t know how long he channel this ability

and then you should know this is not mui if it happens at the same time it works only for one unit...
 
Level 19
Joined
Feb 27, 2019
Messages
591
Are you sure you added the spell to the unit's abilities and not to its abilities skin?

Since the ability has a cooldown I dont think the trigger needs to be turned on and off/have some conditon checks unless you want to make it a bit more efficient. Well I guess I am wrong, it would interupt the cast if units attack before 0.5 seconds of each other.

And dont forget to use the custom script: call DestroyGroup(udg_ROFTargets) after using the group to remove the group leak
 
Last edited:
Level 5
Joined
Mar 24, 2020
Messages
80
It was the ability skin! What a noob error haha! It works fine now. Need to add the remove leak though. I also added a radius condition so the heretic doesn't hit itself with the spell.
Thanks for the help guys. Final trigger below.
  • HereticROF
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacked unit)) Equal to Heretic
      • (Ability Cooldown Remaining of (Triggering unit) for ability Rain of Fire (Heretic)..) Equal to 0.00
      • (Current order of (Triggering unit)) Not equal to (Order(rainoffire))
    • Actions
      • Set VariableSet AttackerPointTemp = (Position of (Attacking unit))
      • Set VariableSet AttackedPointTemp = (Position of (Attacked unit))
      • Set VariableSet AoEGroupTemp = (Units within 400.00 of AttackerPointTemp matching (((Matching unit) belongs to an enemy of (Owner of (Attacked unit)).) Equal to True).)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in AoEGroupTemp) Greater than or equal to 2
          • ((Attacking unit) is in (Units within 200.00 of AttackedPointTemp.).) Equal to False
        • Then - Actions
          • Unit - Order (Attacked unit) to Neutral Pit Lord - Rain Of Fire AttackPoint
        • Else - Actions
      • Custom script: call RemoveLocation(udg_AttackerPointTemp)
      • Custom script: call RemoveLocation(udg_AttackedPointTemp)
      • Custom script: call DestroyGroup(udg_AoEGroupTemp)
 
Last edited:
Level 19
Joined
Feb 27, 2019
Messages
591
I edited the map a bit. Removed leaks correctly and added some conditions to make it mui aswell. I dont use a variable for triggering unit since its only used 2 times in the trigger.

EDIT: You could offset the cast point by a small amount towards angle between position of caster and cast point instead of not casting it if the caster is within the aoe.

Distance between caster and cast point less than 150.
Set cast point = cast point offset by 150 - distance between caster and cast point towards angle between caster and cast point
<- I didnt remove leaks and I assume setting cast point = cast point... will create a leak aswell
 

Attachments

  • Rain of Fire2.w3m
    18.4 KB · Views: 26
Last edited:
Level 5
Joined
Mar 24, 2020
Messages
80
I edited the map a bit. Removed leaks correctly and added some conditions to make it mui aswell. I dont use a variable for triggering unit since its only used 2 times in the trigger.

EDIT: You could offset the cast point by a small amount towards angle between position of caster and cast point instead of not casting it if the caster is within the aoe.

I added to make sure it only casts when it's supposed to.
  • (Current order of (Triggering unit)) Not equal to (Order(rainoffire))
  • (Ability Cooldown Remaining of (Triggering unit) for ability Rain of Fire (Heretic)..) Equal to 0.00
Thanks [db]east & Pwnica!
 
Last edited:
Status
Not open for further replies.
Top