| 08-21-2007, 07:19 PM | #1 |
I'm still trying to learn all the JASS commands. I've made a loop that will create a circle of a special effect. JASS:function Trig_Ring_of_Blood_Begin_Actions takes nothing returns nothing local real centerX = udg_RingofBloodCenterX local real centerY = udg_RingofBloodCenterY local integer i = 0 local real angle local real newlength if udg_RingofBloodTempCount > 20 then call DisableTrigger(GetTriggeringTrigger()) endif loop exitwhen i > 36 set angle = (i*10) set newlength = (udg_RingofBloodTempCount*25) // focus on this part, the rest works fine call DestroyEffect(udg_RingofBloodSE[i]) call AddSpecialEffect( "Abilities\\Spells\\Orc\\TrollBerserk\\HeadhunterWEAPONSLeft.mdl", NewPositionX(newlength, angle, centerX), NewPositionY(newlength, angle, centerY)) set udg_RingofBloodSE[i] = GetLastCreatedEffectBJ() set i = i +1 endloop set udg_RingofBloodTempCount = udg_RingofBloodTempCount+1 endfunction This is in a periodic event trigger. Everything works fine, except the DestroyEffect() command won't destroy. I'm sure its because GetLastCreatedEffectBJ() doesn't store the special effect from AddSpecialEffect(). I intentionally put the destroy effect before the creation because when the trigger ends, I want the special effects to remain. Thanks ahead of time. |
| 08-21-2007, 07:22 PM | #2 |
Um you have to destroy it after you use it... you cant do it before... Set a timer if you want the effect to stay |
| 08-21-2007, 07:24 PM | #3 |
GetLastCreatedEffectBJ() only returns the last created effect if you used a BJ function to create the effect. Look at the BJ SFX creating function: JASS:function AddSpecialEffectLocBJ takes location where, string modelName returns effect set bj_lastCreatedEffect = AddSpecialEffectLoc(modelName, where) return bj_lastCreatedEffect endfunction And at GetLastCreatedEffectBJ(): JASS:function GetLastCreatedEffectBJ takes nothing returns effect return bj_lastCreatedEffect endfunction You should just directly store the effect to your variable when you create it, rather than using GetLastCreatedEffectBJ(). Like this: JASS:set udg_RingofBloodSE[i] = AddSpecialEffect( "Abilities\\Spells\\Orc\\TrollBerserk\\HeadhunterWEAPONSLeft.mdl", NewPositionX(newlength, angle, centerX), NewPositionY(newlength, angle, centerY)) Botanic, he's destroying the effect from the previous time the trigger ran, then creating a new one. |
| 08-21-2007, 07:26 PM | #4 |
JASS:native AddSpecialEffect takes string modelName, real x, real y returns effect Noticed that returns part? JASS:
set udg_RingofBloodSE[i] = AddSpecialEffect( "Abilities\\Spells\\Orc\\TrollBerserk\\HeadhunterWEAPONSLeft.mdl", NewPositionX(newlength, angle, centerX), NewPositionY(newlength, angle, centerY))EDIT: heh, speed is everything :D |
| 08-21-2007, 07:34 PM | #5 |
yes but there will be one left over at the end is what i ment :/ he needs to add a line to remove the final effect as well |
| 08-21-2007, 09:36 PM | #6 | |
@tainted: Thanks. I'm still trying to learn those lesser things about JASS. @botanic Quote:
This is just one part of a spell. I don't need to destroy the effects on the last run. |
| 08-21-2007, 10:41 PM | #7 |
ah ok just making shure I am not super JASS man so i help with what i can :P |
