full sight tower problem...

polva

New Member
Reaction score
1
Hi everyone,
i created a tower with full sight but after tower's death I dont lose the sight...

Visibility
Events
Unit - A unit Finishes construction
Conditions
(Unit-type of (Constructed structure)) Equal to Scout Tower
Actions
Visibility - Create an initially Enabled visibility modifier for (Owner of (Constructed structure)) emitting Visibility from (Position of (Constructed structure)) to a radius of 1000000000.00

probably i must create a new condition but wich of then? someone can help me? :confused:
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
its because you create the visibility at that position, not on that unit, you would need to change the unit's obeject editor value day/night sight radius to 1000000000 in order to have it dissapear when it dies
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
its because you create the visibility at that position, not on that unit, you would need to change the unit's obeject editor value day/night sight radius to 1000000000 in order to have it dissapear when it dies
The max value for sight range of a unit is 1800 and there is no way to increase it unfortunately.

What you need to do is map the visibility modifier, which you create when the construction of a scout tower finishes, to the other to, once the tower gets destroyed, remove it again.
I would suggest a hashtable though i guess unit indexing would work as well given that not too many of those scout towers would be in the game at once. (less then 8000)
 

merlinds

Member
Reaction score
15
Is better with the hash table, since when you finish building the tower you create the visibility modifier and save it into the HT using the handle id of the tower builded. then with another trigger you detect when a tower dies, and delete the visibiliti modifier stored with the handle id of the dying unit.
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
When the tower dies, destroy the Visibility Modifier.

You could use a wait, like so:
Trigger:
  • Visibility
    • Events
      • Unit - A unit Finishes construction
    • Conditions
      • (Unit-type of (Constructed structure)) Equal to Scout Tower
    • Actions
      • Visibility - Create an initially Enabled visibility modifier for (Owner of (Constructed structure)) emitting Visibility from (Position of (Constructed structure)) to a radius of 1000000000.00
      • Wait until (((Constructed structure) is dead) Equal to True), checking every 1.00 seconds
      • Visibility - Destroy (Last created visibility modifier)
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
that isnt MUI though, if someone creates 2 then destroys 1 it wont work still, save it in a hashtable
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
Or simpler still, use a local variable.

Trigger:
  • Visibility
    • Events
      • Unit - A unit Finishes construction
    • Conditions
      • (Unit-type of (Constructed structure)) Equal to Scout Tower
    • Actions
      • Custom Script: local fogmodifier VisMod
      • Visibility - Create an initially Enabled visibility modifier for (Owner of (Constructed structure)) emitting Visibility from (Position of (Constructed structure)) to a radius of 1000000000.00
      • Custom Script: set VisMod = GetLastCreatedFogModifier()
      • Wait until (((Constructed structure) is dead) Equal to True), checking every 1.00 seconds
      • Custom Script: call DestroyFogModifier(VisMod)
 

polva

New Member
Reaction score
1
Or simpler still, use a local variable.

Trigger:
  • Visibility
    • Events
      • Unit - A unit Finishes construction
    • Conditions
      • (Unit-type of (Constructed structure)) Equal to Scout Tower
    • Actions
      • Custom Script: local fogmodifier VisMod
      • Visibility - Create an initially Enabled visibility modifier for (Owner of (Constructed structure)) emitting Visibility from (Position of (Constructed structure)) to a radius of 1000000000.00
      • Custom Script: set VisMod = GetLastCreatedFogModifier()
      • Wait until (((Constructed structure) is dead) Equal to True), checking every 1.00 seconds
      • Custom Script: call DestroyFogModifier(VisMod)

WOW I did it! thank you guy you helped a lot... thanks for everyone that posted here :thup:
OBS. I used radius of 99999 i dont know why but 1000000000.00 crash ^^
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
Maybe because it was over the limit. Things like that tend to happen a lot with big values.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top