HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Delay!!!

10-18-2004, 11:12 PM#1
iNfraNe
Hi all,

In Warcraft III Worms we have wind as units with a special wind model that are replaced on a random point in the map each 3 seconds (the time of the wind model's animation) for that we have this trigger that runs every x seconds:

Code:
function Trig_Wind_Actions takes nothing returns nothing
    local unit cloud
    set cloud = GroupPickRandomUnit(udg_WindUnitGroup)
    call ResetUnitAnimation( cloud )
    set udg_tempPoint2 = GetRandomLocInRect(GetPlayableMapRect())
    call SetUnitPositionLocFacingBJ( cloud, udg_tempPoint2, udg_varWindDirection )
    call RemoveLocation( udg_tempPoint2 )
    call GroupRemoveUnitSimple( cloud, udg_WindUnitGroup )
    call PolledWait( 3.00 )
    if (cloud != null) then
    call GroupAddUnitSimple( cloud, udg_WindUnitGroup )
    endif
    set cloud = null
endfunction
now when we play the game in single player all is fine and it works, however when we try to play in on battle.net even the host has like 3 seconds delay. Anyone knows the problem and a good way of fixing it?
10-18-2004, 11:19 PM#2
-={tWiStÄr}=-
you mean a lag delay? cause that would be somewhere else.
10-18-2004, 11:22 PM#3
iNfraNe
nah, it isnt really lagging, its weird, I have never seen it before. Everything moves smoothly but it takes like 3 seconds from u clicking the mouse button and your worm reacting (and it isnt a bad host, cuz host himself has delay aswell)... And it is this trigger for sure, when I dont run this trigger, all delay is gone...
10-19-2004, 06:52 AM#4
logik
can you show the GUI equivalent - i cant be bothered sifting through jass
10-19-2004, 07:34 AM#5
Guest
Might it be the `too many units' bug? You might want to change the wind units to being wind doodads, if it is possible... the more units you have, the longer it takes from them to react to a move order. Other abilities are not affected, tho, which is how you can tell that this is the culprit.
10-19-2004, 07:41 AM#6
-={tWiStÄr}=-
try making the polled wait 2.99 instead. you kind of end and start it at the exact same time. may do wierd stuff. but ya too many units is a good idea too.
10-19-2004, 11:21 AM#7
iNfraNe
Iguess destructibles would work, gonna give it a try...
10-19-2004, 12:04 PM#8
iNfraNe
hmm, making it destructibles makes it really "lag", because you cant instantly move a destructible... any other ideas?
10-19-2004, 07:19 PM#9
Guest
Does it still lag if you reduce the number of wind units?

What is the purpose of moving them around? You might be able to just hide/unhide them if you don't need too many. Or create then destroy them. Or even... could you make them into an SFX? o.0

Did you say the wind units have a custom model?
10-19-2004, 08:09 PM#10
iNfraNe
Quote:
Originally Posted by misaki
Does it still lag if you reduce the number of wind units?

What is the purpose of moving them around? You might be able to just hide/unhide them if you don't need too many. Or create then destroy them. Or even... could you make them into an SFX? o.0

Did you say the wind units have a custom model?
once again, thx for your suggestions. It cant be SFX cuz it needs a direction, it needs to move around cuz ... its nicer :P. Anyway, I got it to work, I found out that calling a polledwait isnt such a great idea on a periodic event of 0.03 seconds. I make it so that if the units custom value is over 100 then it moves again. (I count 1+ each periodic event.)