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

Z axis for Relativistic missile

Level 8
Joined
Aug 5, 2014
Messages
194
Hello!

I tried to make a simple spell using: Relativistic Missiles [vJASS][LUA][GUI]
The idea is simple, missile fall directly from above the unit.
So Starting point and Finish point are the same. The only difference is that starting Z is, for example, 1000 and finish Z is obviously 0. But the system check finish condition only if it reached by X and Y axises, completely ignoring Z. And when missile appearing it immediately run MissileFinish event and explodes.
What parameters i need to use achive such simple effect?

Thank you in advance!
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,542
Not sure if there's an easier way but the first thought that comes to mind:
1) Set MissileFinish to be the position of the target offset by 0.01
2) Set MissileSpeed to 0 or some really low value (so it doesn't move) - You may need to adjust MissileCollision as well.
3) Set onPeriodic to be a trigger that constantly checks the Z axis of the missile. If the Z axis is <= your desired value, destroy the missile by setting MissileDestroy to True.
 
Level 8
Joined
Aug 5, 2014
Messages
194
Not sure if there's an easier way but the first thought that comes to mind:
1) Set MissileFinish to be the position of the target offset by 0.01
2) Set MissileSpeed to 0 or some really low value (so it doesn't move) - You may need to adjust MissileCollision as well.
3) Set onPeriodic to be a trigger that constantly checks the Z axis of the missile. If the Z axis is <= your desired value, destroy the missile by setting MissileDestroy to True.
Well i thought of manualy moving missile down, even ignoring system at all and make the spell completley by myself, as if im mimicing movement by myself, i doesnt need to use this system, as the the rest of the scripting is not a bug deal.

But anyway, thank you! I will try this, this solution is not hard, but sadly feels like a work around.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,542
Well i thought of manualy moving missile down, even ignoring system at all and make the spell completley by myself, as if im mimicing movement by myself, i doesnt need to use this system, as the the rest of the scripting is not a bug deal.

But anyway, thank you! I will try this, this solution is not hard, but sadly feels like a work around.
You know, the creator of the system probably won't mind if you ask them for help directly. Also, if you ask in the original thread then the answer will be archived for others that download the system.
 
Level 8
Joined
Aug 5, 2014
Messages
194
You know, the creator of the system probably won't mind if you ask them for help directly. Also, if you ask in the original thread then the answer will be archived for others that download the system.
Well i already did, and after a mounth and a half of fruitless waiting, i decided not to spam same question in the comments, which as i remember not welcomed here, and went elsewhere.

Regarding Chopinski, no offence to him, and i had the expirience to asking him another question in pm before, but it led to nothing.
 
Level 8
Joined
Aug 5, 2014
Messages
194
This system doesn't support the ability to do what you want, can get close as long as its 90% less speed and not targeted on self.

Sadly. Its ridiculous (i mean no offence) that such simple thing cant be done in such ultimate missile system.


Might as well just trigger it ourselves, it's actually a fairly easy one to do.

(I was too lazy to change the variable names in the demo map - copied from an older map)


Thank you, Uncle.

I will check your solution as soon as i can.
 
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,542
Sadly. Its ridiculous (i mean no offence) that such simple thing cant be done in such ultimate missile system.





Thank you, Uncle.

