| 10-07-2009, 06:14 AM | #1 |
Hello, this is my first post on this forum. I found these forums looking for a good map protector, but I have found a lot more than that. :D I'm trying to make a skill for a unit in my map, and i'm having a little bit of trouble making it work properly. I'm trying to create an ability that heals units in an AoE around the unit, only triggered upon attack, but has a cooldown of 5 seconds. So what I did is use a base ability of Searing Arrows (made the damage zero, changed icon, and added 5s cd). I created a trigger that looks like this: Events- Unit- A unit begins casting an ability Condition- (Ability being cast) Equal to Nature's Pulse Action- Pick every unit in (Units within 500 of (Position of (Trigger unit)) matching (((Owner of (Matching unit)) is in (All allies of (Triggering player))) equal to true)) and do (Actions) Loop-Actions Unit- Set life of (picked unit) to ((Life of picked unit) + 85) |
| 10-07-2009, 07:55 AM | #2 |
the problem is, autocast arrow abilities do not trigger the cast trigger events when they are autocast. You could bypass this by issuing the arrow ability order to the unit whenever it attacks, but that still leaves the problem of it looking weird since the heal effect would trigger long before the attack projectile hits the target. Personally, I would trigger such an ability completely using a damage detection system. |
| 10-07-2009, 08:44 AM | #3 |
Couldn't you use an orb attack and set the chance to 100% and set the ability to an instant one, for example berserk, get the berserk cast with a trigger and then AOE heal with your trigger? |
| 10-07-2009, 07:43 PM | #4 |
orb that casts frost nova that deals negative damage to allies? |
| 10-07-2009, 08:31 PM | #5 |
No, that would suck horribly XD it got delay, and interrupts the attack. |
| 10-07-2009, 08:34 PM | #6 |
How about the following: Trigger Natures Pulse Event A unit is attacked Condition Unit type of attacking unit equals to (your units type) Action Pick every unit in (Units within 500 of (Position of (Trigger unit)) matching (((Owner of (Matching unit)) is in (All allies of (Triggering player))) equal to true)) and do (Actions) Loop-Actions Unit- Set life of (picked unit) to ((Life of picked unit) + 85) Turn on trigger cooldown Turn off this trigger And make another trigger: Trigger cooldown Event Time elapsed 5 seconds Condition Action Turn on Trigger Natures Pulse Turn off this trigger This is a simple approach to the problem but this method doesnt support mui, i.e. only one unit can have this ability. Natures Pulse would be some dummy passive ability and if the unit is a hero (the ability needs to be learned) you can add this condition to the Natures Pulse trigger: and level of Natures Pulse is equal to or greater then 1. |
| 10-07-2009, 11:30 PM | #7 | |
Quote:
|
| 10-08-2009, 09:31 AM | #9 |
And that is the difference between an amateur triggerer and an experienced coder, but at least my thought does work, and without a damage detection system. Clean as it may be, but is there a way to make this ability mui? I dont think this approach can allow it but maybe another approach can accomplish that. And about the variables, why not use locals for the TempPoint and TempGroup? And is there any difference between using and not using locals in this case? |
| 10-08-2009, 12:47 PM | #10 | |||
Quote:
Quote:
Quote:
|
| 10-08-2009, 02:00 PM | #11 |
The magickal answer is to use a damage detection system and then code the spell in 15 lines. Really. |
| 10-09-2009, 06:04 PM | #13 |
Your bug originates from the attacking unit being grouped up by your "Pick all units" line. You need to add a check that "Matching Unit is equal to Attacking Unit equal to false" or something like that. |
| 10-09-2009, 06:44 PM | #14 |
It is as Dusk said if you don't want the attacking unit to be healed, but if you do then it is Simple Trigger: If picked unit is not equal to (attacking unit) then Special Effect - Create a special effect attached to overhead of (Picked Unit) using Abilities/healAnd why did you put the attacking unit special effect attachment command within the loop? There is only one attacking unit. And the ability itself can be used by as many units as you want (granted that not too many units are using it at the same time, not very sure). The problem is with the cooldown counter, you have only one and it will run for all of them, i.e. when a unit uses it, it’ll be 5 seconds before another unit can (shared cooldown). To make an mui cooldown system you’ll need a timer array with an array clean up code to keep track of each cooling unit individually. And wouldn’t the special effects leak and cause lag after some time? There is a destroy special effect code in GUI and I think it is there for a reason (I never experimented with special effects before). |
