HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Venom Spike Spell Problem

04-23-2007, 02:28 PM#1
TGhost
The problem I have ran into is, that I have been trying to make this spell that should create a collision missile, using Vexorians caster system, at the position of the caster, then fly towards the target point and Pause+DMG the first unit it hits. The problem is that the missile does not spawn at all, and I can't seem to put my finger on whats wrong with it. Any help would be greatly appreciated:
Collapse JASS:
function Trig_Venom_Spike_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A002'
endfunction

function VenomSpikeImpact takes nothing returns nothing
    local unit target = GetTriggerUnit()
    local real dmg = GetAttachedReal(udg_AttachTimer, "Damage")
    call PauseUnit(target, true)
    call CollisionMissile_Destroy(GetTriggerCollisionMissile())
    call DamageUnit(GetOwningPlayer(GetTriggerCollisionMissile()), dmg, target)
    call PolledWait(2.0)
    call PauseUnit(target, false)
    set target = null
endfunction

function Trig_Venom_Spike_Actions takes nothing returns nothing
    local unit caster = GetTriggerUnit()
    local real casterX = GetUnitX(caster)
    local real casterY = GetUnitY(caster)
    local location casterLoc = GetUnitLoc(caster)
    local location targetLoc = GetSpellTargetLoc()
    local real angle = AngleBetweenPoints(casterLoc, targetLoc)
    local real dmg = GetUnitAbilityLevel(caster, 'A002')*100
    local unit missile = CollisionMissile_Create("Abilities\\Weapons\\PoisonArrow\\PoisonArrowMissile.mdl", casterX, casterY, angle, 750, 0, 1000, 50, false, 100, function VenomSpikeImpact)
    set caster = null
    call RemoveLocation(targetLoc)
    call RemoveLocation(casterLoc)
    set missile = null
endfunction

//===========================================================================
function InitTrig_Venom_Spike takes nothing returns nothing
    set gg_trg_Venom_Spike = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Venom_Spike, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Venom_Spike, Condition( function Trig_Venom_Spike_Conditions ) )
    call TriggerAddAction( gg_trg_Venom_Spike, function Trig_Venom_Spike_Actions )
    call Preload("Abilities\\Weapons\\PoisonArrow\\PoisonArrowMissile.mdl")
endfunction
04-23-2007, 04:04 PM#2
TheSecretArts
Try that this:
Collapse JASS:
call TriggerAddAction( gg_trg_Venom_Spike, function Trig_Venom_Spike_Actions )call TriggerAddCondition( gg_trg_Venom_Spike, Condition( function Trig_Venom_Spike_Conditions ) )
call Preload("Abilities\\Weapons\\PoisonArrow\\PoisonArrowMissile.mdl")
should become
Collapse JASS:
call Preload("Abilities\\Weapons\\PoisonArrow\\PoisonArrowMissile.mdl")
call TriggerAddAction( gg_trg_Venom_Spike, function Trig_Venom_Spike_Actions )

Im not exactly sure becase i havent learned how to use the Caster System yet. But if you think about it, preload should come BEFORE the action hence PREload
04-23-2007, 04:09 PM#3
TGhost
Uhm, you don't even put the conditions in that new thing or anything, can't really see how that thing would change anything, all it seems to change is remove the conditions and preload the model before actually adding the actions of the trigger. Don't think thats the problem, but I can test it when I get home .
04-23-2007, 07:31 PM#4
TheSecretArts
I also noticed that you set a local real dmg that you never use. It also looks like your trying to get an attached real that was never attached in the first place. I might just be jass inept but that is what I think ane WE syn checker wouldnt pick that up. DONT REMOVE CONDITIONS! I was telling you to switch Preload and TriggerAddAction.
04-23-2007, 07:59 PM#5
blu_da_noob
Are you sure the missile doesn't spawn (maybe you just can't see it)? Have you initialised and setup the caster system correctly?

Edit: btw he gets that damage that's attached to a global timer which I assume is set somewhere else
04-23-2007, 08:25 PM#6
TheSecretArts
i didnt see it so i thought best i asked.
04-24-2007, 12:25 PM#7
TGhost
Caster system should be set up correctly, atleast I think so. I can do a quick test to see if the missile spawns and I just can't see it.

Yeah, the real is getting attached to a global timer already set in the map.

EDIT: Ok, I'm done with the test now. It might seem that the problem is with the caster system, it is then most likely that I didn't set up the thing correctly, I will read through everything again and try to correct it.

EDIT2: I found out why it wasn't working, it was something with the caster system. It worked after I "reinstalled" the system. Thanks alot, didn't really think about it could possibly be the caster system .