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

How to drasticaly increase unit sight?

Status
Not open for further replies.
Level 7
Joined
Jul 1, 2008
Messages
1,025
Hi, I want to drasticaly increase the sight radius of all units beyond the 1800 limit that world editor allows, anyway I can do this?

I also need to set it so all units have flying sight, I tried setting all doodads occular Height to 0 but there are still some that seem to get in the way and block sight so I imagine setting all units to fly visibilty type might help with this. But is this possible?

Please can anyone help.
 
Level 11
Joined
Nov 15, 2007
Messages
781
I'm not sure if this will effect performance if used with a large number of units, but it probably will, so you'd be safe using this only for units you need to have extended vision. Also change 3000.00 to whatever you want of course.

  • Vision
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • Set group = (Units in (Playable map area))
      • Unit Group - Pick every unit in group and do (Actions)
        • Loop - Actions
          • Set loc = (Position of (Picked unit))
          • Visibility - Destroy (Load (Key (Picked unit)) of 1 in Table)
          • Visibility - Create an initially Enabled visibility modifier for (Owner of (Picked unit)) emitting Visibility from loc to a radius of 3000.00
          • Hashtable - Save Handle Of(Last created visibility modifier) as (Key (Picked unit)) of 1 in Table
          • Custom script: call RemoveLocation(udg_loc)
      • Custom script: call DestroyGroup(udg_group)
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
I think that making it as a "Every 1 second" or "0.5" seconds is more than enough. You would save 10 to 20 events per second and it's almost the same in this case.
 

noj

noj

Level 4
Joined
Jan 16, 2006
Messages
89
I agree with Spart... the visibility change constant it around 0.45 no need to go faster then that.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
  • Vision
    • Events
      • Time - Every 0.5 seconds of game time
    • Conditions
    • Actions
      • Set group = (Units in (Playable map area))
      • Unit Group - Pick every unit in group and do (Actions)
        • Loop - Actions
          • Set unt = (Picked Unit)
          • Set loc = (Position of unt)
          • Custom script: set udg_int = GetHandleId(udg_unt)
          • Visibility - Destroy int of 1 in Table
          • Visibility - Create an initially Enabled visibility modifier for (Owner of unt) emitting Visibility from loc to a radius of 3000.00
          • Hashtable - Save Handle Of(Last created visibility modifier) as int of 1 in Table
          • Custom script: call RemoveLocation(udg_loc)
      • Custom script: call DestroyGroup(udg_group)
Here it's a bit optimized.

There's no need to know a lot of Hashtables, just follow instructions.
It's like a ChessBoard, where you assign a unit (piece) to a specific square (G4, or 7x4). Here you save the UnitID in a giant board of data. The unit ID may be 41993285672 and we're storing this value in the "1" of the table. Though we see numbers, the game reads "41993285672" as "Footman" or any unit.

That's why this: Hashtable - Save Handle Of(Last created visibility modifier) as int of 1 in Table. We save the "VisibilityID" as the "Unit ID" in "1" in the Table... or something like that.
 
Status
Not open for further replies.
Top