• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[JASS] this skill is causing the game to crash for everyone...sometimes, any reason?

Status
Not open for further replies.
Level 5
Joined
Nov 14, 2007
Messages
161
so basically i have a skill based off shockwave but i wanted the effect to be a huge missle so i created dummy unit with a model of a bullet and scaled it up greatly and knocked it back according to how i want it. now my code looks like this:

JASS:
function Trig_Cannon_Fire_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A02H'
endfunction

function Trig_Cannon_Fire_Actions takes nothing returns nothing
    local unit u = GetTriggerUnit()
    local unit dummy
    local location uloc = GetUnitLoc(u)
    local location targetloc = GetSpellTargetLoc()
    local real angle = AngleBetweenPoints(uloc, targetloc)
    local player p = GetOwningPlayer(u)    //i just relized i dont use this, so i took it out just now but would this have been the problem?
    local real distance = GetUnitAbilityLevel(u, 'A02H') * 100 + 800 
    
    set dummy = CreateUnitAtLoc(GetOwningPlayer(u), 'h008', uloc, angle)
    call UnitApplyTimedLife(dummy, 'BTLG', distance/500)
    call Knockback.create(dummy, angle * bj_DEGTORAD, 500, distance )
    
    call RemoveLocation(uloc)
    call RemoveLocation(targetloc)
    set uloc = null
    set targetloc = null
    set u = null
    set dummy = null
endfunction

//===========================================================================
function InitTrig_Cannon_Fire takes nothing returns nothing
    set gg_trg_Cannon_Fire = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Cannon_Fire, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Cannon_Fire, Condition( function Trig_Cannon_Fire_Conditions ) )
    call TriggerAddAction( gg_trg_Cannon_Fire, function Trig_Cannon_Fire_Actions )
endfunction

anything wrong with it because randomly it causes the game to crash. thanks for viewing.
YO_MA_MA

EDIT: it only seems to have problems with multiplayer
EDIT2: i just thought of an idea that maybe i should pre-load the unit... testing it preloaded atm
 
Level 5
Joined
Nov 14, 2007
Messages
161
alright, well i changed that, but the guy i was testing with had to go, tomorrow or tuesday i should be able to test again. if u or anyone else spots something. let me know. thanks!
 
Status
Not open for further replies.
Top