SC2Mapster Forums

Development > Triggers

How to find out who trained a unit?

  • 4 posts
    #1 Dec 04, 2012 at 13:35 UTC - 0 likes

    Hello,

    I'm currently working on a Tug of War Map and i want to do the following:

    Each Player in a Team can train units, in buildings, which belong to an allied computer player. Every time a unit is trained by a player, it will be added to the unit pool tat spawns with each wave and increase the income of the player who trained the unit.

    The problem i am encountering now, is the following: How do i find out, who trained the unit, when the building the unit is trained, belongs to a different player with shared control? I tried the "Any unit training progress" event, but it didnt work since i cannot find out who issued the train command.

    Any ideas?

    #2 Dec 04, 2012 at 21:23 UTC - 1 like

    I would imagine you need to take a different approach and store the unIt's trained by each player in advance.

    Current Project: Community Project

    #3 Dec 04, 2012 at 21:31 UTC - 0 likes

    I don't think a hook exists for finding a player who issues orders to a unit under another player's control. I recommend giving each player his own building or use dialog items to train units.

    My Projects:
    Malum Ruina: SC2Mapster
    Eternal Exile: SC2Mapster
    Spine Crawler Madness: SC2Mapster
    Xeno Crisis: SC2Mapster

    #4 Dec 05, 2012 at 07:47 UTC - 0 likes
    Quote from nevjmac: Go

    I would imagine you need to take a different approach and store the unIt's trained by each player in advance.

    I would suggest this too myself. Just inserting the player integer who trained it into the units custom value would work perfectly.

    When I want your opinion...I'll give it to you!

    http://www.sc2pod.com/achievement.php?id=13361

  • 4 posts

You must login to post a comment. Don't have an account? Register to get one!