noob mistake (i bet)

xenaris

New Member
Reaction score
2
hi again:D, Xenaris is making a charge spell (earlier mentioned search forums )
And im trying to do it in JASS (im a newb) and i get an error and i cant seem to fix it, help?<3:eek:
Code:
function Trig_Charge_Conditions takes nothing returns boolean
    if ( not ( GetSpellAbilityId() == 'A000' ) ) then
        return false
    endif
    return true
endfunction

function Trig_Charge_Actions takes nothing returns nothing
call UnitMoveToUnitAsProjectile(GetTriggerUnit(),0,GetEventTargetUnit(),0,0)
endfunction
function InitTrig_Charge takes nothing returns nothing
    local trigger gg_trg_Charge = CreateTrigger()
    //call TriggerRegister__(gg_trg_Charge, )
    call TriggerRegisterAnyUnitEventBJ(gg_trg_Charge,EVENT_PLAYER_UNIT_SPELL_EFFECT)
    call TriggerAddAction(gg_trg_Charge, function Trig_Charge_Actions)
endfunction
 

Viikuna

No Marlo no game.
Reaction score
265
In which line this error actually is?

JASS:
call UnitMoveToUnitAsProjectile(GetTriggerUnit(),0,GetEventTargetUnit(),0,0)
This is from Vexorians caster system right? Are sure you have this system? Are you sure you have right arguments?

Also you can optimize this:
JASS:
function Trig_Charge_Conditions takes nothing returns boolean
    if ( not ( GetSpellAbilityId() == &#039;A000&#039; ) ) then
        return false
    endif
    return true
endfunction


to this:
JASS:
function Trig_Charge_Conditions takes nothing returns boolean
  return GetSpellAbilityId() == &#039;A000&#039; 
endfunction


EDIT: and use Jass tags please.
 

Flare

Stops copies me!
Reaction score
662
1) Where are you getting the error, and what error is it?

2) Wtf is that UnitMoveToUnitAsProjectile function?

Also, you're not even adding the condition :rolleyes:
Add this line somewhere in your InitTrig
JASS:
call TriggerAddCondition (gg_trg_charge, Condition (function Trig_Charge_Conditions))


And why are you localizing gg_trg_Charge? Why not just do
JASS:
local trigger t = Create Trigger ()
//Then working with t instead of gg_trg_Charge
 

Kenny

Back for now.
Reaction score
202
Im not 100% sure whats wrong, because i dont have WE at the moment, but ill see what i can do...

JASS:
function Trig_Charge_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == &#039;A000&#039;
endfunction

function Trig_Charge_Actions takes nothing returns nothing
    call UnitMoveToUnitAsProjectile(GetTriggerUnit(),0,GetSpellTargetUnit(),0,0)
endfunction

function InitTrig_Charge takes nothing returns nothing
    local trigger trig = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(trig,EVENT_PLAYER_UNIT_SPELL_EFFECT)
    call TriggerAddCondition(trig,Condition(function Trig_Charge_Conditions))
    call TriggerAddAction(trig, function Trig_Charge_Actions)
endfunction


Im guessing that UnitMoveToUnitAsProjectile() is a custom function from caster system or something?

*EDIT*

Whoa where did all those replies come from.

Um yeah basically u were missing TriggerAddConditions() i think.
 

xenaris

New Member
Reaction score
2
i know what the problem is, i dont have vexorians caster system where can i get it? i tried to find it at google but with no succes
 

Kenny

Back for now.
Reaction score
202
Haha, so u just dont have the system. But then why isnt it picking up that the function doesn't exist?

You can find the caster system at www.wc3campaigns.net in the resources section (resources - code resources - systems).
 
Reaction score
456
Also, it's not 'GetEventTargetUnit()'. Use 'GetSpellTargetUnit()' instead.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top