Letting other team members of the game know something has happened
T
Travis Evashkevich
started a topic
over 7 years ago
Heyo,
So my problem is that I have teams of players and they can explore a dungeon together.
If for example a dungeon is 1 room.
There is 2 players.
Each room of the dungeon has 3 states.
-Not Entered/Not Cleared
-Entered(claimed by a user)/Not Cleared
-Cleared
If Player1 enters the room, it goes to Entered and thus claimed by him. If Player 2 on his client goes to enter the room(which to him could still say Not Entered) the game will check GS and find that it is already Entered and then update his game to show this.
If Player1 then clears the room, GS gets updated that the room is cleared and the game will show a button to generate a new dungeon, he can make a new dungeon and keep exploring.
Player2 will still see the Entered room with no way to update the dungeon to the new one that Player1 is now on. Is there a way to "Push" to a user that a new dungeon is created or that there has been a change in the dungeon (as in a room state has changed?)
Hope I explained it nice enough, if not I can draw a picture :P
Best Answer
C
Customer Support
said
over 7 years ago
Hi Travis You will need to set up a listener in unity For example :
You can use TeamChatMessage when a player claims a room/or goes to another dungeon to alert the other players. Let me if that will work for you.
Thanks Katie
T
Travis Evashkevich
said
over 7 years ago
Nope, the claiming part is already done behind the scenes.
The part I'm having trouble with is just letting the other team members know when a new dungeon has been made if they are still "technically" waiting for one of the team members to finish the last room (as it will not update since they can't click on it and I don't want to waste calls on letting them have a "refresh" button unless it's the only way)
I thought maybe I could use a push message or something to force the game to update the client but I'm not sure. Basically what I want is a way to force a game client to make a call to GS on one of my custom events.
Like when the player that has that last room finishes it, I want to just add an extra event into the code I have for that, that will then make other team members game clients just call to GS to get the new dungeon.
If I can't then I'll just put in a refresh button...just wanted to lower possible call spam
Customer Support
said
over 7 years ago
Hi Travis
You can use a LogEventRequest to call a custom event from the client and update the server side game logic. Is that what you are looking to do?
Thanks
Katie
T
Travis Evashkevich
said
over 7 years ago
Pretty much the opposite.
I'm looking for a way to make a Gamesparks push something to the clients so I can then make the clients use one of my already made custom event requests (GetDungeonInfo in this case)
I don't know if I can just send a push message with a message for my game in it or if there is a better way to do this...
T
Travis Evashkevich
said
over 7 years ago
Here, I made a video of the problem in action.
T
Travis Evashkevich
said
over 7 years ago
I think this would also be the same way that for example, if I wanted to update an image in my game from the GSDownloadables section, how would I tell my game that a new version of a downloadable is ready for the client to download.
Customer Support
said
over 7 years ago
Hi Travis Thanks the video helped me to understand the problem. To update other player of a change in the game you can use messages. Data can be stored in a json in messages. When a player creates a new dungeon a logEventRequest can be called in the event you can use SendMessage
Spark.sendMessage({"newDungeon":true},myplayers);
Thanks
Katie
T
Travis Evashkevich
said
over 7 years ago
Awesome thanks, I'll give that a whirl.
Next question of the day is I went to go and check my collections and it seems that all my runtime and meta collectiona
Any idea what's going on?
Customer Support
said
over 7 years ago
Hi Travis,
There was a slight issue earlier but everything is back to normal now, your collections should be visible again. Can you confirm everything is ok at your end now ?
Thanks,
Liam
T
Travis Evashkevich
said
over 7 years ago
Yup it's there again.
Thanks :)
T
Travis Evashkevich
said
over 7 years ago
Having a bit of an issue trying to put the players that need to be alerted in the message part.
It errors out on the last line saying that it can't convert from native array to SparkPlayer[]. I tried making a new SparkPlayer[] but it didn't want to let me do that either.
What am I missing here?
T
Travis Evashkevich
said
over 7 years ago
I got it working I think (at least it sends the message now, just shoved loadPlayer into a for loop for now. )
For capturing the message in game and doing stuff with it, will I have to add some extra logic in the actual GameSparks SDK? I'm using Unity and I can see the debug log that I get the message just yeah, not quite sure how to capture that when it happens
Customer Support
said
over 7 years ago
Answer
Hi Travis You will need to set up a listener in unity For example :
Travis Evashkevich
Heyo,
So my problem is that I have teams of players and they can explore a dungeon together.
If for example a dungeon is 1 room.
There is 2 players.
Each room of the dungeon has 3 states.
-Not Entered/Not Cleared
-Entered(claimed by a user)/Not Cleared
-Cleared
If Player1 enters the room, it goes to Entered and thus claimed by him. If Player 2 on his client goes to enter the room(which to him could still say Not Entered) the game will check GS and find that it is already Entered and then update his game to show this.
If Player1 then clears the room, GS gets updated that the room is cleared and the game will show a button to generate a new dungeon, he can make a new dungeon and keep exploring.
Player2 will still see the Entered room with no way to update the dungeon to the new one that Player1 is now on. Is there a way to "Push" to a user that a new dungeon is created or that there has been a change in the dungeon (as in a room state has changed?)
Hope I explained it nice enough, if not I can draw a picture :P
You will need to set up a listener in unity
For example :
Thanks
Katie
- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstCustomer Support
You can use TeamChatMessage when a player claims a room/or goes to another dungeon to alert the other players.
Let me if that will work for you.
Thanks
Katie
Travis Evashkevich
Nope, the claiming part is already done behind the scenes.
The part I'm having trouble with is just letting the other team members know when a new dungeon has been made if they are still "technically" waiting for one of the team members to finish the last room (as it will not update since they can't click on it and I don't want to waste calls on letting them have a "refresh" button unless it's the only way)
I thought maybe I could use a push message or something to force the game to update the client but I'm not sure. Basically what I want is a way to force a game client to make a call to GS on one of my custom events.
Like when the player that has that last room finishes it, I want to just add an extra event into the code I have for that, that will then make other team members game clients just call to GS to get the new dungeon.
If I can't then I'll just put in a refresh button...just wanted to lower possible call spam
Customer Support
You can use a LogEventRequest to call a custom event from the client and update the server side game logic.
Is that what you are looking to do?
Thanks
Katie
Travis Evashkevich
Pretty much the opposite.
I'm looking for a way to make a Gamesparks push something to the clients so I can then make the clients use one of my already made custom event requests (GetDungeonInfo in this case)
I don't know if I can just send a push message with a message for my game in it or if there is a better way to do this...
Travis Evashkevich
Here, I made a video of the problem in action.
Travis Evashkevich
I think this would also be the same way that for example, if I wanted to update an image in my game from the GSDownloadables section, how would I tell my game that a new version of a downloadable is ready for the client to download.
Customer Support
Thanks the video helped me to understand the problem.
To update other player of a change in the game you can use messages. Data can be stored in a json in messages.
When a player creates a new dungeon a logEventRequest can be called in the event you can use SendMessage
Spark.sendMessage({"newDungeon" : true}, myplayers);
Thanks
Katie
Travis Evashkevich
Awesome thanks, I'll give that a whirl.
Next question of the day is I went to go and check my collections and it seems that all my runtime and meta collectiona
Any idea what's going on?
Customer Support
Hi Travis,
There was a slight issue earlier but everything is back to normal now, your collections should be visible again. Can you confirm everything is ok at your end now ?
Thanks,
Liam
Travis Evashkevich
Yup it's there again.
Thanks :)
Travis Evashkevich
Having a bit of an issue trying to put the players that need to be alerted in the message part.
It errors out on the last line saying that it can't convert from native array to SparkPlayer[]. I tried making a new SparkPlayer[] but it didn't want to let me do that either.
What am I missing here?
Travis Evashkevich
I got it working I think (at least it sends the message now, just shoved loadPlayer into a for loop for now. )
For capturing the message in game and doing stuff with it, will I have to add some extra logic in the actual GameSparks SDK? I'm using Unity and I can see the debug log that I get the message just yeah, not quite sure how to capture that when it happens
Customer Support
You will need to set up a listener in unity
For example :
Thanks
Katie
-
Documentation Notes
-
Design issues with user events
-
Using NoSQL
-
Runtime Collections vs Metadata Collections
-
Anonymous authentication from browser app
-
Modules
-
Movement With Unity
-
Problem with url parameters for downloadables
-
Querying NoSql GameSparks database
-
Challenge accesType
See all 2487 topics