Multiboard (Lives Bug) Help xD

Craigimus

New Member
Reaction score
0
My Multiboard looks fine when you play on your own but when u play with others the lives go all nutty.
Its like all the lives are connected into one but when i played my lives went from 20 to 16 to 4 to -28 then -30 then i eventually lost :S without letting any creeps go through.

Ill post the triggers so you can see if theres something i did wrong

Code:
Create Multiboard
    Events
        Time - Elapsed game time is 1.00 seconds
    Conditions
    Actions
        Set Player_Count = (Number of players in (All players matching ((((Matching player) controller) Equal to User) and (((Matching player) slot status) Equal to Is playing))))
        Multiboard - Create a multiboard with 4 columns and (1 + Player_Count) rows, titled Super Mario TD
        Multiboard - Set the text for (Last created multiboard) item in column 2, row 1 to Player Name
        Multiboard - Set the text for (Last created multiboard) item in column 3, row 1 to Kills
        Multiboard - Set the text for (Last created multiboard) item in column 4, row 1 to Lives
        For each (Integer A) from 1 to (1 + Player_Count), do (Actions)
            Loop - Actions
                Multiboard - Set the display style for (Last created multiboard) item in column 1, row 1 to Show text and Hide icons
                Multiboard - Set the display style for (Last created multiboard) item in column 1, row (Integer A) to Show text and Show icons
                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 display style for (Last created multiboard) item in column 3, row (Integer A) to Show text and Hide icons
                Multiboard - Set the display style for (Last created multiboard) item in column 4, row (Integer A) to Show text and Hide icons
                Multiboard - Set the width for (Last created multiboard) item in column 1, row (Integer A) to 2.00% of the total screen width
                Multiboard - Set the width for (Last created multiboard) item in column 2, row (Integer A) to 8.00% of the total screen width
                Multiboard - Set the width for (Last created multiboard) item in column 3, row (Integer A) to 3.00% of the total screen width
                Multiboard - Set the width for (Last created multiboard) item in column 4, row (Integer A) to 3.00% of the total screen width
        Set List = 2
        Player Group - Pick every player in (All players matching ((((Matching player) slot status) Equal to Is playing) and (((Matching player) controller) Equal to User))) and do (Actions)
            Loop - Actions
                Set Multiboard_Spots[(Player number of (Picked player))] = List
                Multiboard - Set the icon for (Last created multiboard) item in column 1, row List to ReplaceableTextures\CommandButtons\BTNToad.blp
                Multiboard - Set the text for (Last created multiboard) item in column 2, row List to (Player_Colors[(Player number of (Picked player))] + ((Name of (Picked player)) + |r))
                Multiboard - Set the text for (Last created multiboard) item in column 3, row List to 0
                Multiboard - Set the text for (Last created multiboard) item in column 4, row List to 20
                Set List = (List + 1)
        Multiboard - Show (Last created multiboard)


