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

[Trigger] I need help with my multiboard (GUI)

Status
Not open for further replies.
Level 6
Joined
Feb 10, 2011
Messages
188
Ok so i made a multiboard using this tutorial http://www.hiveworkshop.com/forums/general-mapping-tutorials-278/all-about-multiboards-84942/#Customize

It's a good tutorial to help get someone started with multiboards but it doesn't cover everything.

I got the multiboard to only add players that are in the game, but (because the way i did it i guess) it will give players the wrong name/color. for example when i test the map i am using player 1 (me), player 4 (comp) player 12 (comp). it gives me to right color and player name but for anything past player one it will get the wrong name. player 4 becomes player 2 and will be blue and player 12 will be player 3 and teal. (and if i add more computers it does the same thing to them)

here is my create multi board trigger

  • Create Board
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Multiboard - Create a multiboard with 3 columns and (ActivePlayers + 1) rows, titled Information
      • Set Mboard = (Last created multiboard)
      • For each (Integer A) from 1 to (ActivePlayers + 1), do (Actions)
        • Loop - Actions
          • Multiboard - Set the width for Mboard item in column 1, row (Integer A) to 10.00% of the total screen width
          • Multiboard - Set the width for Mboard item in column 2, row (Integer A) to 5.00% of the total screen width
          • Multiboard - Set the width for Mboard item in column 3, row (Integer A) to 5.00% of the total screen width
          • Multiboard - Set the text for Mboard item in column 1, row ((Integer A) + 1) to PlayerColor[(Integer A)]
          • Multiboard - Set the text for Mboard item in column 2, row ((Integer A) + 1) to (String(Income_Received[(Integer A)]))
          • Multiboard - Set the text for Mboard item in column 3, row ((Integer A) + 1) to (String(Lumber_Received[(Integer A)]))
          • Multiboard - Set the display style for Mboard item in column 1, row (Integer A) to Show text and Hide icons
          • Multiboard - Set the display style for Mboard item in column 2, row (Integer A) to Show text and Hide icons
          • Multiboard - Set the display style for Mboard item in column 2, row 1 to Show text and Show icons
          • Multiboard - Set the display style for Mboard item in column 3, row (Integer A) to Show text and Hide icons
          • Multiboard - Set the display style for Mboard item in column 3, row 1 to Show text and Show icons
          • Multiboard - Set the text for Mboard item in column 1, row 1 to (|cffB0C4DE + (Player/Country + |r))
          • Multiboard - Set the icon for Mboard item in column 2, row 1 to ReplaceableTextures\CommandButtons\BTNChestOfGold.blp
          • Multiboard - Set the text for Mboard item in column 2, row 1 to (|cffFFD700 + (Income + |r))
          • Multiboard - Set the icon for Mboard item in column 3, row 1 to ReplaceableTextures\CommandButtons\BTNHumanLumberUpgrade2.blp
          • Multiboard - Set the text for Mboard item in column 3, row 1 to (|cff00CC00 + (Income + |r))
          • Multiboard - Minimize Mboard
          • Multiboard - Maximize Mboard
here is my count active player trigger

  • Count Active Players
    • Events
      • Time - Elapsed game time is 0.50 seconds
    • Conditions
    • Actions
      • For each (Integer Z) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Player(Z)) slot status) Equal to Is playing
            • Then - Actions
              • Set ActivePlayers = (ActivePlayers + 1)
            • Else - Actions

here is a pic of what the multiboard looks like in game (looks the same after current edits.)


once again that shouldnt be player 2/3 on the board it should be player 4/12 and it should be purple and brown not blue and teal.

if you can help or spot what i am doing wrong let me know.