I will check your solution as soon as i can.
Well, to be fair what you want isn't really a Missile, more like what Starfall uses -> A special effect with a falling animation that is attached to the origin of the target. There's no homing behavior necessary since it doesn't chase it's target (it's attached) and it always reaches the target at the same exact time (after X seconds).

These systems are often designed in a way to be very efficient - and adding behavior that is outside of what's expected of a Missile could either be impossible without reworking the whole system and/or not worth the drop in performance. An extra niche feature that hurts the performance of every other feature would not be worth adding to most people.

That being said, there's always room for improvement and additions, but you can't expect the authors of these systems to dedicate their lives to Warcraft 3 mods (and sadly this game has been abandoned by Blizzard so it feels fruitless to even try). Each new patch could very well break everything again, it's quite a pain in the ass to deal with.

I'd say that this system does everything that a standard Warcraft 3 Missile can do and more, which is what you want out of it. It's main draw is the great performance it gets with many Missiles active at once (I think it's second to none at this?). The rare edge case, like we see here, can be done yourself with your own separate triggers. You could even turn what I made for you into it's own system since it's different enough.
 
Last edited:
Level 8
Joined
Aug 5, 2014
Messages
194
Well, i tried to implement it with missile system, because i needed missile behaviour in one moment: it should be not simple effect which does stuff when it lands on predesignated point, but always check what targets can possible get in its way, behaving like general missile, but moving in vertical direction.

Well at least this situation can be manageable with general system use, i mean to check Z axis in condition, before registering hit, without missile being destroyed anyway, because its reached a point, where Z ignoring is hardcoded.

Anyway, thanks a lot for a help, i will take in consideration everything you suggested, or straightforwardly use your solution.

Thank you all!

P.S: To not to feel pain in the ass from patches, you can stuck on fixed version, but, i think its hard on reforged, thats why im not in it.
 
Level 24
Joined
Jun 26, 2020
Messages
1,852
I tried this with that system (but with the Lua version) and worked fine to me, the missiles fall from above:

Lua:
local angle = 2 * math.pi * math.random()
local dist = RANGE * math.random()
local tx = x + dist * math.cos(angle)
local ty = y + dist * math.sin(angle)
-- Falls a rock
local rock = Missiles:create(tx, ty, 640., tx, ty, 0.)
rock.source = caster
rock.owner = owner
rock.damage = DAMAGE
rock:model("Abilities\\Weapons\\AncientProtectorMissile\\AncientProtectorMissile.mdl")
rock:speed(0.)
rock.collision = 0
rock.collideZ = true
-- Gravity
rock.onPeriod = function ()
    rock:speed(rock.Speed + 0.025)
end
rock.onFinish = function ()
    ForUnitsInRange(tx, ty, AREA, function (u)
        if IsUnitEnemy(u, owner) then
            Damage.apply(caster, u, DAMAGE, true, false, udg_Dark, DAMAGE_TYPE_DEMOLITION, WEAPON_TYPE_WHOKNOWS)
            -- Stun
            DummyCast(
                owner,
                GetUnitX(caster), GetUnitY(caster),
                STUN_SPELL,
                STUN_ORDER,
                2,
                CastType.TARGET,
                u
            )
        end
    end)
end
rock:launch()
 
Level 8
Joined
Aug 5, 2014
Messages
194
I tried this with that system (but with the Lua version) and worked fine to me, the missiles fall from above:

Lua:
local angle = 2 * math.pi * math.random()
local dist = RANGE * math.random()
local tx = x + dist * math.cos(angle)
local ty = y + dist * math.sin(angle)
-- Falls a rock
local rock = Missiles:create(tx, ty, 640., tx, ty, 0.)
rock.source = caster
rock.owner = owner
rock.damage = DAMAGE
rock:model("Abilities\\Weapons\\AncientProtectorMissile\\AncientProtectorMissile.mdl")
rock:speed(0.)
rock.collision = 0
rock.collideZ = true
-- Gravity
rock.onPeriod = function ()
    rock:speed(rock.Speed + 0.025)
end
rock.onFinish = function ()
    ForUnitsInRange(tx, ty, AREA, function (u)
        if IsUnitEnemy(u, owner) then
            Damage.apply(caster, u, DAMAGE, true, false, udg_Dark, DAMAGE_TYPE_DEMOLITION, WEAPON_TYPE_WHOKNOWS)
            -- Stun
            DummyCast(
                owner,
                GetUnitX(caster), GetUnitY(caster),
                STUN_SPELL,
                STUN_ORDER,
                2,
                CastType.TARGET,
                u
            )
        end
    end)
end
rock:launch()


As i can see there is important point "collideZ = true", so it means there is a option to consider Z axis when script check collide condition.

Maybe i missed something? It could be possible this feature exclusive to Lua? I must check this again.

Do i got purpose of this variable right?

P.S: Why are you using periodic function for simulating gravity acceleration? If my memory doesnt fail me, there is acceleration parameter for missile in this system. Just personal preference?
 
Level 24
Joined
Jun 26, 2020
Messages
1,852
As i can see there is important point "collideZ = true", so it means there is a option to consider Z axis when script check collide condition.

Maybe i missed something? It could be possible this feature exclusive to Lua? I must check this again.

Do i got purpose of this variable right?
I remembered that collideZ = true is for also considering the Z axis (mainly it is to consider Z positions of the widgets it collides), so I think that you are right.
P.S: Why are you using periodic function for simulating gravity acceleration? If my memory doesnt fail me, there is acceleration parameter for missile in this system. Just personal preference?
It was a personal preference yes, I ignored the acceleration variable lol.
 
Level 8
Joined
Aug 5, 2014
Messages
194
I remembered that collideZ = true is for also considering the Z axis (mainly it is to consider Z positions of the widgets it collides), so I think that you are right.

It was a personal preference yes, I ignored the acceleration variable lol.


Yes. It works exactly like this!
So its possible to achieve it using standard functions. I did found how in the first place as it wasn't demonstrated in demo and it was lost in the same named attributes to my eyes.
And i thought it would be very wrong if such simple thing would be impossible to achieve in such advanced system.
Thank you, you was very helpful. The problem is gone, but the awkwardness remains...
 
Top