aminhanifm's Recent Forum Activity

  • 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

  • EDIT solved moving video files (after export .zip file) from www[/b] to www\media subfolder. Now video playing fine, even without trigger input.

    It is still not working here, using phonegap export with .webm format

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

    Okay i get it.. thank you so much

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

  • Sure.. im so glad if you can help me to solve this issues <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile" />

    so i got the screenshot of the events and here are the screenshot..

    imgur.com/a/NNAqe

  • it's not working on android phone, im using phonegap with webviewplus cordova plugin from cranberry game. Anyone find this working on devices ?

    EDIT : nvm it's working, i put wrong apk files on my phone

  • What exactly is the problem?

    So once the data is sent like so on the Photon raise event action, on the TRIGGER, if you want to access Sprite.X, you use say, a local variable Token0 and assigned it to int(tokenat(Photon.EventData,0,"|")).

    As an example if Sprite.X = 50 and Sprite.Y = 75, Photon sends as a string 50|75|

    tokenat(Photon.EventData,0,"|") gets the 1st element from that string until the delimiter, which is |, so 50, then using int(50) you transform it from string to int.

    I used Demo-pool from photon examples, first i edited on join room with a function called "createFish" with random(Layout.Width) on parameter 2 and random(Layout.Height) on parameter 3 and add raise game event 1 with Function.ReturnValue & "|" & Fish.X & "|" & Fish.Y after that function, then on event 1 it calls "createFish" function with float(tokenat(Photon.EventData,1,"|")) at parameter 2 and float(tokenat(Photon.EventData,2,"|")) at parameter 3, then on function "createFish" i changed the position of creating fish X to function.param(2) and Y to function.param(3). but i still getting randomed spawn whenever i play it..

  • Data can be Sprite.X & "|" & Sprite.Y & "|" or using any delimiter you want, then you use tokenat to grab what index you need.

    Thank you so much again ! but i tried it again and im still getting stucked at this problem

  • Anyway can i add more than one data on raise events ? if yes how can i add more than one value data on raise game event for example Fish.X and Fish.Y ?

  • aminhanifm

    createFish accepts 2 parameters. You need to add 2 more to pass position. Also add position values to payload when raising event 1 and parse them when handling "On event 1". Current payload is fish type number. You need to pass a table with 3 parameters instead: type, x and y. Because Construct does not support js objects as parameters, encode this table in string, with json e.g.

    Thank you so much ! i will try it soon

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • aminhanifm

    Which exact Photon example do you use? What is the name of the function? Do you have any errors or something does not work as expected?

    I am using Demo-pool Photon example, the name of the function is createFish, i don't get any errors but if i change the position of creating fish to random then if there's new player joined, the new player will be created on randomed place on my screen then it moving until the new player get into the real position, and the new player's screen is also creating my fish to a random position and it moving to my real position.

  • Im using photon's example, and theres a creating function which are being used for actor join and game event raises, that makes me really confused. maybe i can send you the capx if you want

aminhanifm's avatar

aminhanifm

Member since 9 Feb, 2017

None one is following aminhanifm yet!

Connect with aminhanifm

Trophy Case

  • 7-Year Club
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • x16
    Quick Draw First 5 people to up-vote a new Construct 3 release
  • x3
    Lightning Draw First person to up-vote a new Construct 3 release
  • Email Verified

Progress

12/44
How to earn trophies