oh and idk if you need this but here is my set player colors trigger
  • Set Player Color
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set PlayerColor[1] = (|cffff0000 + (Name of Player 1 (Red)))
      • Set PlayerColor[2] = (|cff0000ff + (Name of Player 2 (Blue)))
      • Set PlayerColor[3] = (|cff00ffff + (Name of Player 3 (Teal)))
      • Set PlayerColor[4] = (|cffa020f0 + (Name of Player 4 (Purple)))
      • Set PlayerColor[5] = (|cffffff00 + (Name of Player 5 (Yellow)))
      • Set PlayerColor[6] = (|cffee9a00 + (Name of Player 6 (Orange)))
      • Set PlayerColor[7] = (|cff00cd00 + (Name of Player 7 (Green)))
      • Set PlayerColor[8] = (|cffdb7093 + (Name of Player 8 (Pink)))
      • Set PlayerColor[9] = (|cff7f7f7f + (Name of Player 9 (Gray)))
      • Set PlayerColor[10] = (|cff87ceeb + (Name of Player 10 (Light Blue)))
      • Set PlayerColor[11] = (|cff006400 + (Name of Player 11 (Dark Green)))
      • Set PlayerColor[12] = (|cff804000 + (Name of Player 12 (Brown)))
 
Last edited:
The problem is that ur using an integer to tell how many slots to show. What u need to do is use a custom script if GetLocalPlayer() == Udg_tempPlayer then
Then use an ITE and check if player is playing and player is controlled by a user.
Then another custom script endif
U can tell the multiboard what to display this way.
Also never use integer A make ur own integer. Anything u use twice or more store into a variable. Ex: last created multiboard
Ur one trigger that u have to count can also be drastically shortened if u use a loop and loop through the players checking to see if they are playing.

Edit: plz use hidden tags also as it makes everything easier
 
Level 6
Joined
Feb 10, 2011
Messages
188
The problem is that ur using an integer to tell how many slots to show. What u need to do is use a custom script if GetLocalPlayer() == Udg_tempPlayer then
Then use an ITE and check if player is playing and player is controlled by a user.
Then another custom script endif
U can tell the multiboard what to display this way.
Also never use integer A make ur own integer. Anything u use twice or more store into a variable. Ex: last created multiboard
Ur one trigger that u have to count can also be drastically shortened if u use a loop and loop through the players checking to see if they are playing.

Edit: plz use hidden tags also as it makes everything easier

Ok so my knowledge of triggering is pretty basic, I dont know how to use the getlocalplayer in a trigger (i understand how to write the custom script but i just get errors when i try to turn on the trigger) maybe you could give me a tagged example so i can actually see it?


this is a variation of my board using my own integers (instead of a) with this variation it displays active players on the board but they are all named player 12 and are brown colored.
  • Create Board Own Integer
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Multiboard - Create a multiboard with 3 columns and (ActivePlayers + 1) rows, titled Information
      • Set Mboard = (Last created multiboard)
      • For each (Integer X) from 1 to (ActivePlayers + 1), do (Actions)
        • Loop - Actions
          • For each (Integer C) from 1 to 12, do (Actions)
            • Loop - Actions
              • Multiboard - Set the width for Mboard item in column 1, row X to 10.00% of the total screen width
              • Multiboard - Set the width for Mboard item in column 2, row X to 5.00% of the total screen width
              • Multiboard - Set the width for Mboard item in column 3, row X to 5.00% of the total screen width
              • Multiboard - Set the text for Mboard item in column 1, row (X + 1) to PlayerColor[C]
              • Multiboard - Set the text for Mboard item in column 2, row (X + 1) to (String(Income_Received[C]))
              • Multiboard - Set the text for Mboard item in column 3, row (X + 1) to (String(Lumber_Received[C]))
              • Multiboard - Set the display style for Mboard item in column 1, row X to Show text and Hide icons
              • Multiboard - Set the display style for Mboard item in column 2, row X to Show text and Hide icons
              • Multiboard - Set the display style for Mboard item in column 2, row 1 to Show text and Show icons
              • Multiboard - Set the display style for Mboard item in column 3, row X to Show text and Hide icons
              • Multiboard - Set the display style for Mboard item in column 3, row 1 to Show text and Show icons
              • Multiboard - Set the text for Mboard item in column 1, row 1 to (|cffB0C4DE + (Player/Country + |r))
              • Multiboard - Set the icon for Mboard item in column 2, row 1 to ReplaceableTextures\CommandButtons\BTNChestOfGold.blp
              • Multiboard - Set the text for Mboard item in column 2, row 1 to (|cffFFD700 + (Income + |r))
              • Multiboard - Set the icon for Mboard item in column 3, row 1 to ReplaceableTextures\CommandButtons\BTNHumanLumberUpgrade2.blp
              • Multiboard - Set the text for Mboard item in column 3, row 1 to (|cff00CC00 + (Income + |r))
              • Multiboard - Minimize Mboard
              • Multiboard - Maximize Mboard
