| 01-17-2006, 08:00 PM | #1 |
I have an ability which drains mana but increases movement speed. It's based on immolation, when it is cast the casting unit gets given an ability based off "Item Move Speed Bonus", the ability is then removed when the unit gets the order "unimmolation". The unit definitely gets and removes the ability ok, the problem is that if the unit is moving at the time it activates/deactivates the ability, its movement speed isn't refreshed. So you can activate the ability, stop, right-click somewhere far away, and deactivate, and you run the whole distance as though the ability was on. Anyone have any ideas? The only thing I can think of is logging all the of the orders given to units with the ability, and reissuing on casting, but I really don't want to have to resort to that. Edit: Solved Sorry, really should have tried this before I posted. Using "Unit - Set Movement Speed" to set the unit's movement speed to default after each trigger is run solves the problem. |
| 01-18-2006, 12:26 AM | #2 |
I actually think that Seting the unit's speed with that trigger will bring you much more problems, for example if the unit is affected by a buff / upgrade that affects speed during the effect of that ability its speed will get screwed. I think that the problem of the speed not being restored correctly is because your trigger is failing to remove the ability correctly |
| 01-18-2006, 03:35 PM | #3 |
It is removing the abilities (otherwise why would issuing a new order refresh the speed). I'm pretty use the "Set Unit Speed" sets the unit's base speed, ignoring buffs etc. I'll test that out though. Edit: Tested, yup - sets base movement speed. |
| 01-18-2006, 07:24 PM | #4 |
yes, it ignores buffs. Do you actually think that's a good thing? It will cause a lot of problems eventually, like bonuses of items getting lost and that kind of stuff If it refreshes the speed then what's the problem? I see, then what about ordering the unit to stop when the spell ends? |
| 01-18-2006, 07:33 PM | #5 |
Would it be possible to track the Unit's total move speed including buffs by summing them in an int var? In this way, say, if the unit is moving when the buff wears off, you can lower it's base speed while it is still under the effects of the buff, and then when it stops reincrease its base speed to its default. Although, I'm not sure how you'd detect when it stopped moving... so :x Also that _does_ seem like a lot of handling going on and passing var's back and forth from functions or something to keep it multi-instanceable, especially if you have multiple movespeed buffs in your map. |
| 01-18-2006, 08:12 PM | #6 |
Erm... doing "Unit Set Move Speed" to default does absolutely nothing unless you have previously used it to set its movement speed to something other than default. It changes base move speed, all items, buffs, etc are added on as usually. You could have a trigger to do "Pick All Units, Set Move Speed of Picked Unit to Default Movement Speed of Picked Unit" every second of the game, and (other than lagging) it would make no difference to game play. Sorry it wasn't very clear before :o |
