• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] Problems with Multiboard and Respawn System

Status
Not open for further replies.
Level 31
Joined
Apr 17, 2009
Messages
3,571
Hey Guys.

I have some major problems with my Respawn System and the Kills/Death Multiboard for my Dead Space Map.

When I test the map out of World Editor as Single Player everything works as it should.

After I've chosen my hero, the Multiboard appears.
When my hero gets killed, I get properly respawned.

But if I test it on BattleNet with more than one player, everything bugs.
The Multiboard doesn't show up at all and sometimes, which is weird because it happens sometimes, but sometimes not, the hero of a player doesn't get respawned.

For the Multiboard, I have a little clue what the problem is:
I use an Integer Variable which saves the numbers of playing players (human controllers) then I set a second variable to be same as the PlayingPlayers Integer, called HeroChoosingPlayers or something like that, which saves the numbers of players who haven't chosen a hero yet.

Now everytime a player chooses a hero, the HeroChoosingPlayers is set -1.
Then there's a if condition, if this variable becomes 0, the Multiboard gets shown.

I also made a little test trigger which shows the current data of this variable (just type "-test001" ingame)

It happened that when I tested it with many players this variable became somehow -1 even if hadn't chosen my hero yet.
Or it happened that 1 player chose a hero and me and a friend hadnt chosen yet and it runned the Multiboard trigger.
Somehow the setting of playing players is bugged.


For the respawn system I have no clue.

Please help me with this shitty problem.
I can't find any mistakes in my coding.
I will give you a great amount of rep and big credits if you help me fixing this.

Here's the map:
http://www.hiveworkshop.com/forums/...ad-space-arena-179112/index4.html#post1724434
 
Level 19
Joined
Feb 4, 2009
Messages
1,313
somehow I could not find this anywhere:
  • Multiboard - Show Multiboard
might just be me though

usually you create the multiboard at map ini (one for every player) and show them with GetLocalPlayer based on player number and then update the data instead of destroying and creating it again

also there are no bugs for integer a/b at all as long as you don't call waits in the loops (and if you are calling waits you are dead anyway x)
 
Last edited:
Did you not listen to D4RK_G4ND4LF?
Your trigger 'All VS All Multiboard', the one that runs every second, it doesn't have 'Show Multiboard'. You are constantly destroying it, but not showing it!
Add this to that trigger.
  • Actions
    • Custom script: if GetLocalPlayer () == (Player(GetForLoopIndexA())) then
    • Multiboard - Show Multiboard
    • Custom script: endif
 
Level 13
Joined
Mar 24, 2010
Messages
950
But if I test it on BattleNet with more than one player, everything bugs.
The Multiboard doesn't show up at all and sometimes, which is weird because it happens sometimes, but sometimes not, the hero of a player doesn't get respawned.

For the Multiboard, I have a little clue what the problem is:
I use an Integer Variable which saves the numbers of playing players (human controllers) then I set a second variable to be same as the PlayingPlayers Integer, called HeroChoosingPlayers or something like that, which saves the numbers of players who haven't chosen a hero yet.

Now everytime a player chooses a hero, the HeroChoosingPlayers is set -1.
Then there's a if condition, if this variable becomes 0, the Multiboard gets shown.

I also made a little test trigger which shows the current data of this variable (just type "-test001" ingame)

It happened that when I tested it with many players this variable became somehow -1 even if hadn't chosen my hero yet.
Or it happened that 1 player chose a hero and me and a friend hadnt chosen yet and it runned the Multiboard trigger.
Somehow the setting of playing players is bugged.


For the respawn system I have no clue.

Please help me with this shitty problem.
I can't find any mistakes in my coding.
I will give you a great amount of rep and big credits if you help me fixing this.

Here's the map:
http://www.hiveworkshop.com/forums/...ad-space-arena-179112/index4.html#post1724434

You shouldn't have it set up that way because when you -1 each time a player picks a hero what if a player leaves before picking or lags out at game start?

As for the multiboard problems i'll take a look and fix it but first let me know the names of the triggers your concerned with please, i'm not sure how many there is or how hard they might be to find in your map lol.



