• 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.

Please Help ..

Status
Not open for further replies.
Level 6
Joined
Jun 20, 2012
Messages
195
i need help for my map..
please try and tell me if there is anything wrong with this..
im trying to make triggers when my boss golem dies, a yellow light (dummy unit) will travel to the killing units position, and if owner of killing unit has an alive hero, a dummy ability will be added to that hero wherever he is on map, but if he dies or the integer becomes 0, the dummy spell will be removed from him.

FIRST TRIGGER:
  • Gold Golem Dies
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to Boss Golem (Gold Golem)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • gs2 Equal to 0
        • Then - Actions
          • Trigger - Turn on Gold Golem Dies Loop <gen>
        • Else - Actions
      • Set gs2 = (gs2 + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • gs2 Greater than gs_max
        • Then - Actions
          • Set gs[gs2] = gs2
          • Set gs_max = gs2
        • Else - Actions
      • Set gs_array = gs[gs2]
      • Set gs_killer[gs_array] = (Killing unit)
      • Set gs_temploc[gs_array] = (Position of gs_killer[gs_array])
      • Set gs_golem[gs_array] = (Dying unit)
      • Set gs_deadloc[gs_array] = (Position of gs_golem[gs_array])
      • Set BOSS_COUNT[3] = 0
      • Player - Disable Golden Sword Book for (Owner of gs_killer[gs_array])
      • Player Group - Pick every player in (Player group((Owner of gs_killer[gs_array]))) and do (Actions)
        • Loop - Actions
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units owned by (Owner of gs_killer[gs_array]) matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)
            • Loop - Actions
              • Unit Group - Add (Picked unit) to BOSS_KILL_TEAM
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in BOSS_KILL_TEAM) Greater than 0
        • Then - Actions
          • Set BOSS_OFF = True
        • Else - Actions
      • Unit - Create 1 GOLDEN SWORD for (Owner of gs_killer[gs_array]) at gs_deadloc[gs_array] facing Default building facing degrees
      • Set gs_sword[gs_array] = (Last created unit)
      • Set gs_tic[gs_array] = 14000
      • Set gs_check[gs_array] = True
      • Custom script: call RemoveLocation(udg_gs_deadloc[udg_gs_array])
SECOND TRIGGER:
  • Gold Golem Dies Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer gs_loop) from 1 to gs2, do (Actions)
        • Loop - Actions
          • Set gs_array = gs[gs_loop]
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • gs_check[gs_array] Equal to True
            • Then - Actions
              • Set gs_temploc[gs_array] = (Position of gs_killer[gs_array])
              • Set gs_location[gs_array] = (Position of gs_sword[gs_array])
              • Set gs_move[gs_array] = (gs_location[gs_array] offset by 15.00 towards (Angle from gs_location[gs_array] to gs_temploc[gs_array]) degrees)
              • Unit - Move gs_sword[gs_array] instantly to gs_move[gs_array]
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Distance between gs_location[gs_array] and gs_temploc[gs_array]) Less than or equal to 100.00
                • Then - Actions
                  • Custom script: call RemoveLocation(udg_gs_move[udg_gs_array])
                  • Custom script: call RemoveLocation(udg_gs_temploc[udg_gs_array])
                  • Custom script: call RemoveLocation(udg_gs_location[udg_gs_array])
                  • Unit - Kill gs_sword[gs_array]
                  • Unit - Add Golden Sword Book to gs_killer[gs_array]
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Owner of gs_killer[gs_array]) is in alliance) Equal to True
                    • Then - Actions
                      • Game - Display to alliance the text: |c00FFFF00Slay Team...
                      • Game - Display to horde the text: |c000042FFTEAM 2:|r...
                      • Cinematic - Ping minimap for (Player group((Owner of gs_killer[gs_array]))) at (Center of Team2 <gen>) for 1.00 seconds
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • ((Owner of gs_killer[gs_array]) is in horde) Equal to True
                        • Then - Actions
                          • Game - Display to horde the text: |c00FFFF00Slay Team...
                          • Game - Display to alliance the text: |c00FF0303TEAM 1:|r...
                          • Cinematic - Ping minimap for (Player group((Owner of gs_killer[gs_array]))) at (Center of Team1 <gen>) for 1.00 seconds
                        • Else - Actions
                  • Set gs_check[gs_array] = False
                • Else - Actions
              • Custom script: call RemoveLocation(udg_gs_move[udg_gs_array])
              • Custom script: call RemoveLocation(udg_gs_temploc[udg_gs_array])
              • Custom script: call RemoveLocation(udg_gs_location[udg_gs_array])
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • gs_check[gs_array] Equal to False
            • Then - Actions
              • Player Group - Pick every player in (Player group((Owner of gs_killer[gs_array]))) and do (Actions)
                • Loop - Actions
                  • Custom script: set bj_wantDestroyGroup = true
                  • Unit Group - Pick every unit in (Units owned by (Owner of gs_killer[gs_array]) matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)
                    • Loop - Actions
                      • Unit - Add Golden Sword Book to (Picked unit)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • BOSS_OFF Equal to False
                • Then - Actions
                  • Set gs_tic[gs_array] = 0
                • Else - Actions
                  • Set gs_tic[gs_array] = (gs_tic[gs_array] - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • gs_tic[gs_array] Equal to 0
                      • BOSS_COUNT[3] Equal to 1
                • Then - Actions
                  • Custom script: set bj_wantDestroyGroup = true
                  • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
                    • Loop - Actions
                      • Unit - Remove Golden Sword Book from (Picked unit)
                      • Unit - Remove Golden Sword buff from (Picked unit)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • BOSS_COUNT[3] Equal to 0
                    • Then - Actions
                      • Game - Display to (All players) the text: |c00FFFF00The Gold ...
                      • Unit - Create 1 Boss Golem (Gold Golem) for Neutral Hostile at (Center of Gold Golem Rect <gen>) facing Default building facing degrees
                      • Animation - Play (Last created unit)'s birth animation
                      • Unit - Change color of (Last created unit) to Yellow
                      • Set BOSS_COUNT[3] = 1
                    • Else - Actions
                  • Set gs[gs_loop] = gs[gs2]
                  • Set gs[gs2] = gs_array
                  • Set gs2 = (gs2 - 1)
                  • Set gs_loop = (gs_loop - 1)
                • Else - Actions
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • gs2 Equal to 0
            • Then - Actions
              • Trigger - Turn off (This trigger)
            • Else - Actions
THIRD TRIGGER:
  • Gold Golem Hero Dies
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is in BOSS_KILL_TEAM) Equal to True
    • Actions
      • Unit Group - Remove (Triggering unit) from BOSS_KILL_TEAM
      • Set BOSS_OFF = False

