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

Changing Sight Range back and forth

Status
Not open for further replies.
Level 19
Joined
Oct 12, 2007
Messages
1,821
Is there a way to change the sight range of a unit back and forth?
I'm working on an ability that reduces the sight range of a unit for a few seconds. Players only own 1 unit in my map so it can be a player based upgrade but I'm not sure if it's possible to decrease the upgrade level in some way. Because this ability should be able to be used a few times in a map, and not be a one-time use ability only.

Things I think about are:
1) Making an upgrade with very much levels. Every odd level is reduced sight range and every other level is the normal sight range so it switches back and forth (until the upgrade ran out of levels)

2) Reducing the sight range of all units to 0 and creating a dummy unit that gets positioned on them with a timer. This dummy unit has the sight range that's required and this dummy unit will get replaced as soon as the sight range increases/decreases.

But is there any easier option? (JASS, GUI, whatever)
 
Level 16
Joined
Mar 3, 2006
Messages
1,564
I have an idea but I didn't check it out; why not use a multi-level ability Ultra vision and decrease and increase the ability level to get the desired vision.

I will check if this possible or not.

<<< EDIT >>>

I checked the ultra vision ability and it can't be set or changed. So my best shot is using line of sight blocking modifiers and place them around the unit with the range you need.
 
Level 19
Joined
Oct 12, 2007
Messages
1,821
Ultravision doesn't work. You can't change anything in it.
It's a bit of a weird ability effect.

Sight blockers won't work either. Because it's an ability in a multiplayer map, so other players' units have to keep their original sight range.
I guess I'm going for artificial sight range. Every unit has a dummy unit with a specific sight range that gets positioned on top of them with a constant timer. This unit can be replaced with an other dummy unit with a smaller sight range.
Just don't like adding '0.05' constant timers because there are quite a few of those in the map already and I don't want it to become laggy.
 
Level 19
Joined
Oct 12, 2007
Messages
1,821
What do you mean Teelo?

And Maker, that's a great option indeed. It will just cost me lots of work because I will have to add double conditions to many triggers that check what kind of hero it is.

Not sure yet what I will use. But so far I got some nice suggestions.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
The spell in the test map will reduce the unit's sight range by 500 (adding negative values in Object Editor will reduce sight range, whereas positive values to increase sight range of a unit)

The trigger is MUI, to test it, cast the spell on each unit interval by 1 second.

Download the test map below
 

Attachments

  • Simple Sight System.w3x
    12.6 KB · Views: 111
Level 19
Joined
Oct 12, 2007
Messages
1,821
Thanks alot!
That's the one and only perfect solution!
Didn't know that spell 'Item Sight Range Bonus' excisted!
 
Status
Not open for further replies.
Top