Nepeo's Recent Forum Activity

  • Errr maybe? I expect all my DropBox links on the forums are dead ends now unfortunately.

    I'll take a look and get back to you.

  • Hey kurakurt. If you run your application with a test user does it work correctly? Quite often these problems come down to configuration errors on the Apple IAP settings. It is quite a complex and confusing service to configure unfortunately. It's worth going through the various screens on itunes connect. Ensuring that your products are activated and you have completed the various paperwork they request. If you do find any configuration issues it's then worth waiting a day or 2 to ensure the servers have updated etc.

    If you are still struggling then try reducing it to a minimal reproduction and filing an issue on the C3 bug tracker.

  • Hey sorry about the slow response. Haven't been on the forums for a couple of weeks.

    So I loaded up the Multiplayer chat room demo and it kinda does something similar to this already, except it uses a list object to contain and display the entries. I made the following adaptations so that it matches your requirements:

    1. Delete the PeerList object from the project

    2. Add a Dictionary object and rename it UserDictionary

    3. Add a text box to the Chat layout to the right of the chatbox where PeerList used to be ( with the same dimensions ).

    After this I added a new group to the Chat eventsheet with the following logic:

    Okay so theres 2 things going on here. First is we're tying into some events from the multiplayer plugin to update our Dictionary. The second is we're updating our textbox with the entries.

    To do the first we bind the event "on signalling joined room" to add our user ID and alias to the dictionary. Next we bind the event "on peer connected" to add other users to the dictionary. Then we bind "on peer disconnected" to remove users from the dictionary when they leave. Finally we bind "on kicked" which tells us we're not part of the room, so we should remove all the entries in the room.

    To update the textbox I created a small function that clears all the text, then appends a line for each entry in the userdictionary which is a combination of the key, the value and a newline. We're using the PeerID as the key, and the value we store in the PeerAlias. So we end up with something like "AAAA: User 1" for each user.

    I've validated this works as expected with users connecting and disconnecting. Hopefully you can recreate what I've done here with the demo, I believe it's doing everything you require.

  • While the Dictionary ACEs don't support numbers for the key you can convert your number into it's string form to use as a key. The key is unique and reproducible still so that should work fine for your use case.

    The str(mynumber) expression will convert a number to a string. int(mynumericalstring) and float(mynumericalstring) will convert a numerical string into a integer or float respectively for the reverse operation.

    In your other snippet you are using the peerCount expression, which will give you the index + 1 of the last entry. If a peer leaves it will upset your indexing scheme. Also because it's index + 1 you will likely get off by one lookup errors, so I would not recommend doing this.

  • Hey Colludium sorry for the delay. I've been out of the country for awhile.

    So globalThis is still kinda new, so I wouldn't be surprised if it wasn't supported on Safari. However, it should in theory be polyfilled by the construct runtime so that it appears to exist on all platforms for users.

    If it's not appearing then it might be because the code is running before the polyfill ( unlikely ), that you are running code in a context that the runtime hasn't polyfilled ( possible ) or that the polyfill was broken some other way.

    If you know the environment I would be tempted just to use another alias for the global object.

    As a bit of context in case you aren't aware; the reason why "globalThis" exists it is because the name of the global object changes depending on where you are running your code. In Node.js it's "global", if it's a standard browser context it's "window" and if it's a browser worker context it's "self" ( self also works standard browser context, but not Node.js ).

  • Mmm it's possible that one of them does. You are better directing your question to Ashley at the moment though.

  • haypers glad you solved your questions!

    eski the preview URL only effects you if you are using the web API. If you are using the Android export and can't sign in it's most likely a configuration error, I have posted a checklist elsewhere on the forum about things to check in your config. I'm afraid I can't really search for it at the moment.

  • eski the APK must be signed ( with the correct key ) to work. A recent beta release added the option of signed debug APKs which are useful specifically for this situation. You can export the APK, copy it to your device, install it and then do your tests. So you don't have to go via play store release channels.

  • I think there's a bit of confusion here. The Google Play plugin supports 2 APIs. One for web, the other for Android apps. Web does not work on Android, and Android does not work on the web.

    They can both be setup at the same time and linked to the same leaderboard. But it isn't the simplest of setups.

    It's possible to setup the web version to work in preview.

    The 2 APIs have slightly different feature sets. There's a few actions marked "mobile only" which indicate these. For instance the web API does not support the "show leaderboard" action, because it's only available on Android.

  • Are you using the Google App Signing service? This can muddy the water a little, because if you are Google resign the APK and then you need to use the signature for their key instead. It's possible that they would insert it into the field automatically if you are using it ( just guessing ).

    You can get the signature from a keystore or a signed APK using the "keytool" program that's included in the Java Development Kit ( JDK ). There's an explanation here. Unfortunately if you aren't familiar with command line tools this might be hard for you to follow.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can store images as base64 string in an array, then decode them into images as required. But be careful about the size of the images.

    Base64 converts bytes into a subset of 64 values that can be safely represented as letters in a document. As it's a subset that means you end up increasing the number of bytes you need. For every 3 bytes in, you get 4 bytes out. So a 3MB image is 4MB encoded as base64. Also JS uses 2 bytes per character for strings, so that becomes 8MB once the array has been loaded into memory.

    Otherwise it's a fairly sound idea. I've written programs that embed binary data in the file as base64, it's an easy way to reduce the number of network requests.

    A more complicated alternative is to download the images when the game is first loaded, then stash them in localstorage. Localstorage is written to disk so it won't impact your memory usage as much, and you can write binary data directly instead of using base64. It will be a little slower to load the image than accessing from an array, but faster than the network.

Nepeo's avatar

Nepeo

Member since 8 Mar, 2016

Twitter
Nepeo has 583,792 followers

Trophy Case

  • 8-Year Club
  • x4
    Coach One of your tutorials has over 1,000 readers
  • x3
    Educator One of your tutorials has over 10,000 readers
  • RTFM Read the fabulous manual
  • Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

13/44
How to earn trophies

Blogs