[skip all navigation]

[Solved] How do i recreate the this "Melee" trigger?

Creator: thegameplayer
Time: Jan 14 2011, 7:26 pm
Topic Locked
Topic Locked
This topic has been locked!
Reason: solved
Closed by: Ahli

Post #1     thegameplayer Jan 14 2011, 7:26 pm

[Avatar]
offlinecontact
Rank: Member
Since the 1.2 patch messed up my hero leveling, i need to delete one of the melee triggers. But i need it, can someone help me recreate the "Melee - Set Default Options for All Players"?

Top

Post #2     Ahli Jan 14 2011, 8:07 pm

[Avatar]
Nothing yet! Almost done. Very powerful, very strong.
offlinecontact
Rank: Elite
What has that melee trigger to do with your hero leveling?

(user posted image)
Top

Post #3     thegameplayer Jan 14 2011, 8:08 pm

[Avatar]
offlinecontact
Rank: Member
That melee action prevents my hero from gaining xp through veterancy, this only happened after the patch.

Top

Post #4     Roy Jan 16 2011, 5:14 pm

[Avatar]
An artist's depiction of an Extended Unit Death
offlinecontact
Rank: Veteran
Quote from thegameplayer
That melee action prevents my hero from gaining xp through veterancy, this only happened after the patch.
Was this an actual 'fix' made by Blizzard or a side-effect of the patch?

If the latter, I'd just post on the Battle.net forums notifying them of this problem and it will be resolved in a new patch.

Top

Post #5     thegameplayer Jan 16 2011, 6:24 pm

[Avatar]
offlinecontact
Rank: Member
It was a side-effect of the patch. I don't really want to wait for a new patch. Do you know how to make a trigger that lets team 1 win if team 2 loses all their building, and vice-versa?

Top

Post #6     Ahli Jan 16 2011, 7:35 pm

[Avatar]
Nothing yet! Almost done. Very powerful, very strong.
offlinecontact
Rank: Elite
A trigger for that would be something like this. At least you should get the general idea.

Event: any unit dies
C: if it was a building (it may be called filter what you need)
A:
if( Count of units in region(buildings in area for team ...) == 0)
then - end game for team 2 in defeat.

I really need to install the EnGB version to learn the English editor texts :S

Anyway, if the problem is that the game doesn't end if the last building died, one of the units may have marked that they prevent the end of the game in the data editor. But I can't find it anymore... in the beta it was there... maybe I can't identify it because of poor localization :S

(user posted image)
Top

Post #7     thegameplayer Jan 16 2011, 10:38 pm

[Avatar]
offlinecontact
Rank: Member
I get the idea, but i cant find "Counts of units in region" and in end game for "team", it only says player. Can you do the whole trigger for me?

Top

Post #8     Ahli Jan 16 2011, 11:29 pm

[Avatar]
Nothing yet! Almost done. Very powerful, very strong.
offlinecontact
Rank: Elite
You should definitely check all units flag for the "Prevents Defeat" and try to use the default trigger.

Anyway this trigger should work. My translations might be different from what the English editor writes.
Press CTRL + D to change the view of the triggers (text & raw data).

Code

CustomWinLossTrigger
   Events
       TriggerAddEventUnitDied(null)
   Local Variables
       unitgroup = (UnitGroupEmpty()) <unitgroup>
       i = 0 <int>
   Conditions
       Comparison((UnitFilterMatch((EventUnit()),(EventPlayer()),Requires: buildings; excluded: projectiles, hidden)),==,true)
   Actions
       SetVariable(unitgroup,(UnitGroupAlliance((EventPlayer()),c_unitAllianceAlly,(RegionEntireMap()),required: buildings; excluded: projectiles, Tot, hidden,1)))
       IfThenElse()
           if
               Comparison((UnitGroupCount(unitgroup,c_unitCountAlive)),==,0)
           then
               ------- 1 to teamcount (e.g. 2... 16 should cover everything)
               ForEachInteger(i,1,16,1)
                   actions
                       IfThenElse()
                           if
                               Comparison((PlayerGroupHasPlayer((GameAttributePlayersForTeam(i)),(EventPlayer()))),==,true)
                           then
                               PickEachPlayerInGroup((GameAttributePlayersForTeam(i)))
                                   actions
                                       GameOver((PlayerGroupLoopCurrent()),c_gameOverDefeat,true,true)
                           else
                               PickEachPlayerInGroup((GameAttributePlayersForTeam(i)))
                                   actions
                                       GameOver((PlayerGroupLoopCurrent()),c_gameOverVictory,true,true)
           else

