Forums
New posts
Search forums
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Come and join our gamer community by
registering for free here
Other Gaming Forum
PC games
WarCraft III Modding
Flashlight Effect?
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="PiRho" data-source="post: 125921" data-attributes="member: 6586"><p>Ok, I just tried things out with a circular visibility modifier (every 0.5 seconds) and I encountered no lag. However, <strong>I think it would be more efficient just using the unit's sight radius against the fog-of-war to simulate a circle of light.</strong> It would certainly be more efficient if you could get away with it.</p><p></p><p>My test map simply created a footy in the middle of the map that you can move around. The sight range modifier followed him around.</p><p>Test code, for reference:</p><p>[jass]</p><p>function Trig_init_Actions takes nothing returns nothing</p><p> local location p1 = GetRectCenter(GetPlayableMapRect())</p><p> local location p2</p><p> call CreateNUnitsAtLoc( 1, 'hfoo', Player(0), p1, bj_UNIT_FACING )</p><p> set udg_footy = GetLastCreatedUnit()</p><p> set p2 = GetUnitLoc(udg_footy)</p><p> set udg_vmod = CreateFogModifierRadiusLocBJ( true, Player(0), FOG_OF_WAR_VISIBLE, p2, 2000.00 )</p><p></p><p> call RemoveLocation(p1)</p><p> set p1 = null</p><p> call RemoveLocation(p2)</p><p> set p2 = null</p><p>endfunction</p><p></p><p>//===========================================================================</p><p>function InitTrig_init takes nothing returns nothing</p><p> set gg_trg_init = CreateTrigger( )</p><p> call TriggerAddAction( gg_trg_init, function Trig_init_Actions )</p><p>endfunction</p><p>[/jass]</p><p>[jass]</p><p>function Trig_test_Actions takes nothing returns nothing</p><p> local location p = GetUnitLoc(udg_footy)</p><p> call DestroyFogModifier( udg_vmod )</p><p> set udg_vmod = CreateFogModifierRadiusLocBJ( true, Player(0), FOG_OF_WAR_VISIBLE, p, 2000.00 )</p><p> call RemoveLocation(p)</p><p> set p = null</p><p>endfunction</p><p></p><p>//===========================================================================</p><p>function InitTrig_test takes nothing returns nothing</p><p> set gg_trg_test = CreateTrigger( )</p><p> call TriggerRegisterTimerEventPeriodic( gg_trg_test, 0.50 )</p><p> call TriggerAddAction( gg_trg_test, function Trig_test_Actions )</p><p>endfunction</p><p>[/jass]</p><p>Using two variables:</p><p>udg_footy = unit</p><p>udg_vmod = visibility modifier</p><p></p><p>This is just test code, which is not really mean for use in a map. I'm just posting it here for reference.</p></blockquote><p></p>
[QUOTE="PiRho, post: 125921, member: 6586"] Ok, I just tried things out with a circular visibility modifier (every 0.5 seconds) and I encountered no lag. However, [b]I think it would be more efficient just using the unit's sight radius against the fog-of-war to simulate a circle of light.[/b] It would certainly be more efficient if you could get away with it. My test map simply created a footy in the middle of the map that you can move around. The sight range modifier followed him around. Test code, for reference: [jass] function Trig_init_Actions takes nothing returns nothing local location p1 = GetRectCenter(GetPlayableMapRect()) local location p2 call CreateNUnitsAtLoc( 1, 'hfoo', Player(0), p1, bj_UNIT_FACING ) set udg_footy = GetLastCreatedUnit() set p2 = GetUnitLoc(udg_footy) set udg_vmod = CreateFogModifierRadiusLocBJ( true, Player(0), FOG_OF_WAR_VISIBLE, p2, 2000.00 ) call RemoveLocation(p1) set p1 = null call RemoveLocation(p2) set p2 = null endfunction //=========================================================================== function InitTrig_init takes nothing returns nothing set gg_trg_init = CreateTrigger( ) call TriggerAddAction( gg_trg_init, function Trig_init_Actions ) endfunction [/jass] [jass] function Trig_test_Actions takes nothing returns nothing local location p = GetUnitLoc(udg_footy) call DestroyFogModifier( udg_vmod ) set udg_vmod = CreateFogModifierRadiusLocBJ( true, Player(0), FOG_OF_WAR_VISIBLE, p, 2000.00 ) call RemoveLocation(p) set p = null endfunction //=========================================================================== function InitTrig_test takes nothing returns nothing set gg_trg_test = CreateTrigger( ) call TriggerRegisterTimerEventPeriodic( gg_trg_test, 0.50 ) call TriggerAddAction( gg_trg_test, function Trig_test_Actions ) endfunction [/jass] Using two variables: udg_footy = unit udg_vmod = visibility modifier This is just test code, which is not really mean for use in a map. I'm just posting it here for reference. [/QUOTE]
Verification
Post reply
Other Gaming Forum
PC games
WarCraft III Modding
Flashlight Effect?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…
Top