Warcraft III resources & community, 2003–2006 · archived

Help (Displayable Countdown timer) (preferably in JASS)

9 posts
#1

Help (Displayable Countdown timer) (preferably in JASS)

Can anybody help or teach me how to make a displayable countdown timer for bombs or anything? I can make one, but the countdown gets messed up whenever i put up the second bomb with the timer. Please anyone...
#2
I suggest you read my tutorial to find out how to work with tutorials if you don't know JASS. If you do, everytime you place a bomb you will have a floating text (stored into a local) which changes every second. After it expires you remove it and make the bomb fuse.

~Daelin
#3

I know JASS (see my blink strike spell)

I know JASS, it is the loops problem, the memory is not leaking as both things happen at the same time, (what i am talking about is the messed up time show, try making one and you will see what i mean) This is what i did

function Trig_Poison_Bomb_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'oeye' ) ) then
return false
endif
return true
endfunction

function Trig_Poison_Bomb_Actions takes nothing returns nothing
set udg_i = 60
loop
exitwhen ( udg_i == 0 ) or (IsUnitDeadBJ(GetTriggerUnit()) == true )
set udg_i = udg_i - 1
call DestroyTextTagBJ( udg_Timers[GetUnitUserData(GetTriggerUnit())] )
call CreateTextTagLocBJ( I2S(( udg_i )), OffsetLocation(GetUnitLoc(GetTriggerUnit()), -32.00, 0), 32.00, 10, 100, 100, 100, 0 )
set udg_Timers[GetUnitUserData(GetTriggerUnit())] = GetLastCreatedTextTag()
call TriggerSleepAction( 1.00 )

endloop
call DestroyTextTagBJ( udg_Timers[GetUnitUserData(GetTriggerUnit())] )
call CreateNUnitsAtLoc( 1, 'hfoo', GetOwningPlayer(GetTriggerUnit()), GetUnitLoc(GetTriggerUnit()), bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 300.00, 'BTLF', GetLastCreatedUnit() )
call IssuePointOrderLocBJ( GetLastCreatedUnit(), "deathanddecay", GetUnitLoc(GetTriggerUnit()) )
call ExplodeUnitBJ( GetTriggerUnit() )

endfunction

//===========================================================================
function InitTrig_Poison_Bomb takes nothing returns nothing
set gg_trg_Poison_Bomb = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Poison_Bomb, GetPlayableMapRect() )
call TriggerAddCondition( gg_trg_Poison_Bomb, Condition( function Trig_Poison_Bomb_Conditions ) )
call TriggerAddAction( gg_trg_Poison_Bomb, function Trig_Poison_Bomb_Actions )
endfunction
#4
Don't you take me with texts like "I know JASS" when I can obviously see that what you've done here was just a conversion from GUI to JASS. You even left the globals (and so, you practically didn't change a thing int he script). I really suggest you have a look into my tutorial since what you used were globals, and with globals you obviously can't obtain multi-instanceability. And if you know JASS but you simply didn't use locals, then you really can't make efficient JASS. Learn to use locals!

~Daelin
#5
HaHa... I just started JASS... And want to learn more about it... Sorry for the comment btw... Where can I find your tutorial?
#6
Look into the thread about with the name Spells - Frequently Asked Question. There you will find something like "What is Jass and how can I learn it" and there you will get as an answer a link. Good luck!

~Daelin
#7
Thanx for the tutorial!! I have created one that is multi instancable!!
#8
Anytime... So if the tutorial was clear enough, do you think its time to add handlers part to it as well? Cuz if there are some problems, point them out into the tutorial's thread.

~Daelin
#9
yeah please, i cant understand Many Vex spells cause i dont know handlers. It would be a very gd and fine addition to the JASS tutorial. Thanx