Heya. Here's the scenario I'm trying to set up. I have a unit that puts a negative buff on an enemy unit. When the enemy unit has this buff, I want the enemy unit to gain a button on its command card, so I can click that unit and press the button. (The button would make the unit explode or something.)
How can I do this while letting the enemy player keep control of his unit? I basically want it so that, when this buff is on him, me and the enemy can both command the unit at the same time. But the only button/ability I get is the explode ability, while my enemy keeps control of all the other abilities, such as move, attack, etc.
EDIT: I made huge progress. I used an Interact ability, with range 500 and autocast range 500. Autocast filter is set to only Enemy. Same with Target filter. I set up a validator to check whether the behavior I'm looking for is on the unit, and I used that as an autocast validator. I set it to autocast, exclusive, share control, and share vision.
In effect, this is what happens: I attack with the unit, put the behavior on the enemy unit, and then I gain shared control of the enemy unit. His command card becomes available to me and I can command him. But he remains the enemy's unit and shoots at my units whenever he isn't on a move order.
It should be easy from this point to just hide the marine's abilities from me and hide the "explode" ability from his owner.
I'm not sure if you can hide ability buttons for specific players. I would suggest instead just making a button appear on the casting unit's command card that when used kills the unit with the buff.
If you want to just show an ability for one player, you could make a "dummy" unit that is a copy of the unit you want and then use triggers to link the two. You could either place the dummy on the marine and order it to follow repeatedly forever until it dies. Or you could place the dummy unit somewhere out of site, or even make it have no model so that no one will see it, but use triggers to select this dummy when they select the original unit. Then when a dummy marine uses the explode, make it kill the original marine which could be stored in a variable when the dummy is created.
I haven't had a chance to try any of this yet. But here's what I'm going to try.
I'm thinking of having the ability depend on a certain upgrade that only the enemy player will have. (This is going to be an asymmetric game, so I don't need players to be able to do it to each other.) Though I don't know yet whether it would be possible to have it appear for one player and not the other. I'm worried that it might only show/not show the abilities based on the upgrades for the player that owns the unit.
I was just using an explosion as an example of what kind of thing I'm going for. I think it would actually be much cooler if I could allow selecting the unit itself to activate this "explosion". I plan on giving the casting player sight of the unit for about a minute or so and giving them the ability to "detonate" that unit within a certain timeframe.
If the idea I'm thinking of won't work, then I may just have to try a dummy unit.
EDIT: It actually won't work, will it? I've just been thinking about it and trying to figure it out. Even if I could make different abilities check different players on the same unit, the unit will simply display abilities to both players based on the requirements it checks, right? IE, the checks will be done, and then both players will see the abilities after those checks. I doubt it'll display different abilities to different players on the same unit.
If so, I'll have to use a dummy unit to get the effect I want. Or maybe I can use a click response to get something almost like what I want. Maybe when an enemy player double clicks the unit, it can explode. I really wanted it to be a button on a command card, but this is the next best idea I can come up with in lieu of that. And a bit less hacky than using a dummy unit.
Heya. Here's the scenario I'm trying to set up. I have a unit that puts a negative buff on an enemy unit. When the enemy unit has this buff, I want the enemy unit to gain a button on its command card, so I can click that unit and press the button. (The button would make the unit explode or something.)
How can I do this while letting the enemy player keep control of his unit? I basically want it so that, when this buff is on him, me and the enemy can both command the unit at the same time. But the only button/ability I get is the explode ability, while my enemy keeps control of all the other abilities, such as move, attack, etc.
EDIT: I made huge progress. I used an Interact ability, with range 500 and autocast range 500. Autocast filter is set to only Enemy. Same with Target filter. I set up a validator to check whether the behavior I'm looking for is on the unit, and I used that as an autocast validator. I set it to autocast, exclusive, share control, and share vision.
In effect, this is what happens: I attack with the unit, put the behavior on the enemy unit, and then I gain shared control of the enemy unit. His command card becomes available to me and I can command him. But he remains the enemy's unit and shoots at my units whenever he isn't on a move order.
It should be easy from this point to just hide the marine's abilities from me and hide the "explode" ability from his owner.
I'm not sure if you can hide ability buttons for specific players. I would suggest instead just making a button appear on the casting unit's command card that when used kills the unit with the buff.
Just a thought.
@Amaroq64: Go
If you want to just show an ability for one player, you could make a "dummy" unit that is a copy of the unit you want and then use triggers to link the two. You could either place the dummy on the marine and order it to follow repeatedly forever until it dies. Or you could place the dummy unit somewhere out of site, or even make it have no model so that no one will see it, but use triggers to select this dummy when they select the original unit. Then when a dummy marine uses the explode, make it kill the original marine which could be stored in a variable when the dummy is created.
New to the Editor? Need a tutorial? Click Here
Want data assets? Click Here
I haven't had a chance to try any of this yet. But here's what I'm going to try.
I'm thinking of having the ability depend on a certain upgrade that only the enemy player will have. (This is going to be an asymmetric game, so I don't need players to be able to do it to each other.) Though I don't know yet whether it would be possible to have it appear for one player and not the other. I'm worried that it might only show/not show the abilities based on the upgrades for the player that owns the unit.
I was just using an explosion as an example of what kind of thing I'm going for. I think it would actually be much cooler if I could allow selecting the unit itself to activate this "explosion". I plan on giving the casting player sight of the unit for about a minute or so and giving them the ability to "detonate" that unit within a certain timeframe.
If the idea I'm thinking of won't work, then I may just have to try a dummy unit.
EDIT: It actually won't work, will it? I've just been thinking about it and trying to figure it out. Even if I could make different abilities check different players on the same unit, the unit will simply display abilities to both players based on the requirements it checks, right? IE, the checks will be done, and then both players will see the abilities after those checks. I doubt it'll display different abilities to different players on the same unit.
If so, I'll have to use a dummy unit to get the effect I want. Or maybe I can use a click response to get something almost like what I want. Maybe when an enemy player double clicks the unit, it can explode. I really wanted it to be a button on a command card, but this is the next best idea I can come up with in lieu of that. And a bit less hacky than using a dummy unit.