I'm trying to build a map which has custom neutral Protoss buildings, which can be controlled by a player who powers them with a Pylon. If another player destroys the Pylon, the unpowered building reverts to neutral.
Unfortunately, I can't find a way to let a unit "see" the power radius of a unit from another team. I assume the answer lies somewhere in the Power Source and Power User behaviors, but there seems to be no way to let a Power User interact with a Power Source of another team. Is there a way to get around this?
One method I played with was using map triggers to simply detect if a Pylon was built near a neutral structure (although I would prefer to use a Data-driven method). However, I couldn't find an event that could be triggered if Building A (the Pylon) was built in a certain radius of Building B (the neutral structure).
Any thoughts on these issues would be greatly appreciated!
you would probably have to do it with triggers. Something like, if unit construction is finished and the unit is a pylon within X range of the structure, then give it the the owner of the pylon. Since a pylon has a circular power field, just search for pylons within a certain radius of the structure.
Rollback Post to RevisionRollBack
Feel free to Send me a PM if you have any questions/concerns!
Regarding detecting when the pylon is built in a certain radius, a couple of thoughts come to mind from looking at the relevant behaviors--namely, PowerUser (Queue) and Power Source.
PowerUser (Queue) can have different effects depending the power level, so giving each player's pylons a different power level could be a means of detecting whose pylon is nearby. While the behavior options for each power level are fewer than for a regular behavior, it does include the ability enable/disable other behaviors on it. So when power level =1, the building enables a behavior that sets it to be controlled by player 1. When level=2, by player 2.
I can see some potential problems with multiple players building pylons near it, but I imagine those can be solved. I haven't tested this, so I don't know what will or will not work here.
If you just want an event to tell when the building is powered or not, give the building an attack (or a behavior) as a dummy effect and have this be enabled only when it's powered. Detect this dummy effect to know when it's been powered. You could even let the attack only affect pylons in a certain range so that the trigger event would also include the pylon powering the building.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hi,
I'm trying to build a map which has custom neutral Protoss buildings, which can be controlled by a player who powers them with a Pylon. If another player destroys the Pylon, the unpowered building reverts to neutral.
Unfortunately, I can't find a way to let a unit "see" the power radius of a unit from another team. I assume the answer lies somewhere in the Power Source and Power User behaviors, but there seems to be no way to let a Power User interact with a Power Source of another team. Is there a way to get around this?
One method I played with was using map triggers to simply detect if a Pylon was built near a neutral structure (although I would prefer to use a Data-driven method). However, I couldn't find an event that could be triggered if Building A (the Pylon) was built in a certain radius of Building B (the neutral structure).
Any thoughts on these issues would be greatly appreciated!
What happens if 2 pylons with different owners are built near a structure? Netrality?
you would probably have to do it with triggers. Something like, if unit construction is finished and the unit is a pylon within X range of the structure, then give it the the owner of the pylon. Since a pylon has a circular power field, just search for pylons within a certain radius of the structure.
Regarding detecting when the pylon is built in a certain radius, a couple of thoughts come to mind from looking at the relevant behaviors--namely, PowerUser (Queue) and Power Source.
PowerUser (Queue) can have different effects depending the power level, so giving each player's pylons a different power level could be a means of detecting whose pylon is nearby. While the behavior options for each power level are fewer than for a regular behavior, it does include the ability enable/disable other behaviors on it. So when power level =1, the building enables a behavior that sets it to be controlled by player 1. When level=2, by player 2.
I can see some potential problems with multiple players building pylons near it, but I imagine those can be solved. I haven't tested this, so I don't know what will or will not work here.
If you just want an event to tell when the building is powered or not, give the building an attack (or a behavior) as a dummy effect and have this be enabled only when it's powered. Detect this dummy effect to know when it's been powered. You could even let the attack only affect pylons in a certain range so that the trigger event would also include the pylon powering the building.