this is a second variation of my board using my own integers, with this variation the board looks just like the picture in the original post. are either of these right? if not, which is closer and what needs to be changed.

  • Create Board Own Integer Copy
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Multiboard - Create a multiboard with 3 columns and (ActivePlayers + 1) rows, titled Information
      • Set Mboard = (Last created multiboard)
      • For each (Integer X) from 1 to (ActivePlayers + 1), do (Actions)
        • Loop - Actions
          • Multiboard - Set the width for Mboard item in column 1, row X to 10.00% of the total screen width
          • Multiboard - Set the width for Mboard item in column 2, row X to 5.00% of the total screen width
          • Multiboard - Set the width for Mboard item in column 3, row X to 5.00% of the total screen width
          • Multiboard - Set the text for Mboard item in column 1, row (X + 1) to PlayerColor[X]
          • Multiboard - Set the text for Mboard item in column 2, row (X + 1) to (String(Income_Received[X]))
          • Multiboard - Set the text for Mboard item in column 3, row (X + 1) to (String(Lumber_Received[X]))
          • Multiboard - Set the display style for Mboard item in column 1, row X to Show text and Hide icons
          • Multiboard - Set the display style for Mboard item in column 2, row X to Show text and Hide icons
          • Multiboard - Set the display style for Mboard item in column 2, row 1 to Show text and Show icons
          • Multiboard - Set the display style for Mboard item in column 3, row X to Show text and Hide icons
          • Multiboard - Set the display style for Mboard item in column 3, row 1 to Show text and Show icons
          • Multiboard - Set the text for Mboard item in column 1, row 1 to (|cffB0C4DE + (Player/Country + |r))
          • Multiboard - Set the icon for Mboard item in column 2, row 1 to ReplaceableTextures\CommandButtons\BTNChestOfGold.blp
          • Multiboard - Set the text for Mboard item in column 2, row 1 to (|cffFFD700 + (Income + |r))
          • Multiboard - Set the icon for Mboard item in column 3, row 1 to ReplaceableTextures\CommandButtons\BTNHumanLumberUpgrade2.blp
          • Multiboard - Set the text for Mboard item in column 3, row 1 to (|cff00CC00 + (Income + |r))
          • Multiboard - Minimize Mboard
          • Multiboard - Maximize Mboard
thanks for your help so far, i learned a few things already but as in said before my knowledge is basic so some of the things you said did confuse me.
mainly the custom script thing and exactly where and how many custom integers i should use.
 
Last edited:
Level 6
Joined
Feb 10, 2011
Messages
188
I can't look at very thing right now but my tutorial Things a GUIer Should Know will show u the fright way for using getlocalplayer

haha im actually reading it right now, i was about to come ask this though:
it seems when using the getlocalplayer script it is used to make it so each player gets there own multiboard? i dont really need that, i just want one multiboard that will show up for all players and they all see it updating the same (i havnt got to the updating part yet though) but ya my point is if i figure out the getlocalplayer thing and use it does that mean each player gets there own multiboard?

but i have to get ready for work, so i will finish reading it and actually try to implement it probably tomorrow.
 
