• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Autosell System?

Status
Not open for further replies.
Level 28
Joined
Mar 25, 2008
Messages
2,955
Hi, it's me again ^^

This time i seek help concerning a system to sell all units of a player after he left.
It should be like:

Event: Player x leaves
Conditions:
Actions:
-Pick every unit in Playable Map area owned by Player x and do (actions):
Loop - actions:
--Set all_towers = Point value of picked unit
--Add all_towers to Player x's gold
--Kill all units in Playable Map area owned by Player x
(after that, the gold player x has is spread to all left players)

The problem is, after player x leaves, player y gains control over the units he left on the field and as result, the trigger doesn't do anything, cuz the units are no more owned by player x but by player y.:cry:

What am i doing wrong?
Did i forget something?
 
Level 28
Joined
Mar 25, 2008
Messages
2,955
Yup its a maul.
Umm thats what it was at the beginning. But i thought its unfair if i spread the towers left in random order to all players if one player gets a tower for 10 gold, but another gets a tower for 100 gold, y know ? :D

I just tested it - the trigger kills the worker of the player who left (thats good) and i gain control of the units the player who left has built.
This sux :(

//edit: When i tell the trigger to do "Change ownership to Random Player in Playable Map size, it obeys me -.-
 
Level 6
Joined
Sep 4, 2007
Messages
157
heres the trigger
  • Untitled Trigger 001
    • Events
      • Unit - A unit Finishes construction
    • Conditions
      • ((Triggering unit) is A structure) Equal to True
    • Actions
      • Unit - Set the custom value of (Triggering unit) to (Player number of (Owner of (Triggering unit)))
to set the custom value scroll down and find unit - set custom value
 
Status
Not open for further replies.
Top