actually there is no trick to spawn hero equal to what the player pick. simply just create a region around the tavern, and create the trigger:
if unit enter tavern region then move unit instantly to region near the fountain
if you want each player can only has 1 hero and no other players can pick same hero, make it like this:
if unit enter tavern region then - set limit training of hero for owner of triggering unit to 0 - Pick every player on allplayer and do set limit training of unit type of triggering unit to 0
the first point suppose to limit the owner of triggering unit to pick another hero, so he only has the hero that he just already choose.
the second one suppose to limit another player so each player cannot pick that hero type.
I was like u too, for the first time i see dota hero selection system, but then i figure it out that it's not as hard as i think.
i get this error: call TriggerRegisterEnterRegionSimple( gg_trg_Spawning, Rect2Region(gg_rct_Tavern) )
the GUI trigger i used was:
Unit - Enters (Convert tavern <gen> to region) Conditions - Triggering Units Is A hero = True Action - Movie (Matching Unit) instantly to Center of Spawn <gen>
instead of matching unit i also tried triggering unit.. same error
I think u can use just GUI trigger, not need for script, coz i didn't know about script and i can make that trigger
Just try to make 2 regions, one nearby the tavern (TavernReg)and the other nearby the fountain (FountainReg), and make this trigger:
Events: Unit - Enters TavernReg Conditions - Triggering Unit Is A hero = True Action - Move Triggering Unit instantly to Center of FountainReg
If it works you can modify that trigger further, like limit trainin of hero and limit training of unit.
And remember this, there must be TRIGGERING UNIT since:
TRIGGERING UNIT: Used to represent unit that causing the triger works. MATCHING UNIT: Used to represent unit that was checked its condition when you pick up every unit on unit group with matching condition. PICKED UNIT: Used to represent unit that was picked, after the matching condition filter was done.
and many more variables that you must know what those variables represent for.