Level 6
Joined
Nov 24, 2012
Messages
218
  • Create Board
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Multiboard - Create a multiboard with 3 columns and (ActivePlayers + 1) rows, titled Information
      • Set Mboard = (Last created multiboard)
      • For each (Integer X) from 1 to (ActivePlayers + 1), do (Actions)
        • Loop - Actions
          • Multiboard - Set the width for Mboard item in column 1, row X to 10.00% of the total screen width
          • Multiboard - Set the width for Mboard item in column 1, row X to 5.00% of the total screen width
          • Multiboard - Set the width for Mboard item in column 1, row X to 5.00% of the total screen width
          • Multiboard - Set the display style for Mboard item in column 1, row X to Show text and Hide icons
          • Multiboard - Set the display style for Mboard item in column 2, row X to Show text and Hide icons
          • Multiboard - Set the display style for Mboard item in column 2, row 1 to Show text and Show icons
          • Multiboard - Set the display style for Mboard item in column 3, row X to Show text and Hide icons
          • Multiboard - Set the display style for Mboard item in column 3, row 1 to Show text and Show icons
          • Multiboard - Set the text for Mboard item in column 1, row 1 to (|cffB0C4DE + (Player/Country + |r))
          • Multiboard - Set the icon for Mboard item in column 2, row 1 to ReplaceableTextures\CommandButtons\BTNChestOfGold.blp
          • Multiboard - Set the text for Mboard item in column 2, row 1 to (|cffFFD700 + (Income + |r))
          • Multiboard - Set the icon for Mboard item in column 3, row 1 to ReplaceableTextures\CommandButtons\BTNHumanLumberUpgrade2.blp
          • Multiboard - Set the text for Mboard item in column 3, row 1 to (|cff00CC00 + (Income + |r))
          • Multiboard - Minimize Mboard
          • Multiboard - Maximize Mboard
      • For each (Integer X) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Player(X)) slot status) Equal to Is playing
            • Then - Actions
              • Multiboard - Set the text for Mboard item in column 1, row (X + 1) to PlayerColor[X]
              • Multiboard - Set the text for Mboard item in column 2, row (X + 1) to (String(Income_Received[X]))
              • Multiboard - Set the text for Mboard item in column 3, row (X + 1) to (String(Lumber_Received[X]))
            • Else - Actions
 
Level 6
Joined
Feb 10, 2011
Messages
188
side note* for testing purposes i changed player 1 and player 12 to computers and i am now player 2.
Ok i used hesitations trigger, it almost works perfectly but it doesnt show player 12. here are my results:



here is the trigger (did i miss something? or mess something up?)

  • Create Board
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Multiboard - Create a multiboard with 3 columns and (ActivePlayers + 1) rows, titled Information
      • Set Mboard = (Last created multiboard)
      • For each (Integer X) from 1 to (ActivePlayers + 1), do (Actions)
        • Loop - Actions
          • Multiboard - Set the width for Mboard item in column 1, row X to 10.00% of the total screen width
          • Multiboard - Set the width for Mboard item in column 2, row X to 5.00% of the total screen width
          • Multiboard - Set the width for Mboard item in column 3, row X to 5.00% of the total screen width
          • Multiboard - Set the display style for Mboard item in column 1, row X to Show text and Hide icons
          • Multiboard - Set the display style for Mboard item in column 2, row X to Show text and Hide icons
          • Multiboard - Set the display style for Mboard item in column 2, row 1 to Show text and Show icons
          • Multiboard - Set the display style for Mboard item in column 3, row X to Show text and Hide icons
          • Multiboard - Set the display style for Mboard item in column 3, row 1 to Show text and Show icons
          • Multiboard - Set the text for Mboard item in column 1, row 1 to (|cffB0C4DE + (Player/Country + |r))
          • Multiboard - Set the icon for Mboard item in column 2, row 1 to ReplaceableTextures\CommandButtons\BTNChestOfGold.blp
          • Multiboard - Set the text for Mboard item in column 2, row 1 to (|cffFFD700 + (Income + |r))
          • Multiboard - Set the icon for Mboard item in column 3, row 1 to ReplaceableTextures\CommandButtons\BTNHumanLumberUpgrade2.blp
          • Multiboard - Set the text for Mboard item in column 3, row 1 to (|cff00CC00 + (Income + |r))
          • Multiboard - Minimize Mboard
          • Multiboard - Maximize Mboard
      • For each (Integer X) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Player(X)) slot status) Equal to Is playing
            • Then - Actions
              • Multiboard - Set the text for Mboard item in column 1, row (X + 1) to PlayerColor[X]
              • Multiboard - Set the text for Mboard item in column 2, row (X + 1) to (String(Income_Received[X]))
              • Multiboard - Set the text for Mboard item in column 3, row (X + 1) to (String(Lumber_Received[X]))
            • Else - Actions