This trigger changes the lives. i think this is the trigger that has the problem in it.
Code:
Player Lives Update
    Events
        Unit - A unit enters RedEnd <gen>
        Unit - A unit enters BlueEnd <gen>
        Unit - A unit enters TealEnd <gen>
        Unit - A unit enters PurpEnd <gen>
        Unit - A unit enters YellowEnd <gen>
        Unit - A unit enters OjEnd <gen>
        Unit - A unit enters GreenEnd <gen>
        Unit - A unit enters PinkEnd <gen>
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (RedEnd <gen> contains (Triggering unit)) Equal to True
                Or - Any (Conditions) are true
                    Conditions
                        (Owner of (Triggering unit)) Equal to Player 2 (Blue)
                        (Owner of (Triggering unit)) Equal to Player 3 (Teal)
                        (Owner of (Triggering unit)) Equal to Player 4 (Purple)
                        (Owner of (Triggering unit)) Equal to Player 5 (Yellow)
                        (Owner of (Triggering unit)) Equal to Player 6 (Orange)
                        (Owner of (Triggering unit)) Equal to Player 7 (Green)
                        (Owner of (Triggering unit)) Equal to Player 8 (Pink)
                        (Owner of (Triggering unit)) Equal to Player 12 (Brown)
            Then - Actions
                Set Live_Count = (Live_Count - 1)
                Multiboard - Set the text for (Last created multiboard) item in column 4, row Multiboard_Spots[(Player number of (Owner of (Killing unit)))] to (String(Live_Count))
                Player - Set Player 1 (Red) Food used to (Live_Count - 1)
                Player - Add 1 to Player 1 (Red) Food used
                Unit - Kill (Triggering unit)
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (BlueEnd <gen> contains (Triggering unit)) Equal to True
                Or - Any (Conditions) are true
                    Conditions
                        (Owner of (Triggering unit)) Equal to Player 1 (Red)
                        (Owner of (Triggering unit)) Equal to Player 3 (Teal)
                        (Owner of (Triggering unit)) Equal to Player 4 (Purple)
                        (Owner of (Triggering unit)) Equal to Player 5 (Yellow)
                        (Owner of (Triggering unit)) Equal to Player 6 (Orange)
                        (Owner of (Triggering unit)) Equal to Player 7 (Green)
                        (Owner of (Triggering unit)) Equal to Player 8 (Pink)
                        (Owner of (Triggering unit)) Equal to Player 12 (Brown)
            Then - Actions
                Set Live_Count = (Live_Count - 1)
                Multiboard - Set the text for (Last created multiboard) item in column 4, row Multiboard_Spots[Live_Count] to (String(Live_Count))
                Player - Set Player 2 (Blue) Food used to (Live_Count - 1)
                Player - Add 1 to Player 2 (Blue) Food used
                Unit - Kill (Triggering unit)
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (TealEnd <gen> contains (Triggering unit)) Equal to True
                Or - Any (Conditions) are true
                    Conditions
                        (Owner of (Triggering unit)) Equal to Player 1 (Red)
                        (Owner of (Triggering unit)) Equal to Player 2 (Blue)
                        (Owner of (Triggering unit)) Equal to Player 4 (Purple)
                        (Owner of (Triggering unit)) Equal to Player 5 (Yellow)
                        (Owner of (Triggering unit)) Equal to Player 6 (Orange)
                        (Owner of (Triggering unit)) Equal to Player 7 (Green)
                        (Owner of (Triggering unit)) Equal to Player 8 (Pink)
                        (Owner of (Triggering unit)) Equal to Player 12 (Brown)
            Then - Actions
                Set Live_Count = (Live_Count - 1)
                Multiboard - Set the text for (Last created multiboard) item in column 4, row Multiboard_Spots[Live_Count] to (String(Live_Count))
                Player - Set Player 3 (Teal) Food used to (Live_Count - 1)
                Player - Add 1 to Player 3 (Teal) Food used
                Unit - Kill (Triggering unit)
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Or - Any (Conditions) are true
                    Conditions
                        (Owner of (Triggering unit)) Equal to Player 1 (Red)
                        (Owner of (Triggering unit)) Equal to Player 2 (Blue)
                        (Owner of (Triggering unit)) Equal to Player 3 (Teal)
                        (Owner of (Triggering unit)) Equal to Player 5 (Yellow)
                        (Owner of (Triggering unit)) Equal to Player 6 (Orange)
                        (Owner of (Triggering unit)) Equal to Player 7 (Green)
                        (Owner of (Triggering unit)) Equal to Player 8 (Pink)
                        (Owner of (Triggering unit)) Equal to Player 12 (Brown)
                (PurpEnd <gen> contains (Triggering unit)) Equal to True
            Then - Actions
                Set Live_Count = (Live_Count - 1)
                Multiboard - Set the text for (Last created multiboard) item in column 4, row Multiboard_Spots[Live_Count] to (String(Live_Count))
                Player - Set Player 4 (Purple) Food used to (Live_Count - 1)
                Player - Add 1 to Player 4 (Purple) Food used
                Unit - Kill (Triggering unit)
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Or - Any (Conditions) are true
                    Conditions
                        (Owner of (Triggering unit)) Equal to Player 1 (Red)
                        (Owner of (Triggering unit)) Equal to Player 2 (Blue)
                        (Owner of (Triggering unit)) Equal to Player 3 (Teal)
                        (Owner of (Triggering unit)) Equal to Player 4 (Purple)
                        (Owner of (Triggering unit)) Equal to Player 6 (Orange)
                        (Owner of (Triggering unit)) Equal to Player 7 (Green)
                        (Owner of (Triggering unit)) Equal to Player 8 (Pink)
                        (Owner of (Triggering unit)) Equal to Player 12 (Brown)
                (YellowEnd <gen> contains (Triggering unit)) Equal to True
            Then - Actions
                Set Live_Count = (Live_Count - 1)
                Multiboard - Set the text for (Last created multiboard) item in column 4, row Multiboard_Spots[Live_Count] to (String(Live_Count))
                Player - Set Player 5 (Yellow) Food used to (Live_Count - 1)
                Player - Add 1 to Player 5 (Yellow) Food used
                Unit - Kill (Triggering unit)
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Or - Any (Conditions) are true
                    Conditions
                        (Owner of (Triggering unit)) Equal to Player 1 (Red)
                        (Owner of (Triggering unit)) Equal to Player 2 (Blue)
                        (Owner of (Triggering unit)) Equal to Player 3 (Teal)
                        (Owner of (Triggering unit)) Equal to Player 4 (Purple)
                        (Owner of (Triggering unit)) Equal to Player 5 (Yellow)
                        (Owner of (Triggering unit)) Equal to Player 7 (Green)
                        (Owner of (Triggering unit)) Equal to Player 8 (Pink)
                        (Owner of (Triggering unit)) Equal to Player 12 (Brown)
                (OjEnd <gen> contains (Triggering unit)) Equal to True
            Then - Actions
                Set Live_Count = (Live_Count - 1)
                Multiboard - Set the text for (Last created multiboard) item in column 4, row Multiboard_Spots[Live_Count] to (String(Live_Count))
                Player - Set Player 6 (Orange) Food used to (Live_Count - 1)
                Player - Add 1 to Player 6 (Orange) Food used
                Unit - Kill (Triggering unit)
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Or - Any (Conditions) are true
                    Conditions
                        (Owner of (Triggering unit)) Equal to Player 1 (Red)
                        (Owner of (Triggering unit)) Equal to Player 2 (Blue)
                        (Owner of (Triggering unit)) Equal to Player 3 (Teal)
                        (Owner of (Triggering unit)) Equal to Player 4 (Purple)
                        (Owner of (Triggering unit)) Equal to Player 5 (Yellow)
                        (Owner of (Triggering unit)) Equal to Player 6 (Orange)
                        (Owner of (Triggering unit)) Equal to Player 8 (Pink)
                        (Owner of (Triggering unit)) Equal to Player 12 (Brown)
                (GreenEnd <gen> contains (Triggering unit)) Equal to True
            Then - Actions
                Set Live_Count = (Live_Count - 1)
                Multiboard - Set the text for (Last created multiboard) item in column 4, row Multiboard_Spots[Live_Count] to (String(Live_Count))
                Player - Set Player 7 (Green) Food used to (Live_Count - 1)
                Player - Add 1 to Player 7 (Green) Food used
                Unit - Kill (Triggering unit)
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Or - Any (Conditions) are true
                    Conditions
                        (Owner of (Triggering unit)) Equal to Player 1 (Red)
                        (Owner of (Triggering unit)) Equal to Player 2 (Blue)
                        (Owner of (Triggering unit)) Equal to Player 3 (Teal)
                        (Owner of (Triggering unit)) Equal to Player 4 (Purple)
                        (Owner of (Triggering unit)) Equal to Player 5 (Yellow)
                        (Owner of (Triggering unit)) Equal to Player 6 (Orange)
                        (Owner of (Triggering unit)) Equal to Player 7 (Green)
                        (Owner of (Triggering unit)) Equal to Player 12 (Brown)
                (PinkEnd <gen> contains (Triggering unit)) Equal to True
            Then - Actions
                Set Live_Count = (Live_Count - 1)
                Multiboard - Set the text for (Last created multiboard) item in column 4, row Multiboard_Spots[Live_Count] to (String(Live_Count))
                Player - Set Player 8 (Pink) Food used to (Live_Count - 1)
                Player - Add 1 to Player 8 (Pink) Food used
                Unit - Kill (Triggering unit)
            Else - Actions

