• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

This sometimes fails

Status
Not open for further replies.
Level 18
Joined
May 11, 2012
Messages
2,103
  • Kick Player Blue
    • Events
      • Player - Player 1 (Red) types a chat message containing -kick player blue as An exact match
      • Player - Player 1 (Red) types a chat message containing -kick player 2 as An exact match
    • Conditions
    • Actions
      • Game - Defeat Player 2 (Blue) with the message: (You were kicked by + (|c00FF0000 + (Name of Player 1 (Red))))
  • Player Blue left
    • Events
      • Player - Player 2 (Blue) leaves the game
      • Player - Player 2 (Blue) leaves the game with a defeat
    • Conditions
    • Actions
      • Set Leaver[2] = (Triggering player)
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units owned by Leaver[2] matching (((Matching unit) is A structure) Equal to False)) and do (Actions)
        • Loop - Actions
          • For each (Integer A) from 1 to 6, do (Actions)
            • Loop - Actions
              • Hero - Drop the item from slot (Integer A) of (Picked unit)
          • Unit - Remove (Picked unit) from the game
      • Game - Display to (All players) the text: ((|c000000FF + (Name of Leaver[2])) + |c00FF0000has left the game :()
      • Game - Display to (All players) the text: |c00FFD700His sourc...
      • Leaderboard - Change the label for Leaver[2] in LeaderBoard to >>> Left the Game <...
      • Set PlayerSlotStatusInteger = (PlayerSlotStatusInteger - 1)
      • Trigger - Turn on Sharing Gold From Leavers <gen>
      • For each (Integer A) from 1 to 8, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Player((Integer A))) slot status) Equal to Is playing
            • Then - Actions
              • Set TempInt = ((Leaver[2] Current gold) / PlayerSlotStatusInteger)
              • Set TempInt2 = ((Leaver[2] Current lumber) / PlayerSlotStatusInteger)
              • Player - Add TempInt to (Player((Integer A))) Current gold
              • Player - Add TempInt2 to (Player((Integer A))) Current lumber
            • Else - Actions
this sometimes fails and the second trigger does not runs when hero leaves by itself, not with defeat. Why so?

Also, are those 2 event same? will the event with defeat run if the hero leaves by itself?
 
Level 25
Joined
Sep 26, 2009
Messages
2,378
If you look at the event "Player - Leaves Game" in the event menu, you can see there is a hint written under it saying "This event occurs regardless of how the player left the game"; so my guess is yes it does fire if player leaves and if he loses.

You can make the second trigger work for all players - instead of setting X in Leavers[X] to a specific value, you can set it as player number (found under integer -> Player - Player number).

You could only pick up heroes into the group and cycle through them to make them drop their items. Normal units' inventory has set by default that the unit drops all items upon death.
Also, what happens to buildings? I see you pick up units, make them drop items and then you remove them from the game, but nothing with buildings.
Maybe you could just pick every unit from the player and then through ITE check if it is hero - if it is, use loop to make them remove each item, then remove them. If it's not hero, kill them first and them remove them - that should make them drop items immediately.
 
Level 25
Joined
Sep 26, 2009
Messages
2,378
I did read it, but I'm not that good with these things - so I offered at least something I could help with.

Anyway, who do you test these triggers with? My tests failed, but they were against PC. I can assume that those triggers don't fire simply because PC doesn't leave the game after he loses, so if you didn't test it with another player, you may want to give it a shot

Edit: further test revealed that for the first trigger to work against computer, you need to have this
  • Melee
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Melee Game - Enforce victory/defeat conditions (for all players)
 
Level 18
Joined
May 11, 2012
Messages
2,103
with ally heroes lol.
Actually, 2 times the trigger betrayed me. For player 4 and player 8 (both are same eventyhing is same)
So, i don't know, but my map ahs something against me, it always fuck up smth, never works like it should lol
 
Level 25
Joined
Sep 26, 2009
Messages
2,378
with ally heroes lol.
Actually, 2 times the trigger betrayed me. For player 4 and player 8 (both are same eventyhing is same)
So, i don't know, but my map ahs something against me, it always fuck up smth, never works like it should lol
Ally heroes? As in allied users? As I wrote, if triggering player of your trigger2 is Computer, it seems he doesn't leave the game into scores like user-players do. He won't even "leave" the game so it won't work.

Does this message fire when someone leaves the game?
"Game - Display to (All players) the text: ((|c000000FF + (Name of Leaver[2])) + |c00FF0000has left the game :()"

Well you have some useless actions in your trigger - like this Set Leaver[2] = (Triggering player). Why even set this when the trigger can be fired only by one player?
Then death always says that (Integer A) is buggy, so to use your own integer instead.

The map is as efficient as the map maker made it :)
 
Level 18
Joined
May 11, 2012
Messages
2,103
Ally heroes? As in allied users? As I wrote, if triggering player of your trigger2 is Computer, it seems he doesn't leave the game into scores like user-players do. He won't even "leave" the game so it won't work.

Does this message fire when someone leaves the game?
"Game - Display to (All players) the text: ((|c000000FF + (Name of Leaver[2])) + |c00FF0000has left the game :()"

Well you have some useless actions in your trigger - like this Set Leaver[2] = (Triggering player). Why even set this when the trigger can be fired only by one player?
Then death always says that (Integer A) is buggy, so to use your own integer instead.

The map is as efficient as the map maker made it :)

I set the leaver because I'm using it in other trigger -.-
yes, it does fires
I said, the trigger doesn't runs, not that actions aren't working -.-
Do you know the reason why the trigger sometimes fails to run? stop talking about actions, they do their job as I want to...

Ally heroes? As in allied users? As I wrote, if triggering player of your trigger2 is Computer, it seems he doesn't leave the game into scores like user-players do. He won't even "leave" the game so it won't work.
It is user controlled player
 
Level 25
Joined
Sep 26, 2009
Messages
2,378
My question about the game message was because it requires nothing, except the event to be fired. If the message does not show up, then the trigger has not been fired.

If the trigger sometimes run and sometimes doesn't, then the only things that could cause the problem could be
a) some other trigger switches this one off
b) this event fires only when player goes to score screen. If he remains in game (doesn't click the button to go to score screen, etc.), then it won't fire.
 
Level 3
Joined
Apr 10, 2013
Messages
8
I think It is b) as nichilus said. It wont run if a computer is in the game it has to be a user
 
Level 3
Joined
Apr 10, 2013
Messages
8
Hmm well I did a test
  • kick
    • Events
      • Player - Player 1 (Red) types a chat message containing - as An exact match
    • Conditions
    • Actions
      • Game - Defeat Player 2 (Blue) with the message: Defeat!
  • left game
    • Events
      • Player - Player 2 (Blue) leaves the game
      • Player - Player 2 (Blue) leaves the game with a defeat
    • Conditions
    • Actions
      • Game - Display to (All players) the text: hi
This works (tried with a computer) and it really SHOULD work if player 2 leaves by itself
 
Level 18
Joined
May 11, 2012
Messages
2,103
yeah, it works.. And I didn't said it doesn't works...
But my prob is that the trigger SOMETIMES doesn't fires when a player leaves, and that leads other players to be unable to proceed with game....
sometimes it does and sometimes it doesn't -.-
hate myself lol
 
Status
Not open for further replies.
Top