please help ...T_T
 
Level 5
Joined
Jun 16, 2004
Messages
108
You do not have to repost it, it has been moved to the right forum for you.

Secondly, it is good that you explained what you want your trigger to do, but you have not explained what, if anything, is wrong with it. It would be helpful if you could point out what specifically goes wrong, give a list of things even.

You might also consider posting your map for fixing.
 
Level 5
Joined
Jun 16, 2004
Messages
108
Well I looked at it quickly and posted what I think are leaks or other problems, check them yourself.

Location leaks:
Cinematic - Ping minimap for (Player group((Owner of gs_killer[gs_array]))) at (Center of Team2 <gen>) for 1.00 seconds
Cinematic - Ping minimap for (Player group((Owner of gs_killer[gs_array]))) at (Center of Team1 <gen>) for 1.00 seconds
Unit - Create 1 Boss Golem (Gold Golem) for Neutral Hostile at (Center of Gold Golem Rect <gen>) facing Default building facing degrees

Looks like you might never clean up this call in the first trigger:
Set gs_temploc[gs_array] = (Position of gs_killer[gs_array])

You seem to call these twice when the if conditional passes in the second trigger:
Custom script: call RemoveLocation(udg_gs_move[udg_gs_array])
Custom script: call RemoveLocation(udg_gs_temploc[udg_gs_array])
Custom script: call RemoveLocation(udg_gs_location[udg_gs_array])
 
Level 5
Joined
Jun 16, 2004
Messages
108
  • Unit - Move (Triggering unit) instantly to (Center of (Playable map area))
Transforms into this:
JASS:
call SetUnitPositionLoc( GetTriggerUnit(), GetRectCenter(GetPlayableMapRect()) )
And in particular, GetRectCenter does this:
JASS:
function GetRectCenter takes rect whichRect returns location
    return Location(GetRectCenterX(whichRect), GetRectCenterY(whichRect))
endfunction

So yes, every center of region you do in GUI creates a new location.
 
Level 6
Joined
Jun 20, 2012
Messages
195
so I just hav to transform those things you mentioned as leaking into a custom script ..?

what is the jass form of the "Cinematic - Ping minimap for (Player group((Owner of gs_killer[gs_array]))) at (Center of Team2 <gen>) for 1.00 seconds" ?
 
Level 5
Joined
Jun 16, 2004
Messages
108
You would only need to set the center of region calls to a location/point variable first and remove it later, like you have been doing for other things.
 
Status
Not open for further replies.
Top