| 09-26-2006, 03:16 AM | #1 |
I've had alot of problems with just one set of triggers. I fixed one trigger, but the other one I just don't know how to fix (nor do I see why it wouldn't work) JASS:function Trig_Flame_Stomp_Damage_Conditions takes nothing returns boolean if ( GetSpellAbilityId() == 'A004' ) then endif return true endfunction function Buff_Check takes nothing returns boolean return ( UnitHasBuffBJ(GetFilterUnit(), 'B001') == true ) endfunction function Damage takes nothing returns nothing local integer i = GetUnitAbilityLevel(GetTriggerUnit(), 'A004') local real r = i call UnitDamageTargetBJ( GetTriggerUnit(), GetEnumUnit(), ( 2.00 + ( r * 2 ) ), ATTACK_TYPE_NORMAL, DAMAGE_TYPE_UNKNOWN ) endfunction function Trig_Flame_Stomp_Damage_Actions takes nothing returns nothing local unit u = GetTriggerUnit() local group g = GetUnitsInRangeOfLocMatching(300.00, GetUnitLoc(u), Condition(function Buff_Check)) local timer t = CreateTimer() call TimerStart( t, 5.00, false, null ) loop exitwhen TimerGetRemaining(t) == 0 call ForGroupBJ( g, function Damage ) call PolledWait( 1.00 ) endloop call RemoveLocation(GetUnitLoc(u)) set u = null set g = null set t = null endfunction After a unit beings the effect of Flame Stomp (A004), this trigger kicks in, checking for every unit with the Flame Stomp buff (B001), and puts them in the group variable g. It then loops picking every unit in g and damaging them. What it does: nothing. I'm not too great at JASS, but I just can't seem to find out whats wrong here. |
| 09-26-2006, 04:10 AM | #2 |
In timer's actions event-responses from main function are all lost. The only reponse you can use is GetExpiredTimer(). Conclusion, you'll have to link to the timer the local variables you want to pass. Use Vexorian's CSCache. You also have a lot of leaks. group g leaks, location GetUnitLoc(u) is deleted wrongly. Doing something like this: JASS:CreateUnit(blah blah, GetUnitLoc(u)... blah blah) call RemoveLocation(GetUnitLoc(u)) The remove location is completely wrong. You just create a second location and destroy it. Atleast I think so, if I remember location behaviour correctly. Conclusion? Store the location into a variable, use it, and then remove it through the variable. Because the variable helps you keep the track of the location. Elsewhere it is lost! Stop using non-BJs uselessly. And optimize that condition function. :) ~Daelin |
| 09-26-2006, 04:46 AM | #3 | ||||
Quote:
Quote:
EDIT: How does Group g leak? Quote:
Quote:
Thanks for the help, but I'm atrocious at JASS (as you can see), and some of what you said made little/no sense to me. I'll fix the leaks, etc. but the timer problem I will probably need some help with. |
| 09-26-2006, 06:40 AM | #4 |
The code seems fine. You will laugh at this, but... Its the condition thats causing this to do nothing Look: JASS:function Trig_Flame_Stomp_Damage_Conditions takes nothing returns boolean if ( GetSpellAbilityId() == 'A004' ) then endif return true endfunction It should be: JASS:function Trig_Flame_Stomp_Damage_Conditions takes nothing returns boolean if ( GetSpellAbilityId() == 'A004' ) then return true endif return false endfunction EDIT: Or maybe you did that for testing... |
| 09-26-2006, 07:04 AM | #5 | |
Em, your formula does 4 damage at level 1. That's the problem. Your function can be optimized a lot. Like this.
|
| 09-26-2006, 10:23 AM | #6 |
My formula is supposed to deal 4 damage at level 1. I'm completely aware of the amount of damage dealt by the formula at every level. That's why I made it. Oh, and I just noticed something. Your code doesn't do the sme thing as mine. The timer was there for a reason. I had a loop that died when the timer hit zero. This trigger is supposed to damage a unit over time, once every second for 5 seconds. I'll still add what optimazations I can but... Your code wasn't entirely correct. Thanks still. @Tide Jesus was that all? I've been doing it the way I had it for everything and it seemed to work fine but... Ah well. I'll go fix it now. |
