So I'm fairly new to mapping / custom games, and I had some odd results from some work I've done in the editor. As with any oddness, I wanted to ask around and see if people have come across similar issues or possible better solutions.
In attempting to setup a custom UI, I've created an action definition that set up the ui with an input parameter for the "player number". During map initiation I thought it would be slick to create a while statement that says "While i<= (Active Player) run the action definition for (i), increment i". Seemed like a great idea in my head, the issue I'm running into is that the interface doesn't come out to be identical for everyone. I know I could just use "create interface for all players", but then if player 1 clicks around on it, it messes up the ui for player 2, so i want them to be identical, but independent.
Have any of you experienced this? Or anything similar?
When making a Dialog it's generally a good idea to set it up for All Players, whether they need it or not. You just don't show it for all players.
I suggest you do the following:
Map Initialization: Create Dialog for all players, add Dialog Items for all players, remember global variables for the various items you want players to be able to interact with (you do NOT need an array for buttons etc. as the Event Handler can distinguish which player clicked the button)
On demand: Show the Dialog (using the global variable) for the desired Player group
All dialog manipulation (size, value, position, image, show/hide etc..) can be set to different player by the parameter of player group defaulted to (All players)
Change it to Convert player to player group and you can specify an integer for player. Normally triggering player is used in most case (when a player click something -> change the dialog only to him)
When making a Dialog it's generally a good idea to set it up for All Players, whether they need it or not. You just don't show it for all players.
I suggest you do the following:
Map Initialization: Create Dialog for all players, add Dialog Items for all players, remember global variables for the various items you want players to be able to interact with (you do NOT need an array for buttons etc. as the Event Handler can distinguish which player clicked the button)
On demand: Show the Dialog (using the global variable) for the desired Player group
I'm curious a bit about this. When you say the Event Handler can distinguish between players. I'm thinking that, if I correctly understand what you're saying, it could lead to me re-writing a lot of my code. (I'm not a programmer at all, just trying to learn all of this stuff)
Right now, I have it set up much like programmer states. Where I draw 8 dialog boxes (each in an array), each is showing to only a specific player. The same goes for every button inside of the boxes. Then i use parameters on all of the dialog functions to determine which player to show it too. I thought it was working pretty well, but when i tested it out today with some friends, one of the buttons wouldn't show up for player 2. Which is what drove my original post.
For single player testing, everything looks amazing. There's the ability to fully swap all the items in my dialog boxes, and it looks (almost) exactly how I want it to. But when i threw multiple people in there. stuff got wonky. I can't post the file now (i'm out of tow) but it's kinda like this
Loop that runs with i<=number of active players -> each loop iteration runs an Action definition (with a parameter of player number) (still a bit fuzzy on the difference between functions and action definitions, the seem REALLY similar to me.. TANGENT there!!! anyways... back on topic) to build dialog menu and dialog items -> from there i have dialog items that change around the other dialog items for each unique player dialog.
I know it's kind of hard to visualize in text and i apologize. I just really don't understand how it can be different between each player.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hey all,
So I'm fairly new to mapping / custom games, and I had some odd results from some work I've done in the editor. As with any oddness, I wanted to ask around and see if people have come across similar issues or possible better solutions.
In attempting to setup a custom UI, I've created an action definition that set up the ui with an input parameter for the "player number". During map initiation I thought it would be slick to create a while statement that says "While i<= (Active Player) run the action definition for (i), increment i". Seemed like a great idea in my head, the issue I'm running into is that the interface doesn't come out to be identical for everyone. I know I could just use "create interface for all players", but then if player 1 clicks around on it, it messes up the ui for player 2, so i want them to be identical, but independent.
Have any of you experienced this? Or anything similar?
A bit of code of that loop will be pretty much needed to see the error.
@CeejEngine: Go
When making a Dialog it's generally a good idea to set it up for All Players, whether they need it or not. You just don't show it for all players.
I suggest you do the following:
@CeejEngine: Go
All dialog manipulation (size, value, position, image, show/hide etc..) can be set to different player by the parameter of player group defaulted to (All players)
Change it to Convert player to player group and you can specify an integer for player. Normally triggering player is used in most case (when a player click something -> change the dialog only to him)
I'm curious a bit about this. When you say the Event Handler can distinguish between players. I'm thinking that, if I correctly understand what you're saying, it could lead to me re-writing a lot of my code. (I'm not a programmer at all, just trying to learn all of this stuff)
Right now, I have it set up much like programmer states. Where I draw 8 dialog boxes (each in an array), each is showing to only a specific player. The same goes for every button inside of the boxes. Then i use parameters on all of the dialog functions to determine which player to show it too. I thought it was working pretty well, but when i tested it out today with some friends, one of the buttons wouldn't show up for player 2. Which is what drove my original post.
For single player testing, everything looks amazing. There's the ability to fully swap all the items in my dialog boxes, and it looks (almost) exactly how I want it to. But when i threw multiple people in there. stuff got wonky. I can't post the file now (i'm out of tow) but it's kinda like this
Loop that runs with i<=number of active players -> each loop iteration runs an Action definition (with a parameter of player number) (still a bit fuzzy on the difference between functions and action definitions, the seem REALLY similar to me.. TANGENT there!!! anyways... back on topic) to build dialog menu and dialog items -> from there i have dialog items that change around the other dialog items for each unique player dialog.
I know it's kind of hard to visualize in text and i apologize. I just really don't understand how it can be different between each player.