ok this is odd, i just testing it as me being player 5 and all other slots as computers, every player including me showed up on the board. is there some sort of bug in the triggering? or could it just be because i am using computers?
 
Last edited:
no the problem is in his triggers sry i didnt see that earlier.

the triggers hesitation posted only allow for as many slots to work.
basically what u have to do is increase the rows and colums as u go.
mybe i can make something quick for u. Give me about 30 min i have some other things to do first.

  • Multiboard trig
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Multiboard - Create a multiboard with 3 columns and 1 rows, titled Information
      • Set infoMultiboard = (Last created multiboard)
      • Multiboard - Set the width for infoMultiboard item in column 1, row 1 to 10.00% of the total screen width
      • Multiboard - Set the width for infoMultiboard item in column 2, row 1 to 5.00% of the total screen width
      • Multiboard - Set the width for infoMultiboard item in column 3, row 1 to 5.00% of the total screen width
      • Multiboard - Set the text for infoMultiboard item in column 1, row 1 to Player Name
      • Multiboard - Set the text for infoMultiboard item in column 2, row 1 to Gold
      • Multiboard - Set the text for infoMultiboard item in column 3, row 1 to Lumber
      • Multiboard - Set the display style for infoMultiboard item in column 1, row 1 to Show text and Hide icons
      • -------- put the golad and lumber icons here --------
      • Set tempInt[1] = 1
      • -------- This checks if each player is playing from player 1 red to player 12. --------
      • For each (Integer tempInt[0]) from 1 to 12, do (Actions)
        • Loop - Actions
          • Custom script: set udg_tempPlayer = Player( udg_tempInt[ 0] - 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (tempPlayer slot status) Equal to Is playing
              • (tempPlayer controller) Equal to User
            • Then - Actions
              • -------- counts the players playing so it can set the multiboard length --------
              • Set tempInt[1] = (tempInt[1] + 1)
              • Multiboard - Change the number of rows for infoMultiboard to tempInt[1]
              • Multiboard - Set the width for infoMultiboard item in column 1, row tempInt[1] to 10.00% of the total screen width
              • Multiboard - Set the width for infoMultiboard item in column 2, row tempInt[1] to 5.00% of the total screen width
              • Multiboard - Set the width for infoMultiboard item in column 3, row tempInt[1] to 5.00% of the total screen width
              • Multiboard - Set the text for infoMultiboard item in column 1, row tempInt[1] to (Name of tempPlayer)
              • Multiboard - Set the text for infoMultiboard item in column 2, row tempInt[1] to Put the gold income...
              • Multiboard - Set the text for infoMultiboard item in column 3, row tempInt[1] to put the lumber inco...
              • Multiboard - Set the display style for infoMultiboard item in column 1, row tempInt[1] to Show text and Hide icons
              • Multiboard - Set the display style for infoMultiboard item in column 2, row tempInt[1] to Show text and Hide icons
              • Multiboard - Set the display style for infoMultiboard item in column 3, row tempInt[1] to Show text and Hide icons
            • Else - Actions
      • Custom script: set udg_tempPlayer = null
 

Attachments

  • multiboard system for RollinDoubles.w3x
    14.3 KB · Views: 52
Last edited:
Level 6
Joined
Feb 10, 2011
Messages
188
no the problem is in his triggers sry i didnt see that earlier.

the triggers hesitation posted only allow for as many slots to work.
basically what u have to do is increase the rows and colums as u go.
mybe i can make something quick for u. Give me about 30 min i have some other things to do first.

  • Multiboard trig
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Multiboard - Create a multiboard with 3 columns and 1 rows, titled Information
      • Set infoMultiboard = (Last created multiboard)
      • Multiboard - Set the width for infoMultiboard item in column 1, row 1 to 10.00% of the total screen width
      • Multiboard - Set the width for infoMultiboard item in column 2, row 1 to 5.00% of the total screen width
      • Multiboard - Set the width for infoMultiboard item in column 3, row 1 to 5.00% of the total screen width
      • Multiboard - Set the text for infoMultiboard item in column 1, row 1 to Player Name
      • Multiboard - Set the text for infoMultiboard item in column 2, row 1 to Gold
      • Multiboard - Set the text for infoMultiboard item in column 3, row 1 to Lumber
      • Multiboard - Set the display style for infoMultiboard item in column 1, row 1 to Show text and Hide icons
      • -------- put the golad and lumber icons here --------
      • Set tempInt[1] = 1
      • -------- This checks if each player is playing from player 1 red to player 12. --------
      • For each (Integer tempInt[0]) from 1 to 12, do (Actions)
        • Loop - Actions
          • Custom script: set udg_tempPlayer = Player( udg_tempInt[ 0] - 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (tempPlayer slot status) Equal to Is playing
              • (tempPlayer controller) Equal to User
            • Then - Actions
              • -------- counts the players playing so it can set the multiboard length --------
              • Set tempInt[1] = (tempInt[1] + 1)
              • Multiboard - Change the number of rows for infoMultiboard to tempInt[1]
              • Multiboard - Set the width for infoMultiboard item in column 1, row tempInt[1] to 10.00% of the total screen width
              • Multiboard - Set the width for infoMultiboard item in column 2, row tempInt[1] to 5.00% of the total screen width
              • Multiboard - Set the width for infoMultiboard item in column 3, row tempInt[1] to 5.00% of the total screen width
              • Multiboard - Set the text for infoMultiboard item in column 1, row tempInt[1] to (Name of tempPlayer)
              • Multiboard - Set the text for infoMultiboard item in column 2, row tempInt[1] to Put the gold income...
              • Multiboard - Set the text for infoMultiboard item in column 3, row tempInt[1] to put the lumber inco...
              • Multiboard - Set the display style for infoMultiboard item in column 1, row tempInt[1] to Show text and Hide icons
              • Multiboard - Set the display style for infoMultiboard item in column 2, row tempInt[1] to Show text and Hide icons
              • Multiboard - Set the display style for infoMultiboard item in column 3, row tempInt[1] to Show text and Hide icons
            • Else - Actions
      • Custom script: set udg_tempPlayer = null

ahh ok thankyou man, i just got time to look at your reply real quick. ill look at it more in a few days. this will help me out a lot cause im a visual learner. haha
 
Level 6
Joined
Feb 10, 2011
Messages
188
Ok lol thts understandable lol

ok, i had time to implement this into my map it works great :) thankyou!
i even got all my income updating to work properly using the same method.
now im going to add a timer to the multiboard.


but hey i didnt want to make a new thread for this quick question:

is this a good way to do my empire selection trigger?
i am using a building to train a unit and based on wich "unit" the player trains they get the country.
the boolean variable and the turn off this trigger line are there so when 2 people pick the same country at the exact same time it wont bug out the game. (i tested with 2 computers using triggers to pick the same empire, one would get the empire the other would train the unit next to the one selected, and get no country and wouldnt be able to pick 1, so by doing what i did, it prevented that from happening)

also im going to replace the integer a with my own soon, so dont worry about that.

  • Select British Empire
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
      • (Unit-type of (Trained unit)) Equal to British Empire
      • British_Selected Equal to False
    • Actions
      • Camera - Pan camera for (Owner of (Trained unit)) to (Center of British Empire <gen>) over 0.00 seconds
      • Set British_Selected = True
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Player - Make British Empire Unavailable for training/construction by (Player((Integer A)))
      • Unit - Remove (Trained unit) from the game
      • Unit Group - Pick every unit in (Units in British Empire <gen>) and do (Unit - Change ownership of (Picked unit) to (Triggering player) and Change color)
      • Unit - Remove (Triggering unit) from the game
      • Trigger - Turn off (This trigger)
 
instead put everything in an ITE. use the british selected equal to false as condition and take it out of the upper condition block.
put everything in the action block into the then block of the ITE
remove the turn off trigger part.
in the else block remove the selected unit and let that player buy a unit.

alternate option
make another trigger that fires when a unit begins training that unit. if the condition u use in here is set to true then u order the unit training the unit to stop.

if u have multiple triggers for the empires they can all be shortened to 1 trigger doing the first option and 2 triggers doing the second option.

Also u leak a point.
for either option u can remove this.
  • For each (Integer A) from 1 to 12, do (Actions)
  • Loop - Actions
    • Player - Make British Empire Unavailable for training/construction by (Player((Integer A)))
 
Level 6
Joined
Feb 10, 2011
Messages
188
instead put everything in an ITE. use the british selected equal to false as condition and take it out of the upper condition block.
put everything in the action block into the then block of the ITE
remove the turn off trigger part.
in the else block remove the selected unit and let that player buy a unit.

alternate option
make another trigger that fires when a unit begins training that unit. if the condition u use in here is set to true then u order the unit training the unit to stop.

if u have multiple triggers for the empires they can all be shortened to 1 trigger doing the first option and 2 triggers doing the second option.

Also u leak a point.
for either option u can remove this.
  • For each (Integer A) from 1 to 12, do (Actions)
  • Loop - Actions
    • Player - Make British Empire Unavailable for training/construction by (Player((Integer A)))

i dont get what you mean by this part.
in the else block remove the selected unit and let that player buy a unit.

i considered option 2, it was a good idea but then i thought well what if someone begins training the unit, then cancels. i would just have to make another trigger that basically was like if a unit cancels training a unit then set brit emp back to false. so i felt option one was better. this is what i did so far:
  • Select British Empire Copy
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Trained unit)) Equal to British Empire
          • British_Selected Equal to False
        • Then - Actions
          • Set British_Selected = True
          • Set tempRect = British Empire <gen>
          • Camera - Pan camera for (Owner of (Trained unit)) to (Center of tempRect) over 0.00 seconds
          • Unit Group - Pick every unit in (Units in tempRect) and do (Unit - Change ownership of (Picked unit) to (Triggering player) and Change color)
          • Unit - Remove (Triggering unit) from the game
          • Custom script: call RemoveRect(udg_tempRect)
          • For each (Integer B) from 1 to 12, do (Actions)
            • Loop - Actions
              • Player - Make British Empire Unavailable for training/construction by (Player(B))
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Trained unit)) Equal to Egyptian Empire
              • Egyptian_Selected Equal to False
            • Then - Actions
              • Set Egyptian_Selected = True
              • Set tempRect = Egyptian Empire <gen>
              • Camera - Pan camera for (Owner of (Trained unit)) to (Center of tempRect) over 0.00 seconds
              • Unit Group - Pick every unit in (Units in tempRect) and do (Unit - Change ownership of (Picked unit) to (Triggering player) and Change color)
              • Unit - Remove (Triggering unit) from the game
              • Custom script: call RemoveRect(udg_tempRect)
              • For each (Integer B) from 1 to 12, do (Actions)
                • Loop - Actions
                  • Player - Make Egyptian Empire Unavailable for training/construction by (Player(B))
            • Else - Actions
did i remove the location leak properly?

there is 12 empire selection triggers, should i keep looping it the way i did above or should each just have their own ITE in the action block of the trigger?

oh and does my pick every unit in unit group part leak (this:
  • Unit Group - Pick every unit in (Units in tempPoint) and do (Unit - Change ownership of (Picked unit) to (Triggering player) and Change color)
)

why should i remove? is that what the else part u mentioned fixes?

  • For each (Integer B) from 1 to 12, do (Actions)
    • Loop - Actions
      • Player - Make British Empire Unavailable for training/construction by (Player(B))
i dont really want people to sit there and try to keep picking an empire that is chosen already, know what i mean?

oh and i also got rid of the part:
  • Unit - Remove (Trained unit) from the game
and made this trigger

  • Remove Selection Units
    • Events
      • Unit - A unit enters Country Selection <gen>
    • Conditions
    • Actions
      • Unit - Remove (Entering unit) from the game
 
Last edited:
Status
Not open for further replies.
Top