• 🏆 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!

Need help regarding a similar Heat Seeking Missile skill

Status
Not open for further replies.
Level 4
Joined
Aug 7, 2010
Messages
77
Hello people. I am not good at creating new skills using triggers and I need advices and step by step methods to create one.

Basically I want to create a rather similar skill that derives from Heat seeking missile(yes its tinker's skill in Dota) and I will explain what it does.

Once its being activated, 3 missiles will launch from the casters (I will name them as m1, m2 and m3) and strike for magic damages to closeby enemy units (note that m1, m2 and m3 can hit similar targets like all 3 of them hitting on one closest enemy). This skill is instant means no target is required. When either m1, m2 or m 3 is dead(exploded and successfully dealed damage to enemy), each will respawn at a 40% chance at the position of the caster and will seek for the nearby enemy once again. This loop continue until the missile did not meet the 40% chance of respawning.

I will give an example and the flow
1) Skill casted
2) m1, m2, m3 created
3) m1, m2 and m3 will seek for random enemy to land its hit (could be nearest enemies).
4) m1 decided to target enemy1, both m2 and m3 decided to target enemy2
5) m1,m2,m3 successfully hit.
6) m1 did not meet the 40% chance, so its dead. m2 and m3 meet the 40% and they respawned at the position of the caster.
7) m2 and m3 will do the same for step 3 to step 6 until both m2 and m3 did not manage to respawn.

Sorry for my poor English if you do not understand certain parts of my sentence. Lastly any form of help will be greatly appreciated. Thanks in advance!
 
Level 16
Joined
Dec 15, 2011
Messages
1,423
I will attempt to give a simple outline of how I would do it. Please note that I won't write any GUI triggers since I don't know any GUI =/ (actually it is because I am lazy ^^)

First off, I hope you are familiar with dummy projectiles and periodic movement since this spell definitely will be needing them.

  1. Spell cast: You create the 3 missiles. To save computation effort, you will be checking if there is any valid unit in the vicinity. If you can't find any, destroy the missiles immediately and end the spell. Else, add the missiles to a group (from now on it will be referred to as missile group), attach the required data to each missile and turn on the periodic trigger.
  2. Now in the periodic trigger, you will be moving the the missiles in the group to their target(s). When impact happens, you check if the random number generator yield you the 40% chance you needed. If yes, create a new missile, attach the data and add it to the missile group I mentioned above.
  3. When no unit remains or no missile is left, you clean up data, turn off the periodic trigger and end the spell. Otherwise, step 2 will take care of it.

What I outlined above seems iffy MUI-wise so if you need a MUI spell, consult the Tutorials section and apply the required knowledge there to this ;)

This is an on-the-spot thinking so I cannot be sure if I am wasting computational effort anywhere or missing any pivotal condition. If anyone spot it, feel free to speak up :)

edit

I forgot to add that there should be a check for the target for the new missile in step 2. If that check fails, that means no nearby unit remains and thus you can end the spell.
 

Kusanagi Kuro

Hosted Project: SC
Level 10
Joined
Mar 11, 2012
Messages
708
Doom, u forget something. In step 2, if the random number match the condition, move the missle back to the caster (since he wants it to be like that :D).
Except that point, ur outline is perfect. :D
 
Level 16
Joined
Dec 15, 2011
Messages
1,423
Doom, u forget something. In step 2, if the random number match the condition, move the missle back to the caster (since he wants it to be like that :D).

Moving it back? Well...

each will respawn at a 40% chance at the position of the caster and will seek for the nearby enemy once again

But still, it is indeed a wise move to just recycle the missile by moving it back to the caster, attach new data to it and play a respawn effect or something.

Nice ;)
 
Level 4
Joined
Aug 7, 2010
Messages
77
Thanks to both Doomlord and hayaku1412 for the helping hand. + REP
Well, just to tell you all my initial idea on how to create this.

1) On cast, create 3 dummy units that are always the same position of the casting unit with a range attack of 150~150(if I want the damage)
2) Check if the 3 dummy units had attacked(is there such a function in WE? lol)
3) If yes, use the maths random function for the units that had attacked, if reached 40%, the unit stays so that it can attack again, else kill the unit.
4) If the target is dead or the dummy unit could not find any target, kill it too.

I know its not very wise method to do this but like I've said I am rather noob regarding triggers. Nevertheless I appreciate the method u all hav given to me, I will try it out myself :)
 

Kusanagi Kuro

Hosted Project: SC
Level 10
Joined
Mar 11, 2012
Messages
708
No no. U dont need to allow the missle to attack. U just need a projectile system or missle system (which is plenty in the spells section) to move the dummy missle. Then when the distance between the missle and the target is close enough, deal damage to the target through trigger (Action - Unit - Damage Target). And then use the random function.
 
Status
Not open for further replies.
Top