Server Split causing trigger

Reaction score
149
I have asked for solutions to this tirgger, I've looked it through many times and I still can't get it to work. It works perfectly on singleplayer, but on multiplayer it causes server splits.
Maybe somehow someone can see the problem, or am I forced to remove this trigger?

It is supposed to set up hero abilities and their requirements for the next level up.

Code:
SettingUp
    Events
        Unit - A unit enters (Playable map area)
    Conditions
        ((Triggering unit) is A Hero) Equal to True
    Actions
        Set tempHero = (Triggering unit)
        Set tempPlayer = (Owner of tempHero)
        Set tempInt = (Player number of tempPlayer)
        Set checkHero[tempInt] = True
        Set Hero[tempInt] = tempHero
        For each (Integer A) from 1 to Abilities_Index, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Hero_AbilityType1[tempInt] Equal to Unselected Ability 
                        (Level of Hero_Abilities[(Integer A)] for tempHero) Greater than 0
                    Then - Actions
                        Set Hero_AbilityType1[tempInt] = Hero_Abilities[(Integer A)]
                        Set Hero_AbilityLevel_I[tempInt] = (Level of Hero_AbilityType1[tempInt] for tempHero)
                        Custom script:   if GetLocalPlayer() == udg_tempPlayer then
                        Game - Display to (All players) the text: Player Check = True
                        Multiboard - Hide SkillBoard[tempInt]
                        Multiboard - Set the text for SkillBoard[tempInt] item in column 2, row 1 to ((Name of Hero_AbilityType1[tempInt]) + :)
                        Multiboard - Set the text for SkillBoard[tempInt] item in column 3, row 1 to (((String(Hero_AbilityExpierence_I[tempInt])) +  / ) + (String((Hero_AbilityLevel_I[tempInt] x 16))))
                        Multiboard - Show SkillBoard[tempInt]
                        Custom script:   endif
                    Else - Actions
 

Jazradel

Helping people do more by doing less.
Reaction score
102
I'm going to blame Multiboard - Set the text. It will be something inside the GetLocalPlayer() bit at any rate.
 

Chocobo

White-Flower
Reaction score
409
You really need a GetLocalPlayer() for the rest expect the show?

Code:
SettingUp
    Events
        Unit - A unit enters (Playable map area)
    Conditions
        ((Triggering unit) is A Hero) Equal to True
    Actions
        Set tempHero = (Triggering unit)
        Set tempPlayer = (Owner of tempHero)
        Set tempInt = (Player number of tempPlayer)
        Set checkHero[tempInt] = True
        Set Hero[tempInt] = tempHero
        For each (Integer A) from 1 to Abilities_Index, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Hero_AbilityType1[tempInt] Equal to Unselected Ability 
                        (Level of Hero_Abilities[(Integer A)] for tempHero) Greater than 0
                    Then - Actions
                        Set Hero_AbilityType1[tempInt] = Hero_Abilities[(Integer A)]
                        Set Hero_AbilityLevel_I[tempInt] = (Level of Hero_AbilityType1[tempInt] for tempHero)
                        Game - Display to (All players) the text: Player Check = True
                        Multiboard - Set the text for SkillBoard[tempInt] item in column 2, row 1 to ((Name of Hero_AbilityType1[tempInt]) + :)
                        Multiboard - Set the text for SkillBoard[tempInt] item in column 3, row 1 to (((String(Hero_AbilityExpierence_I[tempInt])) +  / ) + (String((Hero_AbilityLevel_I[tempInt] x 16))))
                        Custom script:   if GetLocalPlayer() == udg_tempPlayer then
                        Multiboard - Show SkillBoard[tempInt]
                        Custom script:   endif
                    Else - Actions
 
Reaction score
149
I only need it to display the ability, it's level and the expierence needed to level it up. There would be a total of 4-6 abilities, and each cast the multiboard would update. But basically, yes, I need it for the show only.
 

Cohadar

master of fugue
Reaction score
209
you are using same global variables for multiple players

make them an array TempPlayer[17]

and use player number as an index

TempPlayer[PlayerNumber]

NOTE: player number MUST be a local variable or A or B (for loop variables)

and on beginning of trigger you get a player number

A = GetConvertedPlayerID(OwnerOfUnit(GetTriggerPlayer()))
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top