• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Missile System Problem

Status
Not open for further replies.
Level 20
Joined
May 16, 2012
Messages
635
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 20
Joined
May 16, 2012
Messages
635
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