This is absolutely driving me up a wall. I have this dialog that shows several players as options. What I want is for buttons belonging to players that aren't in the game to be hidden. Well, sometimes it works, sometimes it doesn't. Here's my code.
So basically a certain player initiates the dialog. The button corresponding to that player is disabled. Then it cycles through all players, checking to see if each one is in the game or has a specific unit. If these return false, hide that player's button. And that should be it.
The "Player Owns A Bar" function:
PlayerOwnsABarOptions:ConditionReturnType:BooleanParametersPlayer=0<Integer>GrammarText:PlayerOwnsABar(Player)HintText:(None)CustomScriptCodeLocalVariablesActionsGeneral-If(Conditions)thendo(Actions)elsedo(Actions)If(NumberofLivingunitsin(Buck's Bar & Grille units in (Entire map) owned by player Player matching Excluded: Missile, Dead, Hidden, with at most Any Amount)) == 1ThenGeneral-ReturnTrueElseGeneral-ReturnFalse
This is absolutely driving me up a wall. I have this dialog that shows several players as options. What I want is for buttons belonging to players that aren't in the game to be hidden. Well, sometimes it works, sometimes it doesn't. Here's my code.
So basically a certain player initiates the dialog. The button corresponding to that player is disabled. Then it cycles through all players, checking to see if each one is in the game or has a specific unit. If these return false, hide that player's button. And that should be it.
The "Player Owns A Bar" function:
The "for each" action is searching in the active players only. Shouldn't it run trough all players?
Check out my kitbashes! Custom Campaign Initiative: Lots of great Custom Campaigns!! Check out and Support!!
@Cacho56: Go
By golly, I think you're on to something there! Thanks :)