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

Flashlight {how to increase unit's vision?}

Status
Not open for further replies.
Level 14
Joined
Dec 29, 2009
Messages
931
Try this.

  • Item Trigger
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Goblin Night Scope
    • Actions
      • Set Temp_Point00[(Player number of (Owner of (Triggering unit)))] = (Position of (Triggering unit))
      • Visibility - Create an initially Enabled visibility modifier for (Owner of (Triggering unit)) emitting Visibility from (Position of (Triggering unit)) to a radius of 500.00
      • Set Temp_ItemVisMod00[(Player number of (Owner of (Triggering unit)))] = (Last created visibility modifier)
  • ItemLost Trigger
    • Events
      • Unit - A unit Loses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Goblin Night Scope
    • Actions
      • Visibility - Destroy Temp_ItemVisMod00[(Player number of (Owner of (Triggering unit)))]
      • Custom script: call RemoveLocation(udg_Temp_Point00[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])
Very basic, easy to use, and works. I've included a test map, in case you are the type that likes to CnP triggers (I understand, we've all done it before).

Just don't forget to remove the Ultravision (item) ability from the item, if you're basing it off the Goblin Night Scope (like I did, lol).
 

Attachments

  • TestMap.w3x
    18.5 KB · Views: 122
Level 26
Joined
Mar 19, 2008
Messages
3,140
@Arkon Kaos your doesn't increase unit vision sight, but just creates visibility modifier in target area, so only position where item has been taken will generate sight, and when taken is disappears. Also it leaks location.

From what I understand, you want to increase unit sight, not reveal given area right, A-Mexican-Taco?
Here is my test map, its MUI and properly gives/removes vision & properly checks state of hero equipment when hero is revived.
 

Attachments

  • Increase Visibility.w3x
    23.1 KB · Views: 141
Last edited:
Level 26
Joined
Mar 19, 2008
Messages
3,140
There is an ability ( to find it CTRL + F enter Item Sight Range Bonus ) and add it to the item. It will work :) No dummies, or triggers
Hah, I have forgotten about that since I though guys before me checked object editor already. My test map still works great but adding this ability (rawcode 'Alsi') is just simpler. However, if you want to manipulate day sight in differend way than night vision (for egzample in day +250, in night +100) dummy unit creation system proves to be better.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Don't add the ability to the unit, instead, add it to the Item Ability, lol.
Also, he's not asking for Day/Night vision, so, stick to the topic, lol.
Just increase its vision by using the Item Sight Range Bonus, that's it.
 
Status
Not open for further replies.
Top