[JASS] Problem

Status
Not open for further replies.
Level 8
Joined
Jul 28, 2008
Messages
211
Im still learning JASS and the best way to learn is to try and make something.
I came up with this:

JASS:
globals
      unit cast
      unit targ
      real per = 0.5
      real tim = 15.
      real dam = 8
endglobals
//=========================================================================

function Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'qwer'
endfunction
function Trig_Spell_Actions takes nothing returns nothing
    set cast = GetSpellAbilityUnit()
    set targ = GetSpellTargetUnit()
    call DoT( targ, cast, per, tim, dam )
endfunction

//===========================================================================
function InitTrig_Spell takes nothing returns nothing
    local trigger t = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( t, Condition ( function Conditions ) )
    call TriggerAddAction( t, function Trig_Spell_Actions )
endfunction


JASS:
function DoT takes unit target, unit caster, real period, real time, real dmg returns nothing
    local real t = time
    local real p = 0.
    loop
        exitwhen t == p
        call UnitDamageTarget( caster, target, dmg, false, true, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS )
        call TriggerSleepAction(period)
        set p = p + period
    endloop
endfunction

Basicly, its a user defined function. But, it doesn't work. When i try to start the map, nothing happens. It just won't start.

Whats the problem?

Thx! :wink:
 

Attachments

  • asddsa.w3x
    15.8 KB · Views: 45
Level 6
Joined
Jun 4, 2009
Messages
91
do you have JNGP ? I watched your script, and I don't saw those globals !

Didn't world edit told any error while saving ?


//***************************************************************************
//*
//* Global Variables
//*
//***************************************************************************

globals
// Generated
trigger gg_trg_Functions = null
trigger gg_trg_Spell = null
endglobals
 
Level 6
Joined
Jun 4, 2009
Messages
91
Do you have enabled jass helper ? because the script is generated, but not parsed. There are two globals/endglobals blocs (generated, and you) wich are usually put in a same one by jasshelper. WC3 isn't able to support more than 1 globals/endglobals bloc.
 
Status
Not open for further replies.
Top