I Put this trigger in cause the row that says lives init kept changing to the number of lives.
Code:
Player Lives Update Copy
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
            Then - Actions
                Set Live_Count = Live_Count
                Multiboard - Set the text for (Last created multiboard) item in column 4, row Multiboard_Spots[(Player number of (Owner of (Killing unit)))] to (String(Live_Count))
                Multiboard - Set the text for (Last created multiboard) item in column 4, row 1 to Lives
            Else - Actions
 

Exide

I am amazingly focused right now!
Reaction score
448
Your long-ass trigger could probably look like this:
Also notice the red part.

Code:
Player Lives Update
    Events
        Unit - A unit enters RedEnd <gen>
        Unit - A unit enters BlueEnd <gen>
        Unit - A unit enters TealEnd <gen>
        Unit - A unit enters PurpEnd <gen>
        Unit - A unit enters YellowEnd <gen>
        Unit - A unit enters OjEnd <gen>
        Unit - A unit enters GreenEnd <gen>
        Unit - A unit enters PinkEnd <gen>
    Conditions
        Or - Any (Conditions) are true
            Conditions
                (Owner of (Triggering unit)) Equal to Player 2 (Blue)
                (Owner of (Triggering unit)) Equal to Player 3 (Teal)
                (Owner of (Triggering unit)) Equal to Player 4 (Purple)
                (Owner of (Triggering unit)) Equal to Player 5 (Yellow)
                (Owner of (Triggering unit)) Equal to Player 6 (Orange)
                (Owner of (Triggering unit)) Equal to Player 7 (Green)
                (Owner of (Triggering unit)) Equal to Player 8 (Pink)
                (Owner of (Triggering unit)) Equal to Player 12 (Brown)
    Actions
        Set Live_Count = (Live_Count - 1)
        Multiboard - Set the text for (Last created multiboard) item in column 4, row Multiboard_Spots[COLOR="Red"][B][(Player number of (Owner of (Killing unit)))][/B][/COLOR] to (String(Live_Count))


        If (All Conditions are True) then do (Then Actions) else do (Else Actions)    [COLOR="Red"]// One of these per region..[/COLOR]
            If - Conditions
                Or - Any (Conditions) are true
                    Conditions
                        (RedEnd <gen> contains (Triggering unit)) Equal to True
            Then - Actions

                Player - Set Player 1 (Red) Food used to (Live_Count - 1)
                Player - Add 1 to Player 1 (Red) Food used
            Else - Actions

        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Or - Any (Conditions) are true
                    Conditions
                        (BlueEnd <gen> contains (Triggering unit)) Equal to True
            Then - Actions

                Player - Set Player 2 (Blue) Food used to (Live_Count - 1)
                Player - Add 1 to Player 2 (Blue) Food used
            Else - Actions

        Unit - Remove (Triggering unit)


EDIT:
Also this trigger:
Code:
Player Lives Update Copy
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
            Then - Actions
                [COLOR="Red"]Set Live_Count = Live_Count[/COLOR]    // This makes little sense. :P
                Multiboard - Set the text for (Last created multiboard) item in column 4, row Multiboard_Spots[(Player number of (Owner of (Killing unit)))] to (String(Live_Count))
                Multiboard - Set the text for (Last created multiboard) item in column 4, row 1 to Lives
            Else - Actions
 
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