Spell Burning Steps

Steel

Software Engineer
Reaction score
109
JASS:
call TimerStart(caller,redo,true,function BurningSteps) // We start timer that will run every "redo" time and will call BurningSteps function.
  call TriggerSleepAction(Wait) // We wait "Wait" time which was defined earilier.
  
  call FlushHandleLocals(caller) // We destroy the linkage between caster and timer
  call DestroyTimer(caller)

This bit of code is well...bad. It's a very common thing among new JASSers. You shouldn't need to have to call a wait after a timer, its completely unnecessary especially in this situation. Just a minor note, TriggerSleepAction is the most inaccurate way to track time. Timer > Polled Wait > Sleep Action.

Anyway to the point, you should have a destructor (Yes this is JASS, but its the same thing) inside your timer that will clean up the trigger for you when you are finished using it, you shouldn't have to create a wait.

Hope that helps.
 
I

IKilledKEnny

Guest
I will look into that, however I did work well, at 5,10 and 15 seconds it stopped, like I wanted it, I will change it to polled wait.

> Anyway to the point, you should have a destructor

That's sounds interesting, any chance you could post / private massage me information about this?
 

Sim

Forum Administrator
Staff member
Reaction score
534
I still think the fire needs to damage longer. As it is right now, it does almost nothing. Units step on it and take no damage, unless they step on it within 2 seconds after it has been created. Looks really weird, almost as if it was a bug.

I can't approve it right now because of that.

Also, here's an example of destructor (if it's what he means):

Code:
function YOUR_SPELL_Loop takes nothing returns nothing
    local timer t = GetExpiredTimer()
    local unit caster = GetHandleUnit(t, "caster")
    local integer destructor = GetHandleInt(t, "destructor")

    if destructor == *whatever integer (number of repetitions)* then
         call PauseTimer(t)
         call FlushHandleLocals(t)
         set caster = null
         call DestroyTimer(t)
         set t = null
    endif
// ACTIONS
    SetHandleInt(t, "destructor", destructor + 1)
endfunction

function YOUR_SPELL_Actions tkaes nothing returns nothing
local unit caster = GetTriggerUnit()
local timer t = CreateTimer()

SetHandleHandle(t, "caster", caster)
call StartTimer(t, 0.05, true, function YOUR_SPELL_Loop)
set caster = null
set t = null
endfunction

Should look like this. You null everything inside the timer function.
 

Steel

Software Engineer
Reaction score
109
Yea a destructor is a programming feature that returns memory that was allocated by your program. In the JASS sense it cleans up your trigger for you. And Dax you got it exactly right what I was conveying.
 
I

IKilledKEnny

Guest
Ok, that what I thought it ment, thanks Daxtreme (and steel). In my case it will be a little trickier becuase the timer time might change (redo varies from hero to hero becuase speed changes) but I will manage.

As for the fire life time, I will make it longer, and also increase the damage, but the point of the spell is to get units / creeps running on the trail, that way they could get massive damage.

Thanks for comments, I hope by tommorow or at the end of the weekend at the very worst I could get it right.
 

Sim

Forum Administrator
Staff member
Reaction score
534
> but the point of the spell is to get units / creeps running on the trail, that way they could get massive damage.

I attacked a random spider, made sure it followed me perfectly (on the trail), and it lost about 14 hp :p

Actually, I think that hp lost was due to my attack, not the fact it was walking in the fire...
 

Pyrogasm

There are some who would use any excuse to ban me.
Reaction score
134
Woah. Since when are there [noparse]
JASS:
[/noparse] tags here?

Also, you should pause your timer before detstroying it.
 

Pyrogasm

There are some who would use any excuse to ban me.
Reaction score
134
Vexorian said:
In special cases, a timer can continue running after DestroyTimer() is called. To fix this, simply pause the timer before it is destroyed/
Indeed; it is much safer.
 
I

IKilledKEnny

Guest
Thanks Lors.

Still waiting for it to be approved, or so I could get feedback about the spell.
 

Sim

Forum Administrator
Staff member
Reaction score
534
Approved, but some of the configuration functions aren't constants, fix that.

