ThePhotons's Recent Forum Activity

  • Plugin event data is always a string value. You can pass a number as well but it will be converted to a string.

    To preserve types and js objects structures, use json encoding and decoding for event data.

  • If I raise an event with the value 1 in integer.

    The received event will have the value 1 but this will be a literal value, not a integer, am I right? I will have to use int to get the integer value 1.

    In case you mean event code. There is a bug in Photon plugin. Photon.EventCode should return numeric type instead of string. To be fixed soon.

    Note that usually 'onEvent' condition used which accepts event number, so you do not need Photon.EventCode.

    Thank you for bug report.

  • Hi, ThePhotons

    Is there any "Rejoin" and "FindFriend" example in Photon's official showcase?

    https://www.photonengine.com/en-US/PUN/showcase

    i,

    You can find Rejoin button below Suspend in demo-test app.

    We do not have "find friends" demo. To implement it, you need:

    • call "Set user id" action with user name before join
    • call "Find friends" action with comma-separated list of friend names while connected to a lobby
    • handle "On FindFriends result" event
  • What happens when two players shoot the same event?

    Is the same event executed twice on the same tick? I think that is not possible and the data of a player will be lost.

    By default (Recievers=Others), 1st client receives 2nd client's event and vise versa. All other clients receive both events. With Receivers=All, both 1nd and 2nd receive both events. Events are differenciate by player number (Photon.ActorNr). That is why you do not need event codes per players.

  • Hello

    How to control the loss of packages ?.

    Hi,

    Websocket connection guaranties packets delivery. You can't loose any packet while connected.

    Add logging of sending and receiving of events and key presses. This should help to find the reason of the issue.

  • Hi.

    Please I do not understand well ... what is the difference between photon.ActorNr and photon.MyActorNr?

    Hi,

    Each player in a room uniquely identified by a number assigned during joining a room.

    photon.MyActorNr is the number assigned to the local player.

    photon.ActorNr is the number of the player last "per client" condition like "On actor join" or "On event" was triggered for.

  • Yes but sometimes it doesnt added when i killed another player..

    Synchronizing player properties over network does not happen immediately. Make sure that you update player property successively from the same client: property owner or master client. This prevents from concurrent writes when 2nd client increments the value not seeing that it's already incremented by 1st client.

    Trace your code with logs to see how kill count changes.

  • ThePhotons How can i make a kill counts after my bullet colliding an object without adding a kill count to another players? because i got stucked on this problem that the another players also get the kill counts

    How do you add kill count?

    Using player properties looks like the simplest option if you need to synchronize count across network.

  • Here is my summary before page 54.

    Great work.

    I've added the link to initial post.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • When I add "alertblocker" plugin there is error when i try add some new object

    Please try updated plugin: https://www.dropbox.com/s/kjr0pey3zc5nc ... addon?dl=1

  • > Btw please fix this issue of trying to connect to a random room while connected to a room. Getting alerts with js errors is not too great.

    >

    Underlying Photon js library throws exceptions. This is not a problem in js app but it seems like it's not possible to catch exceptions in Scirra app. We will think about changing error handling w/o breaking existing js apps.

    I wrote simple "alertblocker" plugin which disables alerts if AlertBlocker object exists in a project. It has nothing to do with Photon and can be used in any project. You can find plugin in updated Photon Construct 2 SDK: https://www.photonengine.com/en-US/sdks ... construct2

    Also Photon and Photon Chat plugins trigger "On error" condition if exception is thrown by Photon library.

  • So the point is, can i spawn joined player to a randomized position and old joined player spawned on the last place he moved (not by randomized) ? maybe you can help with the events that should i put..

    You spawn player object once, most likely on joined client. Then you create object copies on other clients.

    For original object, you set position explicitly (e.g. using random numbers). For object copies, you synchronize position with original object each time this position changes including initial position assignment. Also, each existing client should send position update to a new joined client.

ThePhotons's avatar

ThePhotons

Member since 13 Feb, 2015

Twitter
ThePhotons has 7 followers

Connect with ThePhotons