HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

sight radius bug?

10-22-2008, 11:09 AM#1
waaaks
i made a hero with 2 spells, i dont know which one causes the bug, but when i casted either the 2 spells, the sight radius of my hero became smaller (800) even though my hero's sight radius on day and night is 1200, my hero has no ultravision ability or something like that

the 2 codes
Collapse JASS:
scope BindingBlades initializer init

private function setupDamageOptions takes xedamage d returns nothing
    set d.dtype = DAMAGE_TYPE_UNIVERSAL
    set d.atype = ATTACK_TYPE_NORMAL
    set d.damageTrees = true
endfunction

globals
    private constant integer spell = 'A001'
    private constant string sfx = "Abilities\\Weapons\\GlaiveMissile\\GlaiveMissile.mdl"
    private constant string spawn = "Abilities\\Spells\\Orc\\MirrorImage\\MirrorImageCaster.mdl"
    private xedamage damageOptions
endglobals

private struct Bind extends xecollider
    unit cast
    unit targ
    integer level
    
     method onUnitHit takes unit hitunit returns nothing
        local real x = GetUnitX(hitunit)
        local real y = GetUnitY(hitunit)
        if damageOptions.allowedTarget(this.cast, hitunit) then
            call this.flash(spawn)
            call SetUnitX(this.cast, x)
            call SetUnitY(this.cast, y)
            call damageOptions.damageTarget(this.cast, hitunit, this.level * 75)
            call this.terminate()
        endif
    endmethod
    
    method loopControl takes nothing returns nothing
        if GetWidgetLife(this.targ) < 0.405 then
            call this.terminate()
        endif
    endmethod
    
endstruct

private function Conditions takes nothing returns boolean
    return GetSpellAbilityId() == spell
endfunction

private function Actions takes nothing returns nothing
    local unit cast = GetTriggerUnit()
    local unit targ = GetSpellTargetUnit()
    local real a = Atan2(GetUnitY(targ) - GetUnitY(cast), GetUnitX(targ) - GetUnitX(cast))
    local Bind xe = Bind.create(GetUnitX(cast), GetUnitY(cast), a)
    set xe.fxpath = sfx
    set xe.speed = 350
    set xe.minSpeed = 350
    set xe.maxSpeed = 1200
    set xe.acceleration = 200
    set xe.z = 50
    set xe.angleSpeed = 3
    set xe.targetUnit = targ
    set xe.expirationTime = 14
    set xe.collisionSize = 125
    
    
    set xe.cast = cast
    set xe.targ = targ
    set xe.level = GetUnitAbilityLevel(cast, spell)
    set cast = null
    set targ = null
endfunction

//===========================================================================
private function init takes nothing returns nothing
    local trigger t = CreateTrigger(  )
    set damageOptions = xedamage.create()
    call setupDamageOptions(damageOptions)
    call XE_PreloadAbility(spell)
    call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( t, Condition( function Conditions ) )
    call TriggerAddAction( t, function Actions )
endfunction

endscope



Collapse JASS:
scope MassiveDarts initializer init

globals
    private constant integer spell = 'A002'
    private constant integer dspell = 'A003'
endglobals

private function Conditions takes nothing returns boolean
    return GetSpellAbilityId() == spell
endfunction

private function Actions takes nothing returns nothing
    local xecast xe
    local unit cast = GetTriggerUnit()
    local real x = GetUnitX(cast)
    local real y = GetUnitY(cast)
    local integer i = 0
    local integer l = GetUnitAbilityLevel(cast, spell)
    local real px
    local real py
    local real dis = 57.29582 * 60
    loop
        exitwhen i == 8
        set px = x + 50 * Cos(dis*i)
        set py = y + 50 * Sin(dis*i)
        set xe = xecast.createBasicA(dspell, OrderId("carrionswarm"), GetOwningPlayer(cast))
        set xe.level = l
        set xe.recycledelay = 3.0
        set xe.customsource = true
        set xe.sourcex = x
        set xe.sourcey = y
        set xe.sourcez = 50
        call xe.castOnPoint(px, py)
        set i = i + 1
    endloop
    set cast = null
endfunction

//===========================================================================
private function init takes nothing returns nothing
    local trigger t = CreateTrigger(  )
    call XE_PreloadAbility(spell)
    call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( t, Condition( function Conditions ) )
    call TriggerAddAction( t, function Actions )
endfunction

endscope
10-23-2008, 09:40 PM#2
Naakaloh
What base abilities do you use for them?
10-24-2008, 12:53 AM#3
waaaks
chain lightning and fan of knives
10-24-2008, 05:56 AM#4
DioD
there is no way to detect sight range...

how you got this values?
10-24-2008, 06:14 AM#5
cleeezzz
this happens to me too, it just happens randomly for me, the sight range just drops to barely anything and completely ruins gameplay