• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

line of sight

Status
Not open for further replies.
Level 5
Joined
May 23, 2008
Messages
123
Is it possable to set line of sight bigger then 1800?

using shift + enter i have set the number bigger, but it has no effect.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Here is the trigger, be sure to read the notes below it ^^


  • Line of Sight
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • Visibility - Create an initially Enabled visibility modifier for Player 1 (Red) emitting Fog of war across (Playable map area)
      • Set Group = (Units in (Playable map area))
      • Unit Group - Pick every unit in Group and do (Actions)
        • Loop - Actions
          • Set loc[1] = (Position of (Picked unit))
          • Visibility - Create an initially Enabled visibility modifier for (Owner of (Picked unit)) emitting Visibility from loc[1] to a radius of (Real((Point-value of (Unit-type of (Picked unit)))))
          • Custom script: call RemoveLocation(udg_loc[1])
      • Custom script: call DestroyGroup(udg_Group)
Notes:
  • It does not make a difference between Fog of War and Black Mask (can be fixed, I wasn't in the mood to do so)
  • I cannot assure you that it works when you have a lot of units on the map, it is best not to let the unit group become too big.
  • This trigger overrides the normal line of sight, it is based on a unit's point value
  • This does not know the difference between day/night (I can make a trigger like that - if necessary)

I have added an example map below, check it out if you want...
 

Attachments

  • LineOfSight.w3x
    19.3 KB · Views: 43
Level 5
Joined
May 23, 2008
Messages
123
well a trigger that happens ever .02 seconds sounds like a lag problem 2 me.

Also the troops a building(does not move), if that matters
 
Level 4
Joined
Oct 18, 2007
Messages
99
Would cause more lag than apoc's way because you also have to do it very frequently

Dude I thank you for the answer, but I want to let u keep in mind that this skill Lasts 5 SECONDS so you can use the trigger once per 5 seconds and remove the lag :p

(no special buff effect and no one even notice its a skill)
 
Level 4
Joined
Oct 18, 2007
Messages
99
And far sights follows moving units?

Haha =P no but it better than the first since it bigger area so you will not notice (2500 range any directions...who will notice =D ) ... xD

OK THATS IT! I WILL SHOW YOU WHO IS BETTER

This maps are the 2 maps that compete
map with 1 in the end: my map that has 372 units in it.
map with 3 in the end: the other guy's map eddited with 372 in total units. I also made his "0.02 seconds to 0.05"

Go and test it.
I will only say that one map is laggy like hell while the other one less laggy and one map couldn't handly that much units and about half of 372 units ARE INVISABLE :p.

Report what you have found better.

PS
Did I mentioned that one of them will FREEZE and CRUSH?


O-W-N-E-D
 

Attachments

  • LineOfSight3.w3x
    31 KB · Views: 38
  • LineOfSight1.w3x
    30.8 KB · Views: 38
Last edited:
Level 7
Joined
Mar 8, 2009
Messages
360
Haha =P no but it better than the first since it bigger area so you will not notice (2500 range any directions...who will notice =D ) ... xD

OK THATS IT! I WILL SHOW YOU WHO IS BETTER

This maps are the 2 maps that compete
map with 1 in the end: my map that has 372 units in it.
map with 3 in the end: the other guy's map eddited with 372 in total units. I also made his "0.02 seconds to 0.05"

Go and test it.
I will only say that one map is laggy like hell while the other one less laggy and one map couldn't handly that much units and about half of 372 units ARE INVISABLE :p.

Report what you have found better.

PS
Did I mentioned that one of them will FREEZE and CRUSH?


O-W-N-E-D

the flare causes much lag and the vision modifier method doesn't work :s
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Hm, shocker: I've said that it causes lag (only when there are too much units on the map, though... 100+ units creates lag).
I've removed all leaks (that are possible in GUI), so it has no long-term effects.

The trigger has to run every .02 seconds, since otherwise the vision would pulsate (check it yourself...).

Erm, I can make it more effective with JASS, but then you have to tell me what kind of map it is and how many units can be on the map at the same time (only the units that have 1800+ sight range).
If those conditions just aren't good (e.g.: 200+ units), then you'll have to try another method... at least I've tried something :/
 
Level 5
Joined
May 23, 2008
Messages
123
Well even if the trigger its self does not make lag, it would add to making a lag. Thus a trigger that runs every .02 seconds is just out of the question.

My map all ready has alot of triggers in it so I was hoping for a non-trigger answer, or a trigger that taxes the computer every little. If you think that you can make a trigger that will not tax the machine much here is more information.

the map is a spawning based map, which leads to large armies, and a big map.
There will be alot of units on the map, but only 0-20ish will actualy have sight over 1800.

PS +rep to every one that has helped so far
 
Level 11
Joined
May 31, 2008
Messages
698
Im pretty sure that if you just change the sight radius it will work. have done it various times and it worked perfectly fine. Maybe you didnt change the sight radius during night time and the game automatically starts during the night.
Do you have NewGen?
 
Level 18
Joined
Mar 13, 2009
Messages
1,411
I don't have World Editor on my notebook so I can't check this right now.
Isn't there a gameplay constant for maximum sight range?
Otherwise would the sight range upgrade work?
Some ideas :p
Having to use those timed triggers sounds like an inefficient idea. :(
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
I don't have World Editor on my notebook so I can't check this right now.
Isn't there a gameplay constant for maximum sight range?
Otherwise would the sight range upgrade work?
Some ideas :p
Having to use those timed triggers sounds like an inefficient idea. :(

Yeah, but I've tried your 2 first ideas and they didn't work, that's why I did that ^^
Oh, well... I have no clue either xD I've tried JNGP and it didn't work for me.
 
Level 4
Joined
Oct 18, 2007
Messages
99
Hm, shocker: I've said that it causes lag (only when there are too much units on the map, though... 100+ units creates lag).
I've removed all leaks (that are possible in GUI), so it has no long-term effects.

The trigger has to run every .02 seconds, since otherwise the vision would pulsate (check it yourself...).

Erm, I can make it more effective with JASS, but then you have to tell me what kind of map it is and how many units can be on the map at the same time (only the units that have 1800+ sight range).
If those conditions just aren't good (e.g.: 200+ units), then you'll have to try another method... at least I've tried something :/


I have only 4 units (that are set by their unit-type, there is only 4 unit of that type at any time, at the most) that need modify their sight range into X whenever I set Y I want their sight to be changed.
Could you make that for me ? (+rep)

Note - (in case it has less lag than my way)
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Okay, it's done I guess...
It makes a difference between fog of war/black mask and day/night, but I believe that it doesn't obstruct the line of sight when the terrain is higher, or when something blocks the way.

Edit: When one a unit matching one of those 4 unit types dies, the hashtable of that unit is cleared (didn't do so before).
 

Attachments

  • LineOfSight.w3x
    21.3 KB · Views: 33
Level 4
Joined
Oct 18, 2007
Messages
99
I think that this would explain everything.
If you get this map to work right - it will be 100% suits my map.
Pressing Esc will make the unit replace its unit type into a sniper that will be needing a lots of range since its a sniper.
4 players on the global map has this ability.
I hope you will be able to make this map work since its my project I like the most.
^.^ Good Luck
 

Attachments

  • LineOfSight.w3x
    20.5 KB · Views: 39
Last edited:
Level 28
Joined
Jan 26, 2007
Messages
4,789
In my project pressing esc will swap the units as in the test map.
I need your system to suit that

It already does... it doesn't only work with people that are already on the map, it works with all units, whether they just spawned or have been on the map for a while.
If you press ESC, the unit type changes, so my system will activate for that unit.
 
Level 6
Joined
Mar 20, 2008
Messages
208
If its a stationary unit, create 8 dummy units at every 45 degree angle, that should give you some what of a circular view

Tag those dummy units with a custom number, and tag the created unit with the same number

Make a trigger that reacts to when the created unit dies, and have it pick every dummy unit with the corresponding number and remove it.

For a more perfect circular view, you would have to build a rect, toss it into a region, then pop in region cells corresponding to a circular shape.
Then create a view modifer for it.

You could then tag the region inside a hashtable with a number, tag the created structure and make a similiar trigger.
 
Status
Not open for further replies.
Top