HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Who Flipped the Lever?

01-23-2008, 03:30 PM#1
Brash
Is there a way to determine which player or unit has activated the lever?

As in the "lever" destructible/doodad that flips when you click on it.
01-23-2008, 03:53 PM#2
Troll-Brain
i guess the lever die when he is activated.
You can only determine when he die, but you can detect when an unit receive an order to target a destructable (your lever)
01-23-2008, 05:30 PM#3
Brash
so i can set a variable equal to the unit that is ordered to target the lever.. there is a problem with that tho

if two people rush in to be the first to push the lever and i'm closer and i click it first and just before i actually push it the other player right-clicks it.. yet i'm the one that ends up activating it first.. he will be the last to have actually "clicked it" so he ends up being the one receiving credit for pushing it.. =( there has got to be a better way
01-23-2008, 05:37 PM#4
Troll-Brain
Unfortunately there is not an other way.
You can check the distance beetween the unit and the lever, and depends the unit determine which one will kill the lever the first, but it's really unsafe and hard to make, because you need to know the range attack, the speed attack , etc.

Edit :

the player select the lever or attack it ?!
01-23-2008, 05:55 PM#5
Brash
either way. i currently have it set so it accepts attacking or right-clicking.
01-23-2008, 06:14 PM#6
moyack
Destructable dies?? GetAttacker??
01-23-2008, 06:57 PM#7
Troll-Brain
Quote:
Originally Posted by moyack
Destructable dies?? GetAttacker??
no it doesn't work :(

But instead of use a destructable, what about use an unit with the destructable model ?
01-23-2008, 08:09 PM#8
SockSquirrelMouthwash
Quote:
Originally Posted by Brash
Is there a way to determine which player or unit has activated the lever?

As in the "lever" destructible/doodad that flips when you click on it.

One possibility is maybe detect who is near the lever when it dies. If ranged attackers can trip the lever, then it's gonna be a bit more complicated