| 05-30-2004, 02:20 PM | #1 |
:\ :\ I'm probably just a stupid noob and this is much more simle than I am making it out to be... but anyhow, I want to make a custom spell for my Arcane Archer hero called repel that pushes all enemy units within 800 range of the hero to 800 range from her. What I tried was basing it off War Stomp and having it so that you move all effected units... but I don't know what to do with the triggering. first off, you can't just move to a random point that distance away, cuz then it isn't pushing if the person ends up on other side of archer. Also I need collision detection and such... so they don't go through walls... argh can anyone help? please? I know I've seen something like this before... :\ :( |
| 05-30-2004, 06:09 PM | #2 |
Heh maybe you should start of something easier then ^^ Ok heres what you could do: Base it of thunderclap and reset all damage/effect values. And then when its used, do this trigger: E: Unit begins casting ability A: If ability being cast equal to (repel) then: pick every unit within 800 of casting unit and do: move (picked unit) to position of (picked unit) offset by 800 in angle between picked unit and casting unit + 180 This would instantly move it 800 away from the casting unit... if theres something in the way, it would just place as close as it can. Ah, and if u cant pick every unit within 800 of casting unit, you just change it to "pick every unit in region position on casting unit with size 800x800" thats just the same thing. GL :D |
| 06-01-2004, 02:11 AM | #3 |
hmm this is a bit old so i don't know if he gave you what you wanted. His trigger would move all units 800 farther away regardless of where they were, you sounded like you wanted them to move to exactly 800 from the archer. Do basically his trigger but move the targeted unit to the casting unit offset by 800 towards the angle between casting and targeted units. |
| 06-01-2004, 10:30 AM | #4 |
move (picked unit) to position of (casting unit) offset by 800 in angle between picked unit and casting unit + 180 this will make the units exactly 800 away from the hero, technically if there are alot of units, they will cluster together, and if there are trees or higher plains that isn't accessible by normal means, the unit being moved will be stucked there forever.This is a note i like to tell you about. hope i help. |
| 06-01-2004, 11:49 AM | #5 |
I'd suggest against making pushback abilities. You risk up trapping affected units on hills, in trees, in water, etc. Some of these are avoidable if you take great care. Ie. when pushing a unit back don't push it back if one of the following conditions are met: - The push would make the hero change cliff height. - The push would push it close to trees (within 100 of more than one tree). Also when pushing you'd probably want it to look good, so do a fluid pushback: Code:
Pushback Recursive Trigger
Events
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
tmp_int Less than (<) 16
Then - Actions
Unit - Move tmp_unit instantly to ((Position of tmp_unit) offset by 50.00 towards tmp_real degrees)
Wait 0.20 game-time seconds
Set tmp_int = (tmp_int + 1)
Trigger - Run (This trigger) (ignoring conditions)
Else - ActionsWhat it does is push the unit 800 units in direction tmp_real degrees over 3.2 seconds. Obviously this trigger doesn't do exactly what you'd like it to, but it should be easy enough to change. |
| 06-05-2004, 04:38 PM | #6 |
thanks for offering... but none of this helps. I've seen a move like this in other games... my problem is with collision detection, and with DIRECTION, which is that they don't all go to some random point at certain range from her. I want them to actually seem to be pushed back. This is a hard spell and I was kidding about it being simple and I believe it will require someone who knows Jass... so I need someone who really knows their stuff. I know this can be done... |
| 06-05-2004, 05:02 PM | #7 |
Two Sentences: - Polar Coordinates - Angle Between two Points And you are set. :) |
| 06-05-2004, 05:11 PM | #8 | |
Quote:
I'm kinda confused by your last two posts kolibri... could you make a demo map real quick so I could see how this works? that would really help; thanks a ton for the help already tho ^_^ |
| 06-05-2004, 06:55 PM | #9 | |
Quote:
Now i dont get it... first you ppl post he wanted something else then i posted, then you post an exact copy of what i said... Yeah, that works and it is exactly what i said ^^ Haha mayb im too complicated... argh |
| 06-05-2004, 07:12 PM | #10 |
The problem with your trigger is that it is an instant move, it won't look like the unit is pushed back. Otherwise it is good. :) OneWinged4ngel, use polar coordinates as Kejos posted. Just move the unit 50 to 100 at a time instead (with a short wait afterwards like my triggers). |
| 06-06-2004, 01:13 AM | #11 |
oh nevermind everyone I found a really good way to make this. With WEU there's a slide feature, and a difference in angles in accordance with caster position feature, and it works great! :D :D :D :D :D :D ^_^ ^_^ ^_^ WEU is cool! just got it ^_^ ^_^ :D |
| 06-07-2004, 12:10 AM | #12 |
oops... seems there's still a problem... although they don't go through the terrain, the units go through destructibles!!!!!! o_O anyone know how to rememdy this? |
| 06-07-2004, 07:00 AM | #13 |
That is why I recommended against pushback abilities. They are very dangerous, you are begging for units getting trapped. |
| 07-01-2004, 02:37 AM | #14 | |
Quote:
well it seemed to detect any units or terrain in the way... just not destructibles. I wanna know how I can fix that (besides destroying the destructibles) |
| 07-01-2004, 05:11 AM | #15 | |
Quote:
Here's an idea. Add an action after the pushback ability is cast that sets the target unit of the ability's collision size to zero for a short duration. Then order those units to attack the caster of the pushback, and after a wait command restore their collision size to normal. That should prevent them from getting stuck. Also, you could reduce the range of the spell so that this sort of thing is less likely to happen. |
