Hunter in the Night

snmiglight

Active Member
Reaction score
3
Hunter in the Night; are these leaking?

hi there.. it's me again asking questions...

almost a year ago, i tried to emulate dota's hunter in the night skill.
now i have these codes that i simply copied from somewhere.
here's the codes. are there any leaks or something here?

Trigger:
  • Nighttime
    • Events
      • Game - The in-game time of day becomes Greater than or equal to 18.00
      • Game - The in-game time of day becomes Less than or equal to 5.59
    • Conditions
    • Actions
      • Set Night = True
      • Unit Group - Pick every unit in (Units in (Playable map area) matching ((((Matching unit) is A Hero) Equal to True) and ((Level of Hunter in the Night (Learning Skill) for (Matching unit)) Greater than 0))) and do (Actions)
        • Loop - Actions
          • Unit - Add Hunter in the Night (Night Skill) to (Picked unit)
          • Unit - Remove Hunter in the Night (Day Skill) from (Picked unit)
          • Unit - Remove Hunter in the Night [Daytime] buff from (Picked unit)



Trigger:
  • Daytime
    • Events
      • Game - The in-game time of day becomes Greater than or equal to 6.00
      • Game - The in-game time of day becomes Less than or equal to 17.59
    • Conditions
    • Actions
      • Set Night = False



Trigger:
  • Set to Level
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area) matching ((((Matching unit) is A Hero) Equal to True) and ((Level of Hunter in the Night (Learning Skill) for (Matching unit)) Greater than 0))) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Night Equal to True
            • Then - Actions
              • Unit - Set level of Hunter in the Night (Night Skill) for (Picked unit) to (Level of Hunter in the Night (Learning Skill) for (Picked unit))
            • Else - Actions
              • Unit - Add Hunter in the Night (Day Skill) to (Picked unit)
              • Unit - Remove Hunter in the Night (Night Skill) from (Picked unit)
              • Unit - Remove Hunter in the Night [Nighttime] buff from (Picked unit)



Trigger:
  • Learning
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Level of Hunter in the Night (Learning Skill) for (Triggering unit)) Equal to 1
          • (Learned Hero Skill) Equal to Hunter in the Night (Learning Skill)
    • Actions
      • Unit - Add Hunter in the Night (Night Skill) to (Triggering unit)
      • Unit - Remove Hunter in the Night (Day Skill) from (Picked unit)
      • Unit - Remove Hunter in the Night [Daytime] buff from (Picked unit)


Night is a Boolean variable initially set to true

one more question: will periodically checking in every split seconds, say every 0.01 seconds causes lag? thanks in advanced again and more power.
 

Nerfpl

New Member
Reaction score
53
timer wont cause lag, i dont see any leaks, but theres like 500 unneeded stuff, also thers refering to picked unit when you actually dont pick it
 

snmiglight

Active Member
Reaction score
3
...but theres like 500 unneeded stuff, also thers refering to picked unit when you actually dont pick it

will you please rearrange these and remove those unneeded stuffs so i may know them? (with explanations, if you wouldn't mind) thnx
 

Tom Jones

N/A
Reaction score
437
Two unit group leaks, either assign the unit group a unit group variable, and then use the variable as the reference when picking the group, or add bj_wantDestroyGroup = true before the picking the group.
 

Nerfpl

New Member
Reaction score
53
sry im bit tired nad laze to remake this whole thing but i can tell you few things:

- there are basicly 2 events (so 2 triggers)
= first when time in game becomes grater than 6.00 (add condition time in game is less than 18.00)
= second when time in game becomes grater than 18.00 (add condition time in game is less than 6.00)

then you pick all hunters checking if they have given skill ( day when night and vice versa), if it becomes night, its obvius you need to remove "hunter in night (day) skll. so set some integer(array for MPI) to level of (day) skill, remove day skill and add night skill. set level of night skill to this integer you stored before. also you dont have to remove buff i belive. since its only endurance aura it will go off after 1,2 seconds.

second trigger is oposite of this, basicly same thing just swap skills
 

snmiglight

Active Member
Reaction score
3
....also you dont have to remove buff i believe. since its only endurance aura it will go off after 1,2 seconds.

i've done that for cosmetic reasons; so that two buffs do now show together (they have different buffs.) anyways thanks for the explanations. *grabs WE again*


.....if they have given skill ( day when night and vice versa), if it becomes night, its obvius you need to remove "hunter in night (day) skll. so set some integer(array for MPI) to level of (day) skill, remove day skill and add night skill. set level of night skill to this integer you stored before.....

does it mean that i don't need anymore a boolean variable for night?
and maybe i dont need an integer variable 'coz the learning skill is a hidden attribute bonus skill;
i can set the endurance auras' level to the lvl of attribute bonus skill, is that right?
 

Nerfpl

New Member
Reaction score
53
"learning skill"??

you shoul have
Hunter in night DAY (can be endurance aura with 0% boost on all levels)
Hunter in night NIGHT (endurance aura with some values)
 

snmiglight

Active Member
Reaction score
3
yep; it's a hidden attribute bonus; that's what i use to level it up, then when i set the endurance's level, it would be equal to the "learning skill" or attribute skill bonus.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top