HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Limited Vision Trigger - Leak Removal Help Needed

10-19-2007, 04:03 PM#1
rulerofiron99
For a game I'm busy making I made a system that only allows players to see what is in front of their hero - the sides are all in black mask.

The trigger is working fine, but the moment I remove the points using RemoveLocation, the trigger simply fails.

This is the trigger:
Trigger:
Vision
Collapse Events
Time - Every 0.40 seconds of game time
Conditions
Collapse Actions
Collapse For each (Integer A) from 1 to 12, do (Actions)
Collapse Loop - Actions
Collapse For each (Integer B) from 1 to sightRange[(Integer A)], do (Actions)
Collapse Loop - Actions
Visibility - Destroy sights[((12 x (Integer A)) + (Integer B))]
Collapse For each (Integer A) from 1 to 12, do (Actions)
Collapse Loop - Actions
Set l = (Position of hero[(Integer A)])
Set sb = True
Collapse For each (Integer B) from 1 to sightRange[(Integer A)], do (Actions)
Collapse Loop - Actions
Set sp[0] = l
Set sp[1] = (sp[0] offset by 64.00 towards (Facing of hero[(Integer A)]) degrees)
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Terrain pathing at sp[1] of type Walkability is off) Equal to False
Collapse Then - Actions
Visibility - Create an initially Enabled visibility modifier for (Player((Integer A))) emitting Visibility from sp[1] to a radius of (160.00 + (48.00 x (Real((Integer B)))))
Set sights[((12 x (Integer A)) + (Integer B))] = (Last created visibility modifier)
Collapse Else - Actions
Set sb = False
Set l = sp[1]

So all I need is for the point leaks to be removed - I am even willing to convert the trigger entirely to jass if it is absolutely neccesary.

Thanks in advance.
10-20-2007, 01:29 AM#2
botanic
when you do this

"Visibility - Destroy sights[((12 x (Integer A)) + (Integer B))]"

destroy the points, that should work except on the first one you will need to have some value on map init or it will error because of there being no value

so like on map init do a loop to set a starting value for the first set of variables
10-20-2007, 09:58 PM#3
rulerofiron99
I think I know what you mean - I hope it works.