• 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.
  • It's time for the first HD Modeling Contest of 2025. Join the theme discussion for Hive's HD Modeling Contest #7! Click here to post your idea!

Missile System Problem

Status
Not open for further replies.
Level 21
Joined
May 16, 2012
Messages
640
Hi Hivers. Today i tried to implement [vJASS] - Missile by BPower in my map, but first i tried to create a little test code to see if it would work the way i thought it would, but the arcing of the missile is not working, and i dont know why. Some insight?

JASS:
scope MTest initializer Init

private struct Fireball extends array
  
        private static method onCollide takes Missile missile, unit hit returns boolean
            if UnitAlive(hit) and hit == missile.target then
                return UnitDamageTarget(missile.source, hit, missile.damage, false, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_DIVINE, null)
            endif
            return false
        endmethod
       
        implement MissileStruct
endstruct

private function Actions takes nothing returns nothing
    local unit caster = GetTriggerUnit()
    local unit target = GetSpellTargetUnit()
    local real x = GetUnitX(caster)
    local real y = GetUnitY(caster)
    local Missile missile = Missile.createXYZ(x, y, 50., GetUnitX(target), GetUnitY(target), 50.)
   
    set missile.source = caster
    set missile.target = target
    set missile.owner = GetOwningPlayer(caster)
    set missile.speed = 30
    set missile.arc = 15*bj_DEGTORAD
    set missile.damage = 100
    set missile.model = "Abilities\\Weapons\\FireBallMissile\\FireBallMissile.mdl"
    set missile.collision = 32.
    call Fireball.launch(missile)// Launches for struct Fireball.
endfunction

private function Conditions takes nothing returns boolean
    if (GetSpellAbilityId() == 'A002') then
        call Actions()
    endif
    return false
endfunction
//===========================================================================
private function Init takes nothing returns nothing
    set gg_trg_MTest = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(gg_trg_MTest, EVENT_PLAYER_UNIT_SPELL_EFFECT)
    call TriggerAddCondition(gg_trg_MTest, Condition(function Conditions))
endfunction

endscope

1.png

As you can see in the picture, the missile do not arc. How to make it work?
 
Level 21
Joined
May 16, 2012
Messages
640
Afaik, the Bpower's missile system not makes and Arc on homing missiles.
Test the arc with a missile that targets a point.

i Tried doing a leap with my unit with point target channel and still no arc. the unit just hover to the targeted point.

JASS:
scope MTest initializer Init

private struct Fireball extends array
  
        private static method onCollide takes Missile missile, unit hit returns boolean
            if UnitAlive(hit) then
                return UnitDamageTarget(missile.source, hit, missile.damage, false, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_DIVINE, null)
            endif
            return false
        endmethod
       
        implement MissileStruct
endstruct

private function Actions takes nothing returns nothing
    local unit caster = GetTriggerUnit()
    //local unit target = GetSpellTargetUnit()
    local real x = GetUnitX(caster)
    local real y = GetUnitY(caster)
    local Missile missile = Missile.createEx(caster, GetSpellTargetX(), GetSpellTargetY(), 50.)
   
    set missile.source = caster
    //set missile.target = target
    set missile.owner = GetOwningPlayer(caster)
    set missile.speed = 10
    set missile.arc = 45*bj_DEGTORAD
    set missile.damage = 100
    set missile.model = ""
    set missile.collision = 32.
    call Fireball.launch(missile)
endfunction

private function Conditions takes nothing returns boolean
    if (GetSpellAbilityId() == 'A002') then
        call Actions()
    endif
    return false
endfunction
//===========================================================================
private function Init takes nothing returns nothing
    set gg_trg_MTest = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(gg_trg_MTest, EVENT_PLAYER_UNIT_SPELL_EFFECT)
    call TriggerAddCondition(gg_trg_MTest, Condition(function Conditions))
endfunction

endscope
 
Status
Not open for further replies.
Top