| 10-27-2004, 03:23 AM | #1 |
I've been wanting to add a power-up ability, that is activated by the stop button. When you press stop, it plays your stand-channel animation, and then converts mana to HP, at a ratio of 3 mana to 1 health. The rate at which it converts is: Mana: Current Mana - (3 x (Level of Triggering Unit / 4)) Every .25 Seconds Health: Current Heatlh + (1 x (Level of Triggering Unit / 4)) Every .25 Seconds The power-up stops if the triggering unit issues ANY order, whether it be to move, to cast, or to attack. It also stops once the mana is too low to be converted to health anymore, or if the triggering unit reaches full health. I've been unsuccessful with this trigger several times, because I can never get it to work right. Anyone have any clue where to begin? |
| 10-27-2004, 03:30 AM | #2 |
where to begin event- unit is issued order conditions - issued order = stop :) okay.. jk.. well actually another approach, could be every .25econds if the units current order is stop, and its mana is greater than the mana you need, then do you're whole formula thing. but i would get sorta mad if every time i stopped i started losing mana, unless its not erally needed for anything else. |
| 10-27-2004, 03:49 AM | #3 |
Well, stop won't be used very much in the map, and I'll be changing the icon and everything. So thats why I wanted to do this. |
| 10-27-2004, 04:05 AM | #4 |
well do you need mana for anything else? |
| 10-27-2004, 05:56 AM | #5 | |
Quote:
Umm... why all of the questions about my map? Can't I just get help with the trigger? |
| 10-27-2004, 07:30 AM | #6 |
well sometimes you need some information if you want to help... anyways this would allways activate even if it stops after reaching a movement destination and not only if the stop button is really pressed. if thats what you want to do than you have quite a wierd map idea... or a very special one ![]() why don't you just make a channeled ability with "3600" duration and than trigger it. the channeled spell should have everything 0, mana cost as well because its instant and not a loss over time and duration 3600(max) the trigger is: Code:
events
unit begins channeling ability
conditions
ability being used is XYZ
actions
set mana of (triggerung unit) - 1 (...
set hitpoints of (triggering unit) + 3(...
wait .25 seconds
run this trigger ignoring conditionsand to be sure that the unit will never stops casting ... (the maximum duration you can set is 3600 seconds = 1 hour) make a trigger that just runs makes it continue when it finishes. Code:
events
unit finishes channeling an ability
conditions
ability being used is XYZ
actions
order (triggering unit) to cast ability XYZusualy abilitys are the best way to make whatever actions the unit shall be able to. |
| 10-27-2004, 01:16 PM | #7 |
well.. i did help you then i got off-topic. you check every .25 seconds if the unit has the required mana (3) and then if the unit is currently stopped (if the issued order is stop) then you remove 3 mana and add 1. |
| 10-27-2004, 01:51 PM | #8 |
needless to say that a periodic event every .25 seconds and with conditions will drain memory... |
| 10-27-2004, 09:17 PM | #9 |
no, to my knowledge only memory leaks drain knowledge.. all a condition does is run another function. as long as there are no memory leaks in your condition function you should be fine. |
| 10-28-2004, 08:20 PM | #10 | ||
Wouldnt it be better to use hold position? when a unit is stopped it doesnt show an order when he auto attacks an enemy, u would have no problem tho when u set acquisition range 2 0.00 on stop tho... just think about it. I'll go for hold position cause the order stays on the button, if u know what I mean. btw, this is wrong: Quote:
PERIODIC TIMERS DONT LAG BY THEMSELVES!!! Quote:
|
| 10-29-2004, 12:54 AM | #11 | |
Quote:
Event:A unit issue with no target Condition:and all condition equal to true Issued order equal to (stop) %mana of order unit greater than 10% owner of order unit control not equal to computer Action: -Add [power up](dummy spell) to order unit ===Power up trigger=== Event:every 1s condition:none Action: Pick every unit in entire map do multi action -Loop-If then else do multiaction -level of [power up] for pick unit equal to 1 -pick unit is a hero qual to true -Loop action: +set life of pick unit to life of pick unit+1 +set mana of pick unit to mana of pick unit-3 |
| 10-29-2004, 12:59 AM | #12 |
no, you dont need to add a whole ability and remove it, all you to do is check when the unit is stopped. |
| 10-29-2004, 01:13 AM | #13 |
How would you make the ability stop if the health is full or the mana reaches 0? I've tried this using another trigger, but they just don't seem to sync right and its usually a few seconds slow. |
| 10-29-2004, 03:23 AM | #14 |
hmm.. i hate when people dont tell me what is wrong with my solution.. toot got the closest with something about aquisition range and auto-aqiuring but it sounds like hes just using this as sort of an awkward in between spell. so youre duking it out with someone and then theres a little break where you heal up some. heh.. and thats the 2nd time someone said my periodic functions would leak. where did that myth start? people have been using .01 second periodic events since wc3 came out.. |
| 10-29-2004, 03:25 AM | #15 | ||
Quote:
You gave a solution? Is this it? Quote:
Hmm... |
