• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

How to stop players from moving unit

Status
Not open for further replies.
Level 3
Joined
Oct 8, 2007
Messages
41
I am trying to make a map but have came upon a problem.

How do you make a unit still be able to move and under Player(wateva)'s control but Player(wateva) cant choose where the unit will go or ask the unit to stop moving by asking it to move foward abit then dont give anymore commands.

I need to do this because i am trying to make the unit walk a preset path but the Player(wateva) still has to be able to use the abilities of that unit although he cant stop the unit from moving the preset path and cant ask the unit to move a different way.
 
Level 9
Joined
Jun 26, 2007
Messages
659
use a "controller unit"
make a custom unit from the human basic tower (no move, no attack)
give it a dummy ability for each of the controlled unit ability (and also required commands)
then make a trigger for each ability : when controller is issued order X, order controlled to X
 
Level 3
Joined
Oct 8, 2007
Messages
41
I cant find a way to make a unit use a Custom ability. All it can do is use those preset abilities.

ANd if it is not off topis can i ask if damaging negative values in the triggers is a way to heal?

Or is there another way to heal HP. Is it the same way to heal MP?
 
Level 9
Joined
Jun 26, 2007
Messages
659
I cant find a way to make a unit use a Custom ability. All it can do is use those preset abilities.
in the unit ability field, you chose "custom" (or something like that) in the top left combo box and choose yours.

Or is there another way to heal HP. Is it the same way to heal MP?
in a trigger? just use
Unit - Set Life of (target unit i guess) to ((Unit - Get Life of (targer unit))+heal_value)
 
Level 6
Joined
Nov 4, 2004
Messages
125
I cant find a way to make a unit use a Custom ability. All it can do is use those preset abilities.

You can. I think you are referring to the field "Unit - Issue Order ... ". The "abilities" listed there are merely the orders of the abilities. So for example, if you base an ability on blizzaard and don't change the order, this ability will be cast when you do "Issue Order Targeting a Point - Human Archmage - Blizzard" or whatever it looks like in GUI :). Same goes with all other abilities. Just remember, that function takes ORDERS as input, no ability codes!


ANd if it is not off topis can i ask if damaging negative values in the triggers is a way to heal?

Yes it is! However, when using damage to heal, you have to keep armor and resistance in mind, because that applies versus "damage" even if it is negative. So for example if you want to heal a hero, dealing -100 spell "damage" and the hero has normal, unmodified hero armor, it will only take -70 "damage", so for healing, i strongly suggest the set life function.
 
Level 3
Joined
Oct 8, 2007
Messages
41
in the unit ability field, you chose "custom" (or something like that) in the top left combo box and choose yours.

Unit ability field? I dont Understand.Actually wat trigger are you using? I tried the "Unit-Issuse Order Targetting a Unit" trigger and it doesnt have "custom or something like that.

Edit: Woops sorry question answered already
 
Last edited:
Level 3
Joined
Oct 8, 2007
Messages
41
You can. I think you are referring to the field "Unit - Issue Order ... ". The "abilities" listed there are merely the orders of the abilities. So for example, if you base an ability on blizzaard and don't change the order, this ability will be cast when you do "Issue Order Targeting a Point - Human Archmage - Blizzard" or whatever it looks like in GUI :). Same goes with all other abilities. Just remember, that function takes ORDERS as input, no ability codes!

so that means if i want a unit to cast a custom spell, i have to change a preset spell without changing the order of the ability?
Does that mean i have to modify that ability without copying then pasting it or without Ctrl+Shift+N?
Is there any other way to make a unit cast a custom ability like using JASS?
 
Level 6
Joined
Nov 4, 2004
Messages
125
Well when making a custom ability, you basically do copy+paste an "old" ability and then modifiy it. So yes, just don't modifiy the order.
And no, there's no other way. Also, orders are simply the best way :p and the only real "logical" way.
 
Level 3
Joined
Oct 8, 2007
Messages
41
Does that mean i cant ask a unit to use an ability that is not based off the list of spells in the preset?
That means i am VERY limited in the number and type of spells a can ask a unit to cast?
So if i want a unit to cast a custom spell that is based of a spell that increase max life and damage but i wont be able to because that spell in not in the preset list of orders i can ask it to do?
Is there a way to modify the data of those spells in the preset list so that i could make a spell do much more than it originally could do?

How about NON-"logical" ways to asking a unit to use a custom ability?
 
Level 21
Joined
Aug 21, 2005
Messages
3,699
You don't seem to fully understand what we try to say.

In fact, it's quite easy.
Warcraft 3 has a limited amount of ORDER STRINGS. Every excisting ability has an order string. For example: the "Storm Bolt" ability has the order string "stormbolt".
What does this mean? It means that when I order a unit in the trigger editor to "Mountain king - Storm Bolt", the unit will cast EVERY spell it has that has the order string "stormbolt".
So when I order a blood mage to storm bolt a targetted unit, he'll do nothing, since he doesn't have storm bolt.
When I order a mountain king to storm bolt a target, the ability will indeed be cast because the mountain king has an ability with order string "stormbolt".

When I decide to make a new ability BASED OFF storm bolt (and I change e.g. duration, damage and projectile). I change its name to "1337 Bolt".
Ofcourse, there is no such order string like "1337 bolt", because warcraft 3 has the order strings preset. Now og look at your 1337 bolt in the object editor. You'll see a value named "Order String". You can see it's still set to "stormbolt" because the spell was based off the original Storm Bolt spell.

This means that whenever I order, in the trigger editor, to "Mountain King - Storm Bolt", the unit will cast every spell he has with the order string "storm bolt". If this unit has the ability "1337 bolt", he will cast it, because the order string of "1337 bolt" is still "stormbolt".

Do know that if you give a unit BOTH Storm Bolt AND 1337 bolt and they still have the SAMe order strings, BOTH spells will be cast at the same time. This is for the simple reason that they still have the SAME order strings.

There are 3 types (I think) of order strings: "Target", "Point" and "No Target". "stormbolt" is a "Target" type (since you needto TARGET a unit unlike Flamestrike or Roar), which means you can only cast this spell by using the "issue order TARGETTING an object". If you're looking for "Mountain King - Storm Bolt" in the "issue order targetting a point", you won't find it here.
As far as I know, EVERY (or nearly every) order string can be found at one of those 3 actions.

I hope I cleared some things up rather than confusing you :)
 
Status
Not open for further replies.
Top