Edit:
eh i took a look, i think i found one of your big problems, in the Variable Presetting

  • 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))) controller) Equal to User
          • ((Player((Integer A))) slot status) Equal to Is playing
        • Then - Actions
          • Set PlayingPlayers[1] = (PlayingPlayers[1] + 1)
        • Else - Actions
  • Set HeroChoosingPlayers[1] = PlayingPlayers[1]
you need
  • Set HeroChoosingPlayers[1] = PlayingPlayers[1]
outside of the loop :)




Edit2:

  • Hero Selection Camera
    • Events
    • Conditions
    • Actions
      • Cinematic - Disable user control for (All players)
      • Set TempPosition[1] = (Position of Hero Selection 0032 <gen>)
      • Cinematic - Fade in over 8.00 seconds using texture Black Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Visibility - Create an initially Enabled visibility modifier for (Player((Integer A))) emitting Visibility across HeroSelectionArea <gen>
          • Visibility - Enable (Last created visibility modifier)
          • Set HS_VisibilityModifier[(Integer A)] = (Last created visibility modifier)
          • Camera - Pan camera for (Player((Integer A))) to TempPosition[1] over 0.00 seconds
          • Wait 0.10 seconds
          • Camera - Lock camera target for (Player((Integer A))) to Hero Selection 0032 <gen>, offset by (0.00, 0.00) using Default rotation
          • Camera - Rotate camera 720.00 degrees around TempPosition[1] for (Player((Integer A))) over 120.00 seconds
      • -------- /////////////////////////////////////////////////////////////////// --------
      • Unit Group - Add T51b 0028 <gen> to HS_GroupA
      • Unit Group - Add Aghishoz 0026 <gen> to HS_GroupA
      • Unit Group - Add HCR-328 0027 <gen> to HS_GroupA
      • Unit Group - Add Corporal B76 0030 <gen> to HS_GroupA
      • Unit Group - Add Zzirrapz 0029 <gen> to HS_GroupA
      • Unit Group - Add Sylvanas Windrunner 0001 <gen> to HS_GroupA
      • Unit Group - Add Nadrezoid 0016 <gen> to HS_GroupA
      • Unit Group - Add Arthas 0002 <gen> to HS_GroupA
      • Unit Group - Pick every unit in HS_GroupA and do (Actions)
        • Loop - Actions
          • Unit - Change color of (Picked unit) to Black
          • Hero - Modify unspent skill points of (Picked unit): Set to 0 points
          • Custom script: call UnitRemoveAbility(GetEnumUnit(),'Amov')
          • Custom script: call UnitRemoveAbility(GetEnumUnit(),'Aatk')
          • Unit - Add Sell Units to (Picked unit)
          • Neutral Building - Add Hero Selection to (Picked unit) with 1 in stock and a max stock of 1
          • Unit - Make (Picked unit) Invulnerable
      • Wait 2.00 seconds
      • Cinematic - Enable user control for (All players)
      • Game - Display to (All players) for 30.00 seconds the text: |c00800000C|c008801...
      • Custom script: call RemoveLocation (udg_TempPosition[1])
that .1 sec wait in this loop int A can cause huuuge problems as intA is used for aLot of triggers and can easily overlap not to mention can cause problems within this trigger and loop in itself.

I do not believe a wait is necessary but if it is you should use wait 0.00 secs but i wouldn't even use that tbh.

Want me to just make all these fixes and re-give you the map? you decide what you would like to do.

Also i dont see where the events of "Hero Selection Camera" are located or if there is no events what trigger runs this trigger when ran?
 
Last edited:
Found the problem. Your Respawn timer event needs to be added at the bottom of the Map Initialisation trigger.
  • Actions
    • -------- Use this for MPI event adding --------
    • For each (Integer A) from 1 to 8, do (Actions)
      • Loop - Actions
        • Trigger - Add to Select Hero <gen> the event (Player - (Player((Integer A))) Selects a unit)
        • Trigger - Add to Respawn02 <gen> the event (Time - RespawnTimer[(Integer A)] expires)
