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

[Trigger] Triggered spell

Status
Not open for further replies.
Level 6
Joined
May 31, 2008
Messages
218
I need help with a rather easy spell, at least what i thought when i started on it.

The basic idea is that a hero uses a ability like carrion swarm, and the enemy units that are hit by this spell will be given a buff almost like curse. But for some reason i can't figure how to do it.
 
Level 6
Joined
Jul 24, 2008
Messages
180
  • Actions -
  • Unit Group - Select All units in (All unit within (500) of (Target of ability being cast))
  • Loop - Add (buff) to (Picked Unit)
Because its a point target spell, I can't think of a way to detect being hit by it so I suggest finding how wide it hits and how far and detecting units in that zone.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Something like this should do:

  • Carrion Swarm
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Carrion Swarm
    • Actions
      • Set loc[1] = (Position of (Triggering unit))
      • For each (Integer LoopInt1) from 1 to 16, do (Actions)
        • Loop - Actions
          • Set loc[2] = (loc[1] offset by ((Real(LoopInt1)) x 50.00) towards (Facing of (Triggering unit)) degrees)
          • Set TempGroup = (Units within 100.00 of loc[2] matching (((((Matching unit) is A structure) Equal to False) and (((Matching unit) has buff Curse) Equal to False)) and (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True)))
          • Unit Group - Pick every unit in TempGroup and do (Actions)
            • Loop - Actions
              • Unit - Create 1 Curse Dummy for (Owner of (Triggering unit)) at loc[2] facing 0.00 degrees
              • Unit - Order (Last created unit) to Undead Banshee - Curse (Picked unit)
              • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
          • Custom script: call DestroyGroup(udg_TempGroup)
          • Custom script: call RemoveLocation(udg_loc[2])
      • Custom script: call RemoveLocation(udg_loc[1])
I think everything explains itself...

This is for the standard carrion swarm: 800 range ( = 16 x 50) and 100 AoE.
The Curse Dummy is a unit with the curse ability, no sight range, no food cost, no damage, no shadow and as model "_" (none).

Note that this does not check when the unit is hit by carrion swarm, it will pick all targets that are there at the moment carrion swarm is casted, so it is possible that a unit doesn't receive damage but is cursed (if he runs away really fast).
 
  • Actions -
  • Unit Group - Select All units in (All unit within (500) of (Target of ability being cast))
  • Loop - Add (buff) to (Picked Unit)
Because its a point target spell, I can't think of a way to detect being hit by it so I suggest finding how wide it hits and how far and detecting units in that zone.

there is no such thing as add buff...

and if you want to check the units hit by carrion swarm, you must make a custom missile.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
there is no such thing as add buff...

and if you want to check the units hit by carrion swarm, you must make a custom missile.
Adiktuz is correct.