(user posted image)
Top

Post #9     Roy Jan 16 2011, 11:39 pm

[Avatar]
An artist's depiction of an Extended Unit Death
offlinecontact
Rank: Veteran
I typed up a very similar way to do this.

DefeatTrigger
    Events
        Unit - Any Unit dies
    Local Variables
        Team1 = (Players on team 1) <Player Group>
        Team2 = (Players on team 2) <Player Group>
        Team1Group = (Empty unit group) <Unit Group>
        Team2Group = (Empty unit group) <Unit Group>
    Conditions
        ((Unit type of (Triggering unit)) has Structure attribute) == true
    Actions
        Player Group - Pick each player in Team1 and do (Actions)
            Actions
                Unit Group - Add all units in (Any units in (Entire map) owned by player (Picked player) matching Required: Structure; Excluded: Missile, Dead, Hidden, with at most Any Amount) to Team1Group
        Player Group - Pick each player in Team2 and do (Actions)
            Actions
                Unit Group - Add all units in (Any units in (Entire map) owned by player (Picked player) matching Required: Structure; Excluded: Missile, Dead, Hidden, with at most Any Amount) to Team2Group
        General - If (Conditions) then do multiple (Actions)
            If Then Else
                General - Else if (Conditions) then do (Actions)
                    Else If
                        (Number of Living units in Team1Group) <= 0
                    Then
                        Player Group - Pick each player in Team1 and do (Actions)
                            Actions
                                Game - End game in Defeat for player (Picked player) (Show dialogs, Show score screen)
                        Player Group - Pick each player in Team2 and do (Actions)
                            Actions
                                Game - End game in Victory for player (Picked player) (Show dialogs, Show score screen)
                General - Else if (Conditions) then do (Actions)
                    Else If
                        (Number of Living units in Team2Group) <= 0
                    Then
                        Player Group - Pick each player in Team1 and do (Actions)
                            Actions
                                Game - End game in Victory for player (Picked player) (Show dialogs, Show score screen)
                        Player Group - Pick each player in Team2 and do (Actions)
                            Actions
                                Game - End game in Defeat for player (Picked player) (Show dialogs, Show score screen)

Top

Post #10     thegameplayer Jan 17 2011, 1:55 am

[Avatar]
offlinecontact
Rank: Member
Thank you both for replying. I used Roy's way and it works perfectly. Thanks a lot, no one from sc2mapster helped me on this. How do i make this thread "Solved"?

Top

Post #11     Ahli Jan 17 2011, 2:06 am

[Avatar]
Nothing yet! Almost done. Very powerful, very strong.
offlinecontact
Rank: Elite
You can report it and write solved or something like that. Then some moderator will close it.

(user posted image)
Top
Topic Locked
Topic Locked
This topic has been locked!
Reason: solved
Closed by: Ahli
0 members in this topic (italic members are currently writing a reply): None
+ guest(s)


[05:14 am]
RIVE -- I pray to Mozzarella because I fear the Rapture.
[04:42 am]
jjf28 -- it's evil, pure, demonic, evil
[04:42 am]
jjf28 -- nothin' holy bout dat holey cheese
[04:22 am]
Dem0n -- also get on skype XD
[04:21 am]
Dem0n -- I'm curently eating pepper jack cheese :O
[04:18 am]
lil-Inferno -- Only Swiss cheese is holy
[04:18 am]
Dem0n -- WUT EAT]\
Please log in to shout.