• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Spell] Sight Range Bonus - Spell

Status
Not open for further replies.
Level 11
Joined
Sep 11, 2013
Messages
327
Greetings!:peasant-waving:
I need some help with one spell.. I wanted to made an [active] spell based on Item Sight Range Bonus, but I have at least two problems that I don't know how to solve..
1.If i use this ability as an [Active] spell, Not passive, do not work.. Work only as passive..:peasant-confused:
Spell description(this spell must be normal, no levels): When i press the icon of the spell(which must be [Active]), the vision of Hero must be increased with 375 range for 35 seconds with a 75 seconds cooldown.
After its duration, the bonus vision must be removed.
2.I use this spell for 9 identical heroes, each player has 1(9 players) and i hear that this spell must be [Mui], but i don't know how to do that..
Can anyone help me with that? I am not so good with triggers
Thank you!:peasant-blushing:
 
Hi try this
  • Untitled Trigger 001
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to ..Sight Range Bonus
    • Actions
      • Set SightRangeUnit = (Casting unit)
      • Unit - Add ...Item Sight Range Bonus to SightRangeUnit
      • Unit Group - Add SightRangeUnit to SightRangeUnitGroup
      • Trigger - Turn on Untitled Trigger 002 <gen>
  • Untitled Trigger 002
    • Events
      • Time - Every 0.20 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in SightRangeUnitGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • ((Picked unit) is alive) Equal to False
                  • ((Picked unit) has buff ..Sight Range Bonus ) Equal to False
            • Then - Actions
              • Unit - Remove ...Item Sight Range Bonus from (Picked unit)
              • Unit Group - Remove (Picked unit) from SightRangeUnitGroup
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of units in SightRangeUnitGroup) Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
Update this is better
 
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,583
Don't forget to Turn Off the Loop trigger (Untitled Trigger 002) when the Unit Group is empty.
  • Unit Group - Remove SightRangeUnit from SightRangeUnitGroup
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Number of units in SightRangeUnitGroup) Equal to 0
    • Then - Actions
      • Trigger - Turn off (This trigger)
    • Else - Actions
I also recommend using the SightRangeUnit variable in the Unit Group to improve performance:
  • Untitled Trigger 002
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in SightRangeUnitGroup and do (Actions)
        • Loop - Actions
          • Set SightRangeUnit = (Picked unit)
          • If (Any Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (SightRangeUnit is alive) Equal to False
              • (SightRangeUnit has buff ..Sight Range Bonus ) Equal to False
            • Then - Actions
              • Unit - Remove ...Item Sight Range Bonus from SightRangeUnit
              • Unit Group - Remove SightRangeUnit from SightRangeUnitGroup
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of units in SightRangeUnitGroup) Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
Then reference it throughout instead of using (Picked unit) multiple times.

Also, a Periodic Interval of 1.00 second is very long for an effect like this and will create scenarios where the effects of the spell linger for an extra 1.00 second. I recommend reducing this to at least 0.20 seconds (I use 0.05 -> 0.10 for things like this) for more responsiveness. You won't notice a difference in performance due to the simplicity of the trigger.
 
Last edited:
Don't forget to Turn Off the Loop trigger (Untitled Trigger 002) when the Unit Group is empty.
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Number of units in SightRangeUnitGroup) Equal to 0
    • Then - Actions
      • Trigger - Turn off (This trigger)
    • Else - Actions
Also, a Periodic Interval of 1.00 second is very long for an effect like this and will create scenarios where the effects of the spell linger for an extra 1.00 second. I recommend reducing this to at least 0.20 seconds (I use 0.05 -> 0.10 for things like this) for more responsiveness. You won't notice a difference in performance due to the simplicity of the trigger.
Thx i forgot about that ''Turn Off the Loop trigger'' , as for the time i put 1 sec to not make to much lag :) I will fix those error in 5 min.
Done thx for your help Uncle :ogre_haosis:
 
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,583
Thx i forgot about that ''Turn Off the Loop trigger'' , as for the time i put 1 sec to not make to much lag :) I will fix those error in 5 min
It's a good idea to try and avoid lag but it also depends on what you're doing in the trigger. Simple calculations like checking if a unit has a buff/is alive are very lightweight. Now let's say we were creating a Dummy unit every interval, then I could see a reason for concern since that's a much more taxing function. In this case I don't think you'd ever notice a performance difference between a 1.00 second interval and a ~0.20 second interval, but you would notice the improved responsiveness on the lower interval.
 
Last edited:
It's a good idea to try and avoid lag but it also depends on what you're doing in the trigger. Simple calculations like checking if a unit has a buff/is alive is very lightweight. Now let's say we were creating a Dummy unit every interval, then I could see a reason for concern since that's a much more taxing function. In this case I don't think you'd ever notice a performance difference between a 1.00 second interval and a ~0.20 second interval, but you would notice the improved responsiveness on the lower interval.
True well thx again for your help now i need to fix some abilities that i made for my map ("Turn Off the Loop trigger")
 
Regarding vision and update frequency:
Vision cells (distance etc.) updates every 0.4 seconds, so for vision things I strongly believe that update frequency in vision-related update-loops should be 0.4 for "fairly accurate" or twice that frequency for "almost perfectly accurate".
I base this information on Vision guide that I read recently.
 
Status
Not open for further replies.
Top