• 0

    posted a message on Reset melee map

    Hi all,

    I'm trying to make a very simple trigger (or it should be):

    If player types in "reset", then destroy all buildings, put back destructible and init as from start. I do:

    restart_game
        Events
            TriggerAddEventChatMessage(c_playerAny, "restart", true)
        Local Variables
            pl_id = 0 <int>
        Conditions
        Actions
            ForEachPlayerInGroup(pl_id, (PlayerGroupActive()))
                actions
                    PickEachUnitInGroup((UnitGroup(null, (PlayerGroupPlayer((PlayerGroupActive()), pl_id)), (RegionEntireMap()), (No Value), 0)))
                        actions
                            UnitKill((UnitGroupLoopCurrent()))
            TriggerExecute(MeleeInitialization, false, true)
    

    That kills everything. All mineral fields and vespene geysers as well. I can exclude "raw minerals" and keep the geysers, or exclude raw and mineable, but then refineries stay. Can someone please tell me how to make it just "set everything in the map as it was when starting".

    Another thing which confuses me is that after killing everything and doing: MeleeInitResources() MeleeInitUnits() MeleeInitAI() MeleeInitOptions()

    Zerg players don't have their three larva. Creating three larva for zerg players results in three "disconnected" larva, i.e. click hatchery and press s doesn't select the larva.

    I've tried searching as this feels very basic but all I come up with is threads about the ranking system.

    Posted in: Triggers
  • To post a comment, please or register a new account.