I also wanted to add the events to Select Hero with the same method, just to show you how to efficiently add MPI events without up to 12 different events.
You can also use Pick Every Player in Player Group instead of For Each Integer.

Additional fixes:
This fixes up the camera in Hero Selection Camera. Note that Lock Camera Target does not require a Pan Camera action before it.
  • Actions
    • For each (Integer A) from 1 to 6, do (Actions)
      • Loop - Actions
        • Visibility - Create an initially Enabled visibility modifier for (Player((Integer A))) emitting Visibility across HeroSelectionArea <gen>
        • Visibility - Enable (Last created visibility modifier)
        • Set HS_VisibilityModifier[(Integer A)] = (Last created visibility modifier)
        • Camera - Lock camera target for (Player((Integer A))) to Hero Selection 0032 <gen>, offset by (0.00, 0.00) using Default rotation
    • Wait 0.10 seconds
    • For each (Integer B) from 1 to 6, do (Actions)
      • Loop - Actions
        • Camera - Rotate camera 720.00 degrees around TempPosition[1] for (Player((Integer B))) over 120.00 seconds
This compensates for players who leave the game whilst choosing.
  • For each (Integer A) from 1 to 8, do (Actions)
    • Loop - Actions
      • Trigger - Add to Leave Game <gen> the event (Player - (Player((Integer A))) leaves the game)
  • Leave Game
    • Events
    • Conditions
      • HeroChoosingPlayers[1] Greater than 0
    • Actions
      • Set HeroChoosingPlayers[1] = (HeroChoosingPlayers[1] - 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • HeroChoosingPlayers[1] Equal to 0
        • Then - Actions
          • Unit - Remove Zzirrapz 0029 <gen> from the game
          • Unit - Remove T51b 0028 <gen> from the game
          • Unit - Remove Aghishoz 0026 <gen> from the game
          • Unit - Remove HCR-328 0027 <gen> from the game
          • Unit - Remove Nadrezoid 0016 <gen> from the game
          • Unit - Remove Sylvanas Windrunner 0001 <gen> from the game
          • Unit - Remove Arthas 0002 <gen> from the game
          • Unit - Remove Corporal B76 0030 <gen> from the game
          • Unit - Remove Hero Selection 0032 <gen> from the game
          • Trigger - Turn on All VS All Multiboard <gen>
        • Else - Actions
This, like I posted before, shows the Multiboard.
  • For each (Integer A) from 1 to (PlayingPlayers[1] + 3), do (Actions)
    • Loop - Actions
      • Multiboard - Set the width for (Last created multiboard) item in column 1, row (Integer A) to 10.00% of the total screen width
      • Multiboard - Set the width for (Last created multiboard) item in column 2, row (Integer A) to 10.00% of the total screen width
      • Multiboard - Set the display style for (Last created multiboard) item in column 2, row (Integer A) to Show text and Hide icons
      • Multiboard - Set the width for (Last created multiboard) item in column 3, row (Integer A) to 10.00% of the total screen width
      • Multiboard - Set the display style for (Last created multiboard) item in column 3, row (Integer A) to Show text and Hide icons
      • 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
          • Multiboard - Set the text for (Last created multiboard) item in column 1, row ((Integer A) + 3) to PlayerColourName[(Integer A)]
          • Multiboard - Set the icon for (Last created multiboard) item in column 1, row ((Integer A) + 3) to HeroIcon[(Point-value of ChosenHero[(Integer A)])]
          • Multiboard - Set the text for (Last created multiboard) item in column 2, row ((Integer A) + 3) to (String(Kills[(Integer A)]))
          • Multiboard - Set the text for (Last created multiboard) item in column 3, row ((Integer A) + 3) to (String(Deaths[(Integer A)]))
          • Custom script: if GetLocalPlayer () == (Player(GetForLoopIndexA())) then
          • Multiboard - Show Multiboard
          • Custom script: endif
        • Else - Actions
I would have attached the map, but most of the triggers, except the above, were fine.
 
Last edited:
Status
Not open for further replies.
Top