Enchanted Eyes - spell problem

Wratox1

Member
Reaction score
22
Hello, ive made this spell called Enchanted Eyes:

Gives the Watcher magical eyes, with these eyes he can spot enemy heroes with low hit points.

and here are my triggers:

Trigger:
  • enchanted eyes learn
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Enchanted Eyes
    • Actions
      • Trigger - Turn on enchanted eyes start <gen>
      • Trigger - Turn on enchanted eyes end <gen>
      • Game - Display to (All players) the text: 1
      • Trigger - Turn off (This trigger)


Trigger:
  • enchanted eyes start
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (GDD_DamagedUnit is A Hero) Equal to True
              • ((Owner of GDD_DamagedUnit) is an enemy of (Owner of enchanted_eyes_hero)) Equal to True
              • (Percentage life of GDD_DamagedUnit) Less than or equal to 10.00
              • enchanted_eyes_bool Equal to False
            • Then - Actions
              • Set enchanted_eyes_bool = True
              • Countdown Timer - Start enchanted_eyes_timer as a One-shot timer that will expire in (4.00 + ((Real((Level of Enchanted Eyes for enchanted_eyes_hero))) x 4.00)) seconds
              • Set enchanted_eyes_target = GDD_DamagedUnit
              • Set temp_point = (Position of enchanted_eyes_target)
              • Unit - Create 1 enchanted eye dummy for (Owner of enchanted_eyes_hero) at temp_point facing Default building facing degrees
              • Set enchanted_eye = (Last created unit)
              • Custom script: call RemoveLocation(udg_temp_point)
              • Trigger - Turn on enchanted eyes move <gen>
              • Game - Display to (All players) the text: 2
            • Else - Actions


Trigger:
  • enchanted eyes move
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • Set enchanted_eyes_point = (Position of enchanted_eyes_target)
      • Unit - Move enchanted_eye instantly to enchanted_eyes_point
      • Custom script: call RemoveLocation(udg_enchanted_eyes_point)
      • Game - Display to (All players) the text: 3


Trigger:
  • enchanted eyes end
    • Events
      • Time - enchanted_eyes_timer expires
    • Conditions
    • Actions
      • Trigger - Turn off enchanted eyes move <gen>
      • Unit - Remove enchanted_eye from the game
      • Set enchanted_eye = No unit
      • Set enchanted_eyes_hero = No unit
      • Set enchanted_eyes_bool = False
      • Game - Display to (All players) the text: 4


but there is one problem with it, it only works one time, and i cant understand why!

can someone help me with this?
 

evilwolf

Member
Reaction score
11
It might be caused by the condition in trigger 1, I think it only fires whenever it learns the first level of the skill. Use a variable array for the ability.
Ex: Learned skill = Enchanted Eyes(1) = Enchanted eyes level 1
Or use If then else action.
 

Wratox1

Member
Reaction score
22
the first trigger is just to turn on the other triggers when the hero learns the spell, so i dont see why it would be the cause..
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
I'm not sure why it only works once, but why did you put the actions of enchanted eyes start in a Pick All Units action? It's not serving any purpose that I can see, and is definitely detrimental to performance.
 

0WN3D

New Member
Reaction score
15
the onli problem i can find is that the loop overides its self....
The solution is use unit group instead of unit when setting it in a loop...
But i dont think that is the source of the problem

Trigger:
  • enchanted eyes start
    • Set enchanted_eyes_target = GDD_DamagedUnit (This unit will be overwritten)
    • Set enchanted_eye = (Last created unit) ( and so is this)


These 2 problem cause your Move trigger to have problem...
 

Wratox1

Member
Reaction score
22
I'm not sure why it only works once, but why did you put the actions of enchanted eyes start in a Pick All Units action? It's not serving any purpose that I can see, and is definitely detrimental to performance.

umm, i dont know really, i put i there first i think, then i took a break, and when i went back to work with the trigger i just put all the actions in the loop:(

i will remove it now, and see if it works more then once!

Edit: nope, it didnt work:( any other suggestions?
 

0WN3D

New Member
Reaction score
15
Another possible reason is what your ability is based on... not rly sure ... jus maybe....
 

jig7c

Stop reading me...-statement
Reaction score
123
how many heroes have this skill? cause its not MUI...
like weep said, remove that unit-loop in the first trigger... its useless
also remove the if/then/else statement, and put the conditions in the right section... its also usless

in your very first trigger, where the hero learns the skill...
put this in
Set enchanted_eyes_hero = Triggering Unit...

because in the start trigger, in the condition...
"(Owner of GDD_DamagedUnit) is an enemy of (Owner of enchanted_eyes_hero)) Equal to True"

i think it might be messing up, because enchanted eyes hero is not being declared anywhere prior to that...
 

Wratox1

Member
Reaction score
22
how many heroes have this skill? cause its not MUI...
like weep said, remove that unit-loop in the first trigger... its useless
also remove the if/then/else statement, and put the conditions in the right section... its also usless

the loop is already removed and it didnt work, and why should i remove the if/then/else statement? how else should i check if the unit meets the conditions needed?


in your very first trigger, where the hero learns the skill...
put this in
Set enchanted_eyes_hero = Triggering Unit...

because in the start trigger, in the condition...
"(Owner of GDD_DamagedUnit) is an enemy of (Owner of enchanted_eyes_hero)) Equal to True"

i think it might be messing up, because enchanted eyes hero is not being declared anywhere prior to that...

at the moment the enchanted_eyes_hero is a preplaced hero which i set at init..
sorry if i didnt tell you that, but that was a good idea, i will add it!
 

jig7c

Stop reading me...-statement
Reaction score
123
put all the conditions in the start trigger in the Events>Conditions(here).....

not in the if/then/else.. its pointless to have if/then/else if u have no unit-group
also, if that hero is already set in the Map Init trigger, then no need to declare it again
 

Wratox1

Member
Reaction score
22
put all the conditions in the start trigger in the Events>Conditions(here).....

not in the if/then/else.. its pointless to have if/then/else if u have no unit-group

ah, didnt think of that >.<

also, if that hero is already set in the Map Init trigger, then no need to declare it again
that action is not going to be there later on, i just put it there so i could test my spell..
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top