- Joined
- Sep 20, 2015
- Messages
- 385
Hello, I'm using BPower(Missile [GUI] version 1.6.1) missile system in my map.
I want to make a missile that gives vision around it when it's travelling.
I tired to do this in two ways.
1. With Fogmodifier. I create one fogmodifier when the missile is travelling. In the system there is a missile event ID i can use to check that.
This works, but the integers can go really high like 5000 and over. Also i've been told that fogmodifiers are bad for performances.
Is this a problem?
The other way it didi it was to create a dummy unit and move it on the missile position. It workjs but i had some problems, especially when firing multiple missiles.
Can someone suggest me the better way to do this?
I want to make a missile that gives vision around it when it's travelling.
I tired to do this in two ways.
1. With Fogmodifier. I create one fogmodifier when the missile is travelling. In the system there is a missile event ID i can use to check that.
This works, but the integers can go really high like 5000 and over. Also i've been told that fogmodifiers are bad for performances.
Is this a problem?
JASS:
globals
fogmodifier array lightfogmod
integer fogmodn = 0
integer fogmodn2 = 0
endglobals
function lightfogmodremove takes nothing returns nothing
call PolledWait(0.8)
if fogmodn2 == fogmodn then
else
call DestroyFogModifier(lightfogmod[fogmodn2])
call DisplayTimedTextToPlayer(Player(0),0,0,1,"fogmodn2 = " + I2S(fogmodn2))
set fogmodn2 = fogmodn2+1
endif
endfunction
if udg_Missile__EventId == udg_EVENT_MISSILE_PERIODIC then
set lightfogmod[fogmodn] = CreateFogModifierRadius(Player(i), FOG_OF_WAR_VISIBLE, tx,ty, 400, true,false)
call FogModifierStart(lightfogmod[fogmodn])
set fogmodn = fogmodn + 1
call BJDebugMsg(I2S(fogmodn))
call lightfogmodremove()
endif
The other way it didi it was to create a dummy unit and move it on the missile position. It workjs but i had some problems, especially when firing multiple missiles.
Can someone suggest me the better way to do this?