| 03-29-2009, 01:25 AM | #1 |
Hi ! i have a little problem with a spell that should cast one chainlightning per unit in an area, the dummy unit cast only one chainlightning then die, if i oder him to cast a spell like polymorph it work and cast it to all unit in the area I use Caster System 15.2 JASS:function Furie_des_elements_Conditions takes nothing returns boolean return ( GetSpellAbilityId() == 'A04P' ) endfunction function Furie_des_elements_Actions takes nothing returns nothing local location loc =GetSpellTargetLoc() //The target location local unit u =GetTriggerUnit() local integer l local real area call PolledWait( 0.75 ) set l = GetUnitAbilityLevel( u,'A04P') set area = 200.0 + l*25.0 call CasterCastAbilityLevelAOELoc( GetOwningPlayer(u), 'A04Q', l ,"chainlightning", loc, area, false, true) call PolledWait( 1.20 ) call RemoveLocation(loc) set loc=null set u=null endfunction function InitTrig_Furie_des_elements takes nothing returns nothing set gg_trg_Furie_des_elements = CreateTrigger( ) call TriggerRegisterAnyUnitEventBJ( gg_trg_Furie_des_elements, EVENT_PLAYER_UNIT_SPELL_EFFECT ) call TriggerAddCondition( gg_trg_Furie_des_elements, Condition( function Furie_des_elements_Conditions ) ) call TriggerAddAction( gg_trg_Furie_des_elements, function Furie_des_elements_Actions ) endfunction A04P is a multilevel hero dummy target area spell A04Q is a multilevel unit chainlightning with 0 mana cost, 0 cooldown and 0 cast time spell Really don't know what to do ? =o |
| 03-29-2009, 07:55 AM | #2 |
My guess is that it has to do with caster recycle time. It means that the caster is "recycled" before it has finished all chain lightning casts. (I don't know how it works in CasterSystem, because I use XE.) The reason it only happen when it casts chain lightning is more strange. It could be an issue with animation time. Try changing the spell's animation data (the top field in the object editor). Some other tips: Use JASS:call OnAbilityEffect('A04P', "Furie_des_elements_Actions") instead of JASS:
call TriggerRegisterAnyUnitEventBJ( gg_trg_Furie_des_elements, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Furie_des_elements, Condition( function Furie_des_elements_Conditions ) )
It comes with CasterSystem, and it is very useful, especially if you have many triggered spells. Don't use locations, use coordinates instead. That way, you don't have to create and destroy the location, which makes the map slower, if done a lot. |
| 03-29-2009, 08:16 AM | #3 | |
Quote:
|
| 03-29-2009, 11:57 AM | #4 | |
I'll try to change the animation 'kay Edit : changing animation don't work Quote:
I don't know how use XE, i learned how use Caster System with samples that was given, but with XE there is only 2/3 samples =/ |
| 03-29-2009, 03:14 PM | #5 |
You can't use chainlightning on a unit if that unit currently has a chainlightning going, Use multiple dummies or code the lightning yourself. |
| 03-29-2009, 07:44 PM | #6 |
Yeah, just use multiple dummies if it doesn't work otherwise. Using CasterSystem is way outdated anyways. |
| 03-29-2009, 07:58 PM | #7 |
But don't know how to do it with XE and i don't know how to make a correct "chain thing " with scripts T_T I've seen somewhere a system that allow you to make scripts chain thing with a chainlightning that bounces 99 times as sample, but don't know where i've seen it =X |
| 03-29-2009, 10:18 PM | #8 |
Change the dummy unit's Cast Backswing time to 0 if it doesn't have it changed already. |
| 03-30-2009, 02:49 AM | #9 |
Zerzax, read the thread next time ~.~ |
| 03-30-2009, 06:33 AM | #10 | |
Quote:
/threadstealing |
| 03-30-2009, 03:02 PM | #11 |
No one know the chain lightning system i writed ? =X |
| 03-30-2009, 03:53 PM | #12 |
When one unit casts chain lightning, even with a 0 second cooldown, it will not be able to cast it again until the chain lightning finishes bouncing. To do what you want, you'd have to create one dummy for each unit you want to cast it on. |
| 03-30-2009, 03:57 PM | #13 |
Okay, how to do it with Caster System ? >_> |
| 03-30-2009, 04:22 PM | #14 |
First, I assume you know how to use GroupEnumUnitsInRange(), and a boolexpr. JASS:function Furie_des_elements_Conditions takes nothing returns boolean return ( GetSpellAbilityId() == 'A04P' ) endfunction function Furie_des_elements_Actions takes nothing returns nothing local unit temp = null local group g = CreateGroup() local location l = GetSpellTargetLoc() local real x = GetLocationX(loc) local real y = GetLocationY(loc) local unit u =GetTriggerUnit() local integer l local real area call PolledWait( 0.75 ) set l = GetUnitAbilityLevel( u,'A04P') set area = 200.0 + l*25.0 call GroupEnumUnitsInRange(g,x,y,area,Condition(function yourFilter) //Use your own boolexpr here loop set temp = FirstOfGroup(g) exitwhen temp == null call CasterCastAbilityLevelTargetSomething() //Whatever function that was call GroupRemoveUnit(g,temp) endloop call PolledWait( 1.20 ) call RemoveLocation(loc) set loc=null set u=null endfunction |
| 03-30-2009, 07:26 PM | #15 |
I found what was wrong ----------------------------------------------------------------- function Furie_des_elements_Conditions takes nothing returns boolean return ( GetSpellAbilityId() == 'A04P' ) endfunction function Furie_des_elements_Actions takes nothing returns nothing local location loc =GetSpellTargetLoc() local unit u =GetTriggerUnit() local integer l local real area call PolledWait( 0.75 ) set l = GetUnitAbilityLevel( u,'A04P') set area = 200.0 + l*25.0 call CasterSetRecycleDelay( 10.0 ) //Some time to let the dummy cast all chainlightnings call CasterCastAbilityLevelAOELoc( GetOwningPlayer(u), 'A04Q', l ,"chainlightning", loc, area, false, false) // the last thing should be false because it's not instant call RemoveLocation(loc) set loc=null set u=null endfunction function InitTrig_Furie_des_elements_old takes nothing returns nothing set gg_trg_Furie_des_elements_old = CreateTrigger( ) call OnAbilityEffect('A04P', "Furie_des_elements_Actions") call TriggerAddAction( gg_trg_Furie_des_elements_old, function Furie_des_elements_Actions ) endfunction ---------------------------------------------------------------------- Thanks all, and yeah i suck in JASS and in english =o Special thanks to Vexorian's " Thor's hammer " PS : Wtf boolexpr is ? |