In addition to that: custom missiles requires more coding (though not very difficult, I wouldn't reccomend it for avarage mappers), as it needs to be MUI (since it moves, there is a timer connected to it - that's not the case with my previously showed trigger, so it's always MUI).

If you don't know how to do this, just stick with my trigger and accept it's disadvantages ^^
 
Level 6
Joined
May 31, 2008
Messages
218
Adiktuz is correct.

In addition to that: custom missiles requires more coding (though not very difficult, I wouldn't reccomend it for avarage mappers), as it needs to be MUI (since it moves, there is a timer connected to it - that's not the case with my previously showed trigger, so it's always MUI).

If you don't know how to do this, just stick with my trigger and accept it's disadvantages ^^
Custom missiles? If you would like to give a brief explanation about it i could decide if i should try it or stick to more easy stuff. Cause i wanted to get away from using the method you just showed, as that was my main idea. So i thought there would maybe be a way to know exactlly when a unit is hit and at that moment give it a curse buff.

And also, the hero will be in a map where you have lots of units, so it would be random if you cast a carrion swarm on a enemy troop running away and just half of them are affected >.>
 
Level 6
Joined
May 31, 2008
Messages
218
If you're not a skilled coder, then you should stick to ap0's trigger. Its very simple and always keeps being MUI.
In this case i guess you mean code=jass?
Which i don't really feel i have the time or will to learn right now.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
GUI is the graphical version of JASS, so GUI is also called "coding" (and that's what I was referring to, you don't need JASS for it).

You asked for a brief explanation, here it is:
When you want a custom missile, you should make a dummy (which basically functions like a special effect) and then move that special effect ever 0.03 seconds (0.02 - 0.04 seconds, I always use 0.03 myself).
As everyone knows (or should know), moving in games = teleporting a very short distance in very short intervals, so that's what the custom missile is: we move the dummy very short distances in very short intervals (often about 20-30 range / 0.03 seconds).

The problem is that, once you do this, you must keep in mind that a unit (or several units) can cast the ability twice (or more) at the same time, so you need to move all those dummies, this requires either indexing or hashtables (I prefer hashtables... some people don't, but from experience I learned to trust myself, not the mass).
But you said you weren't in the mood for learning right now, so I won't explain how exactly those two methods work.

(On a side-note: JASS is a lot better when you want to make something MUI).
 
Level 6
Joined
May 31, 2008
Messages
218
GUI is the graphical version of JASS, so GUI is also called "coding" (and that's what I was referring to, you don't need JASS for it).

You asked for a brief explanation, here it is:
When you want a custom missile, you should make a dummy (which basically functions like a special effect) and then move that special effect ever 0.03 seconds (0.02 - 0.04 seconds, I always use 0.03 myself).
As everyone knows (or should know), moving in games = teleporting a very short distance in very short intervals, so that's what the custom missile is: we move the dummy very short distances in very short intervals (often about 20-30 range / 0.03 seconds).

The problem is that, once you do this, you must keep in mind that a unit (or several units) can cast the ability twice (or more) at the same time, so you need to move all those dummies, this requires either indexing or hashtables (I prefer hashtables... some people don't, but from experience I learned to trust myself, not the mass).
But you said you weren't in the mood for learning right now, so I won't explain how exactly those two methods work.

(On a side-note: JASS is a lot better when you want to make something MUI).

The funny thing is, this ability is for a hero, so there is no chance what so ever that the same ability is cast twice, if i don't give it to another hero. And i just read about hashtables, but it seemed like i didn't need them at that time so i don't know exactly how you use them.

But once you use this custom missile, is it supposed to work like the normal missile but instead of hitting the units you check for units within range each time it moves?
Or have i gotten it wrong?

Just read about hashtables and it seems like you use them to store all sorts of stuff, but unlike variables they store a specific unit for an example?
Cause i always thought you had to save it with a new number each time like.... one unit is saved as 1 and next is 2. But seems like that is not the case with hash :D
 
The funny thing is, this ability is for a hero, so there is no chance what so ever that the same ability is cast twice, if i don't give it to another hero. And i just read about hashtables, but it seemed like i didn't need them at that time so i don't know exactly how you use them.

But once you use this custom missile, is it supposed to work like the normal missile but instead of hitting the units you check for units within range each time it moves?
Or have i gotten it wrong?

Just read about hashtables and it seems like you use them to store all sorts of stuff, but unlike variables they store a specific unit for an example?
Cause i always thought you had to save it with a new number each time like.... one unit is saved as 1 and next is 2. But seems like that is not the case with hash :D


yeah, the missile should check every interval the units around him. If you don't like learning JASS or vJASS then I would also suggest that you use hashtables for this. Also you would need to make a group that stores every unit that is already hit by the dummy so that no unit can get hit more than once. There are custom missile systems in the spells section. Anyway if you did search you might find the one I made, but its currently under improvement so I cannot suggest it to you. But if you would like I can make a trigger for you (it will be JASS/vJASS though).

I found this on the spells section (haven't tried it but its approved and GUI) GUI missile system
 
Level 6
Joined
May 31, 2008
Messages
218
yeah, the missile should check every interval the units around him. If you don't like learning JASS or vJASS then I would also suggest that you use hashtables for this. Also you would need to make a group that stores every unit that is already hit by the dummy so that no unit can get hit more than once. There are custom missile systems in the spells section. Anyway if you did search you might find the one I made, but its currently under improvement so I cannot suggest it to you. But if you would like I can make a trigger for you (it will be JASS/vJASS though).

I found this on the spells section (haven't tried it but its approved and GUI) GUI missile system

I think i rather look at a already made missile, and sorta copy paste it but change it on my own so it fits my map. That way i might be able to learn something and making this knowledge usefull further on^^
But if i for some reason don't understand it, maybe i could ask you :D?
 
I think i rather look at a already made missile, and sorta copy paste it but change it on my own so it fits my map. That way i might be able to learn something and making this knowledge usefull further on^^
But if i for some reason don't understand it, maybe i could ask you :D?

of course.
 
Status
Not open for further replies.
Top