| 06-15-2006, 07:54 AM | #1 |
Why can't a make the Staff of teleportation ability target enemy units?! Urgh. Is there some abilty that isn't broken that I can use to work exactly like the staff of teleportation to port a hero to a targetted unit, be it friend or foe? |
| 06-15-2006, 08:19 AM | #2 |
If the ability doesn't work, can't you just use a dummy ability and triggers? Moving the unit shouldn't be very hard. |
| 06-15-2006, 09:14 AM | #3 |
Unit - Move (casting unit) instantly to position of (Target unit of ability being cast offset by X[random integer between -200 and 200],Y[random integer between -200 and 200]. Something like that I guess, should be easy enough. |
| 06-15-2006, 04:04 PM | #4 |
If only it were so simple. I can get the unit to move alright, but I can't get the animation and effects to line up and there are other issues. I based it off of channel. I made cast when the unit starts the effect of an ability if I don't have a wait of about a second the spell effects never show up, the unit just moves unceremoniously and the spell doesn't start it's cooldown! With the wait things get all out of whack. Like the hero will just sit there for a second doing nothing and then briefly start his spell animation while the effects kick in and then they will teleport, but the animation on the target will keep playing for another second or so. Also if the hero dies while casting (or probably if he is stunned) the trigger will still move him to the target unit. I tried making it trigger when he finishes casting the ability but then it seems that the position of the targetted unit has no meaning anymore, since the hero doesn't budge. |
| 06-15-2006, 08:18 PM | #5 |
If animation is a problem, instead of Move Unit Instantly, use SetUnitX(whichUnit, X) and SetUnitY(whichUnit, Y) as these do not reset animation. Use this code instead: JASS:local location targetLoc = GetUnitLoc(GetSpellTargetUnit()) call SetUnitX(GetSpellAbilityUnit(), GetLocationX(OffsetLocation(targetLoc, GetRandomReal(-200, 200), GetUnitY(GetSpellAbilityUnit())))) call SetUnitY(GetSpellAbilityUnit(), GetLocationY(OffsetLocation(targetLoc, GetUnitX(GetSpellAbilityUnit()), GetRandomReal(-200, 200)))) call RemoveLocation(targetLoc) set targetLoc = null |
| 06-16-2006, 02:13 AM | #6 |
Well that is good to know! I will have to try it out. |
