| 08-22-2002, 02:13 AM | #1 |
In my action rpg I want to make it so your hero will not attack a unit unless you order him to attack it... Whenever the hero automaticly takes damage, he automaticly runs towards that target... I would rather he just stands there and doesn't do anything unless you order him to run up and attack the unit... It causes problems in my boss fights since most of it is based around dodging the bosses spells. It gets very hard to dodge attack when your character starts charging right for the boss whenever he takes damage. |
| 08-22-2002, 05:17 AM | #2 |
Guest | just have the player side treat the enemies as "ally" have the enemys treat the player as hostle (non-ally) Map Initialization: Player - Make Player 1 (Red) treat Player 12 (Brown) as an Ally (where Player 1 is your user and 12 is an enemy) |
| 08-22-2002, 07:01 AM | #3 |
but you still wont be able to just attack by clicking on them, you'd have to hit a and click. people might get confused when trying to right click on the enemy and realzing their character isn't attacking. Not many would think you have to select attack or hit a to attack a boss. |
| 08-22-2002, 05:37 PM | #4 |
Hmm... I am not 100% but maybe if you set the Hero to a worker, it won't auto attack. Though you may then have to live with the idle icon. |
| 08-22-2002, 06:39 PM | #5 |
yea, if he is classified as a PEON type, he will run away when he gets attacked and thus he wont attack unless u tell him to |
| 08-22-2002, 10:10 PM | #6 |
What about acquisition range? If you set that to zero, would that prevent a player from auto-attacking a player deemed an enemy? I'm not 100% sure, but you may want to try that and see if it works. |
| 08-22-2002, 10:19 PM | #7 |
Guest | You could always just have the boss sleeping...:D |
| 08-22-2002, 11:24 PM | #8 |
I did try putting aquisition to 0. He didn't run up and attack initially, but when he did get attack he did automaticly run towards the boss... I can't seem to find a way to do it without a bad side effect. |
| 08-23-2002, 01:31 AM | #9 |
Hmm, here's another idea: the order for using your mouse to attack or move is called "smart" as opposed to "move" and "attack" which are activated by keys or by clicking in the unit's "action options." Presumably, whenever your unit decides on his own initiative to attack another unit, his orders are "move" and then "attack" (or merely "attack") while if you use a mouse to direct an attack, your order to the unit is "smart." So one draconian way of doing this is to have an event where a unit controlled by the player is given an action targeting a unit of "attack" immediately order him to stop (actually, my experieence is that a .1 second wait makes it more likely that the game picks up on it). Hopefully this would "reset" his blissful ignorance of the enemy until he was attacked again or the player ordered him to attack. If not, you might want to disallow "move" orders as well, if targeted at a unit since the computer seems to first move to a unit and then target a unit. One bad point is that this would prevent the *player* from using the "a" key to target a unit. You might decide it's worth it though. |
| 08-23-2002, 06:42 AM | #10 |
Played around with a few triggers and came up with this: 1) Make a map with three players. Player 1 is the user, player 2 is the computer, player 3 is a neutral player that will be used for temporary unit storage. 2) Set your hero's acquisition range to 0.00 3) Define a unit group variable called Attackers. 4) Add these triggers: {Set Alliances} +Events --Map Initialization +Conditions +Actions --Player: Make Player 1 treat Player 3 as an Ally with shared vision and full shared units. --Player: Make Player 3 treat Player 1 as an Ally with shared vision and full shared units. --Player: Make Player 3 treat Player 2 as an Ally. --Player: Make Player 2 treat Player 3 as an Enemy. {IdleCatcher} +Events --Unit - A unit owned by Player 1 is issued an order with no target +Conditions --(Issued order) Equal to (Order(stop)) +Actions --Unit Group - Remove (Triggering unit) from Attackers {AttackCatcher P1} +Events --Unit - A unit owned by Player 1 is issued an order targeting an object +Conditions --(Issued order) Equal to (Order(attack)) +Actions --Unit Group - Add (Triggering unit) to Attackers {AttackCatcher P3} +Events --Unit - A unit owned by Player 3 is issued an order targeting an object +Conditions --(Issued order) Equal to (Order(attack)) +Actions --Unit Group -- Add (Triggering unit) to Attackers {PauseUnit P1} +Events --Unit - A unit owned by Player 1 is attacked +Conditions --((Attacked unit) is in Attackers) Not equal to True +Actions --Unit - Change ownership of (Attacked unit) to Player 3 and Retain color --Selection - Add (Triggering unit) to selection {PauseMovingUnit P1} +Events --Unit - A unit owned by Player 1 is issued an order targeting a point +Conditions --(Issued order) Equal to (Order(move)) --((Attacked unit) is in Attackers) Not equal to True +Actions --Unit - Change ownership of (Attacked unit) to Player 3 and Retain color --Selection - Add (Triggering unit) to selection {UnPauseUnit} +Events --Unit - A unit owned by Player 3 is issued an order targeting an object +Conditions --(Issued order) Equal to (Order(attack)) +Actions --Unit Group -- Add (Triggering unit) to Attackers --Unit - Change ownership of (Triggering unit) to Player 1 and Retain color --Selection - Add (Triggering unit) to selection {UnPauseUnit AttackTo} +Events --Unit - A unit owned by Player 3 is issued an order targeting a point +Conditions --(Issued order) Equal to (Order(attack)) +Actions --Unit Group -- Add (Triggering unit) to Attackers --Unit - Change ownership of (Triggering unit) to Player 1 and Retain color --Selection - Add (Triggering unit) to selection In a nutshell, the null third player stores any unit that you haven't commanded to attack. Triggers are used to detect whether or not the unit is attacking. If the unit is ever commanded to attack, its alliances return to those of Player 1--allowing "attack-to" commands. (Edit: Forgot a trigger...whoops) |
| 08-23-2002, 08:14 PM | #11 |
Wow, that's really cool. I was going to suggest setting the players as allies. Then making a trigger that detects the 'smart' order and automatically issues 'attack' instead. |
| 08-24-2002, 07:58 AM | #12 |
so right clicking on a unit, isn't an attack it's a smart? but when that unit does attack he initiates "attack" and not smart? So in other words map an event to automaticly stop him everytime you use attack, which will cancel auto-attack because it uses that order? but it wont effect the mouse right click, because it is a different command? |