EDIT: Add some things in your test map also, such as reviving the hero, press ESC to regen hp & mana...
 
I

IKilledKEnny

Guest
Ok I will fix it tommorow, thanks for approving it.

Edit: Ok I have done what you asked and much more. Now flames will be removed after 4 / 5 / 6 seconds instead of 4 / 4 / 4 seconds. Also improved description and READ ME (posted it as well for all intrested), improved a little terrain, did whatever can be constant a constant and finally add "level", "creeps", "revive" and "heal" commands to the template.
 

hawky287

New Member
Reaction score
0
excuse but i was wondering if it is easy to implement this into GUI?
i was thinking of making a trigger which makes the burning trail that illidan creates actually take damage and set the ability as a passive
i tried starting it but im a l ittle stuck

Burning Trail
Events
Unit - Illidan 0000 <gen> Acquires a target
Unit - Illidan 0000 <gen> Is issued an order with no target
Unit - Illidan 0000 <gen> Is issued an order targeting a point
Unit - Illidan 0000 <gen> Is issued an order targeting an object
Conditions
(Issued order) Equal to (Order(move))
(Level of Burning Trail for (Triggering unit)) Not equal to 0
Actions
Unit - Create 1 Dummy for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing 0.00 degrees

i would appreciate it if anyone could help?
tyty in advanced
 

hawky287

New Member
Reaction score
0
damn xD
using the illidan model
i was thinking of naming it frozen trail
"the trail has gone cold for those who seek me" <heroname>
the trail that <heroname> leave behind slows and does damage
=(
oh wellz
ill just probaly give up lolz
EDIT: my world editor skills need buffing ==" the ice demon's triggers were too good
i wouldnt stand i chance xD
 

Cohadar

master of fugue
Reaction score
209
This spell has a bug:
JASS:

  if NewMana &gt; 0 then // We check if the caster&#039;s new mana is more then 0 if it is then (else we do nothing):
    set FlameDummy=CreateUnit(owner,BurningStepsDummyId(),casterX,casterY,0) // This creates a flame for owner in the caster&#039;s location.
    call SetUnitState(caster,UNIT_STATE_MANA, NewMana) // This set&#039;s the caster&#039;s mana to NewMana
    call UnitAddAbility(FlameDummy,BurningStepsImmolationId()) // We add immolation to the flame
    call SetUnitAbilityLevel(FlameDummy,BurningStepsImmolationId(),AbilityLevel) // We set immolation&#039;s level to the burning step&#039;s level for the caster.
    call UnitApplyTimedLife(FlameDummy,&#039;BTLF&#039;,BurningStepsDummyTime()) // We add timed life to the flame so it will not live forever.   
  endif


should be:
JASS:

  if NewMana &gt; 0 then // We check if the caster&#039;s new mana is more then 0 if it is then (else we do nothing):
    set FlameDummy=CreateUnit(owner,BurningStepsDummyId(),casterX,casterY,0) // This creates a flame for owner in the caster&#039;s location.
    call SetUnitState(caster,UNIT_STATE_MANA, NewMana) // This set&#039;s the caster&#039;s mana to NewMana
    call UnitAddAbility(FlameDummy,BurningStepsImmolationId()) // We add immolation to the flame
    call SetUnitAbilityLevel(FlameDummy,BurningStepsImmolationId(),AbilityLevel) // We set immolation&#039;s level to the burning step&#039;s level for the caster.
    //---- this fixes a bug with leveling a perma immolation
    call SetPlayerAbilityAvailable(owner, BurningStepsImmolationId(), false)
    call SetPlayerAbilityAvailable(owner, BurningStepsImmolationId(), true)
    //----
    call UnitApplyTimedLife(FlameDummy,&#039;BTLF&#039;,BurningStepsDummyTime()) // We add timed life to the flame so it will not live forever.   
  endif


Another spell with this problem. <-------<<
 

AdamGriffith

You can change this now in User CP.
Reaction score
69
Looks cool :)
I shall test it later!

Slightly off topic:
Nice infinite loop with your links in your posts Cohadar :p
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top