Flashlight Effect?

Werbung:

Squishy-1

New Member
yeah i dont know what flashlight is but i assume u could do
event=
condition=
action= create special effect flashlight at "000 gen"
 

Shadowz123

New Member
Flashlight...as in a torch...so u could make a certain distance to see with an affect of a torch...as in a radius of the torch.
 

PiRho

New Member
Couldn't you create a region that had a visibility modifier?

If, say, every 0.5 seconds of the game, you made the map invisible, then created a region around the player and set the region visible. At the next time interval, destroy the previous region and repeat the same process again. I haven't tried this so I don't know if it will work, but it's an idea nonetheless.
 

PiRho

New Member
Ok, I just tried things out with a circular visibility modifier (every 0.5 seconds) and I encountered no lag. However, 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. 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.
 

PiRho

New Member
yeah but what about for a game with 12 people realizing most have 56k and he said without jass in his original post
56k shouldn't matter, however out of 12 people, someone with a slower computer may be more affected. All in all, I still say using the unit's viewing distance against fog of war is the best choice. Using these Jass functions is not the best idea.
 
Werbung:

Squishy-1

New Member
err well maybe there was another reason i was lagging, i had a trigger that said every 5 seconds make all units in area move to another area... it was extremely laggy
 
Top