HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Using the Controlling Player

07-11-2005, 04:01 PM#1
Peekaboo
Is there any way of getting the player that used the ability on a unit with shared control?
07-11-2005, 05:50 PM#2
vile
i dont understand your question..
getting the player that used the ability.. on a unit with shared control!?
what do you mean by "getting the player" ?
please be more specific and tell us what you're trying to do.
07-11-2005, 06:17 PM#3
Peekaboo
I want an ability on a unit that makes the player who activated it have a unit spawned (NOT a summoning spell, done with trigger - "Unit - Create" if possible). The unit with the ability does NOT belong to the player who activates the ability, it just has shared unit control with the player.
07-11-2005, 06:22 PM#4
uberfoop
quote:
NOT belong to the player who activates the ability, it just has shared unit control with the player.

if it has shared unit control, why would you be worried about this? with the shared unit control, you can control the summoned unit anyway.
07-11-2005, 06:26 PM#5
vile
eh..
if it has shared control, why just not give it control? there is no difference..
you get control either way..
07-11-2005, 06:38 PM#6
Peekaboo
Sorry it wasnt a very clear explanation...I'll post the code and show you where I'm stuck


Code:
EVENTS
Unit - A unit Finished casting an ability

CONDITIONS
(Ability being cast) Equal to SelectHero (Dummy Spell)

ACTIONS
Unit - Create 1 (Unit-type of (Casting unit)) for ([b]?Player who used the ability?[/b]) at Center of (Playable Map Area)

For Neutral Passive - turn Shared Units off towards ([b]?Player who used the ability?[/b])

The idea is that you have a room full of neutral heroes, select one, you can look at all it's abilities and attributes, then press 'Select Hero' if you want to choose it, when you do, you lose control (so you cannot choose infinite heroes) and it spawns the hero for you.
07-11-2005, 06:55 PM#7
vile
ah.
weird that you know all that trigger and you dont know this..
first of all you can just use vexorian's hero selection system which has the same idea, with alot more built-in enhanced system.

otherwise, just create a player variable with an array of number of players you got playing,
when the ability is cast, in the actions, use
Set player[(Player number of (Owner of (Casting unit)))] = (Owner of (Casting unit))

then player[the number of the casting player] is what you want to use in your defined action.
07-11-2005, 08:04 PM#8
Peekaboo
Quote:
Originally Posted by vile
otherwise, just create a player variable with an array of number of players you got playing,
when the ability is cast, in the actions, use
Set player[(Player number of (Owner of (Casting unit)))] = (Owner of (Casting unit))

then player[the number of the casting player] is what you want to use in your defined action.
Code:
Set player[(Player number of (Owner of (Casting unit)))] = (Owner of (Casting unit)) 
would do player[16] = neutral passive in my map :/

The only other way i can think of making this work is to make it so when you select a Neutral Passive unit, you gain control of it, whenever you deselect it, you lose control of it, anyone have any other ideas? :/
07-12-2005, 08:31 AM#9
mogmiester
that wouldbe the only way, but you could make it so that when you select the hero, its changed to whoever, but keeps the neutral passive colour
07-12-2005, 12:06 PM#10
BBDino
Basically there is no way to snag the player who clicked the ability button short of mogmiester's suggestion of changing ownership based on a selection event. However i'd imagine that would be extremly messy so there simply may not be a tidy way to do it.