| 09-23-2007, 03:20 AM | #1 |
ok ive got some collision missile to work with scopes, but this trigger don't.....i dont know why? still the missile dont launch JASS:scope Elune globals private constant integer spell = 'A00A' //Rawcode for spell private constant integer dspell = 'A00B' //Rawcode for dummy spell private constant string order = "thunderbolt" //order id of the dummy spell private constant string sfx = "Abilities\\Weapons\\MoonPriestessMissile\\MoonPriestessMissile.mdl" //missile effect private constant real collide = 125.0 //collision size of the missile private constant real speed = 600.0 //missile speed private constant real range = 2000.0 //missile max range private constant real fly = 50.0 //missile's flying height private constant real size = 3.0 //missile's scaling endglobals private struct elune unit ecast endstruct private function EluneImpact takes nothing returns nothing local unit targ = GetTriggerUnit() local unit m = GetTriggerCollisionMissile() local elune F = elune( CollisionMissile_GetTag(GetTriggerCollisionMissile() ) ) local location loc1 local location loc2 local integer l local integer level if (targ == null) then call F.destroy() return endif call SetUnitScale(m, size, size, size) set loc1 = GetUnitLoc(F.ecast) set loc2 = GetUnitLoc(targ) set l = GetRandomInt(1,4) set level = GetUnitAbilityLevel(F.ecast, spell) call CasterSetCastSourceLoc(loc2) call CasterSetRecycleDelay(3.00) if IsUnitEnemy(targ, GetOwningPlayer(F.ecast)) == true and IsUnitAliveBJ(targ) then call CollisionMissile_Destroy(m) call CasterCastAbilityLevel(GetOwningPlayer(F.ecast), dspell, l, "thunderbolt", targ, false) endif call RemoveLocation(loc1) call RemoveLocation(loc2) set loc1 = null set loc2 = null set targ = null endfunction private function EluneStart takes nothing returns nothing local unit cast = GetTriggerUnit() local elune F = elune.create() local location loc1 = GetUnitLoc(cast) local location loc2 = GetSpellTargetLoc() local real face = AngleBetweenPoints(loc1, loc2) local unit m set F.ecast = cast set m = CollisionMissile_CreateLoc(sfx, loc1, face, speed, 0, range, fly, false, collide, function EluneImpact) call CollisionMissile_SetTag(m, integer(F)) call RemoveLocation(loc1) call RemoveLocation(loc2) set loc1 = null set loc2 = null set cast = null set m = null endfunction //=========================================================================== public function InitTrig takes nothing returns nothing call OnAbilityEffect(spell, SCOPE_PRIVATE+"EluneStart") endfunction endscope for the sake of spamming threads around...ill just post this scope trigger that doesnt work also what i want here is to add the slow rot to the caster when it has the buff rot (immolation) and remove the ability if the rot buff is gone i created a trigger that when the rot is activated, then in the actions i created another trigger with the periodic timer event for 0.05...then it's actions gives the slow and remove the slow...but after i deactivate it, the slow ability doesnt remove i used scope for this trigger, so that i can make private globals JASS:scope Rot globals private constant integer SPELLID = 'A002' private constant integer SPELLID2 = 'A007' private constant integer BUFFID = 'B000' endglobals private struct RotData unit caster endstruct private function RotAdd takes nothing returns nothing local RotData D = RotData.create() set D.caster = GetTriggerUnit() if UnitHasBuffBJ(D.caster, BUFFID) == false then call UnitRemoveAbility(D.caster, SPELLID2) call D.destroy() endif endfunction private function RotActions takes nothing returns nothing local unit cast = GetTriggerUnit() local RotData D = RotData.create() local trigger trig = CreateTrigger() set D.caster = cast call UnitAddAbility(D.caster, SPELLID2) call TriggerRegisterTimerEventPeriodic( trig, 0.05 ) call TriggerAddAction( trig, function RotAdd ) endfunction //=========================================================================== public function InitTrig takes nothing returns nothing call OnAbilityEffect(SPELLID, SCOPE_PRIVATE+"RotActions") endfunction endscope and also for collision missiles with scopes, can anyone tell me on what to remember so that my trigger works? |
| 09-23-2007, 01:29 PM | #2 |
1. I don't know, wrong rawcode? wrong fx path? dummy model got unimported? Cause the collisionmissile call looks right. Just in case add a DebugMsg to InitTrig so you can check it is getting called. 2. Why do you keep creating a RotData in that RotAdd function? It doesn't make sense... Looks like you should be attaching things to the timer... My suggestion: JASS:scope Rot globals private constant integer SPELLID = 'A002' private constant integer SPELLID2 = 'A007' private constant integer BUFFID = 'B000' private unit array V private integer N=0 private timer T=null endglobals private function check takes nothing returns nothing local integer i=0 loop exitwhen (i==N) if (UnitHasBuffBJ(V[i],BUFFID)) then set i=i+1 else //no buff remove ability... call UnitRemoveAbility(V[i], SPELLID2) set N=N-1 set V[i]=V[N] endif endloop if (N==0) then call PauseTimer(T) endif endfunction private function RotActions takes nothing returns nothing local unit u=GetTriggerUnit() if (N==0) then call TimerStart(t,0.05, true, function check) endif // I THINK that this may fail anyways since buffs take some time to actually appear on the unit // after the spell is casted, if so add a call TriggerSleepAction(0.0) set V[N]=u set N=N+1 call UnitAddAbility(u, SPELLID2) set u=null endfunction //=========================================================================== public function InitTrig takes nothing returns nothing call OnAbilityEffect(SPELLID, SCOPE_PRIVATE+"RotActions") set T=CreateTimer() endfunction endscope Try to get used to correctly indent your code, it is a good habit that pays when you want to find a bug in your code. |
| 09-24-2007, 03:54 AM | #3 |
ok for the collision missile, ill just paste the map....because actually the map i used is my cs test map where all my cs spells are inside, also those missile spell thingy that u helped me...its weird because 2 of my collision missiles inside the map is working, while elunes arrow dont... ill try the rot trigger... thanks yeah and also for damaging projectile can i do this? JASS:function resize takes nothing returns nothing local unit cast = GetTriggerUnit() local unit targ = GetSpellTargetUnit() local integer dopt = 'SomeDamages' local unit m set m = DamagingProjectileLaunchAOE(cast, "SomeModels", 500.0, 0.15, GetUnitX(cast), GetUnitY(cast), 100, GetUnitX(targ), GetUnitY(targ), 500, 1000, false, dopt) call SetUnitScale(m, 2, 2, 2) set cast = null set targ = null endfunction just ignore some stuffs inside like some damages, and some models what i want here is to resize the unit, the projectile unit can this be done? also this question does caster system has a function, like projectile launch but when it reaches the destination, it will call another trigger? thanks in advance! |
| 09-24-2007, 10:06 PM | #4 |
The closest thing to it would be the one that kills the caster when the missile gets to the target. There is another way and it is to call the Lower level projectile launch function from another thread... This reminds me about how required XE actually is, perhaps I'll add properties next jasshelper version and finally make this thing... |
| 09-25-2007, 04:01 AM | #5 |
ok thanks |
