How to make my unit auto use skill??

BRUTAL

I'm working
Reaction score
118
make a trigger that runs periodically like every second, then make a unit group variable and set that to check every ally unit within x range. Then just run a unit group loop and order the hero to use holy light on the picked unit.
 

millzy

Ultra Cool Member
Reaction score
44
hand written so some parts will be missing

Trigger:
  • event
    • evry x seconds
    • conditions
    • actions
    • set hero = ur hero
    • set hero_point = posistion of hero
    • set heal group = units within x range of hero_point matching is an ally/not structure so on
    • unit - pick units in heal group and do actions
    • if/then/else
    • if picked units heath is under 50%
    • then order hero to cast holy light on picked unit
    • else do nothing
 

BRUTAL

I'm working
Reaction score
118
Here's a neater version that doesn't leak.
Trigger:
  • Untitled Trigger 001
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set Pos = (Position of Hero)
      • Set Group = (Units within 500.00 of Pos)
      • Unit Group - Pick every unit in Group and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (((Picked unit) belongs to an ally of (Owner of Hero)) Equal to True) and ((Percentage life of (Picked unit)) Less than or equal to 50.00)
            • Then - Actions
              • Unit - Order Hero to Human Paladin - Holy Light (Picked unit)
            • Else - Actions
      • Custom script: call RemoveLocation(udg_Pos)
      • Custom script: call DestroyGroup(udg_Group)

You don't need to set the 'Hero' variable periodically; do it once somewhere else is fine.
 

HeX.16

Isn't Trollin You Right Now
Reaction score
131
Yes its a point variable. Make a unit variable and set it in the init trigger.
 

skyangel1234

Member
Reaction score
5
But my Holy Light is a custom skill so cannot use Human Paladin (Holy Light) ?? how to make my unit use custom Holy Light to Heal ??
 

Happy

Well-Known Member
Reaction score
71
the order is correct....if you made a custom skill and want a unit to cast it order it to cast the original spell....in this case its holy light^^
 

skyangel1234

Member
Reaction score
5
If The skill name are changed like orginal skill is Holy Light but the custom skill name is Holy Lightz does it matter ??
 

Happy

Well-Known Member
Reaction score
71
right this doesnt matter...just the skill you based it off...means its impossible to have 2 spell with the same base (sure there are ways but for now its impossible^.~)...

you also could name the spell like this
V
V
V
safbuweq35228zt48zv38vu42378th

wouldnt change anything...besides its unreadable^^
 

skyangel1234

Member
Reaction score
5
Now the holy light skill finish but the second spell is custom healling wave spell i no found the base skill in trigger....
 

Happy

Well-Known Member
Reaction score
71
same way...order YOUR HERO to ORC - SHADOWHUNTER (i think thats the english name^^) - Healing wave XY
 

skyangel1234

Member
Reaction score
5
Ok found but about custom script problem
me set variables
Trigger:
  • Actions
    • Set point = position of unit
    • Set team = unit withn 800 range of point


Ater that i do all trigger until the custom script there
then i do this
Trigger:
  • Actions
    • Custom Script = call RemoveLocation(udg_point)
    • Custom Script: call DestroyGroup(udg_team)


Then when i save the map it will jumnp out somethings it say custom script wrong or what then it will show the full jass and contain with 2 wrong line
and show me and the map cannot be start how
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top