dop2000's Forum Posts

  • fredriksthlm

    The chooseAsync functions displays "Play with friends" dialog, but friends don't receive any notification or invite to join the game.

    Could you please post an working example (for Construct 3) of how to use updateAsync to actually send an invite message to a friend? Just a simple text like "Can you beat my score?" and a game logo.

    I'm guessing it should be something like "FBInstant.context.chooseAsync() .then(FBInstant.updateAsync.....", but I've spent several hours and couldn't get it working..

    Also, how do you get a Base64 string from a sprite in Construct3?

    Edit: Never mind, I did it!

     
    Browser execute Javascript:
    "FBInstant.context.chooseAsync()
    .then(function () { 
     FBInstant.updateAsync({
     action: 'CUSTOM',
     cta: 'Play it now!',
     image: '" & base64Image & "',
     text: '" & message & "',
     template: 'GAME_TEMPLATE', strategy: 'IMMEDIATE', notification: 'NO_PUSH'}) });"
    

    Instead of encoding a sprite in C3, I used an online tool and simply saved base64 string in a constant variable.

  • You set the ID manually for each such object in layout editor. I don't think you can change or retrieve it with events.

  • Also what would be a more elegant way of doing this:

    CHARM_COLOR set animation frame to CHARM_COLOR.Charm1

  • You can use two Pode's addons - ExtractImage and InjectImage, download them here:

    github.com/Pseudopode/construct2_plugins_behaviors

    Extract image from sprite as Base64 string, save it to local storage. Next time you need it - get it from local storage and inject into the sprite.

  • no, they are not supposed to do that.

    According to the FAQ, "Intent" was added to future-proof the SDK and it will provide user-facing changes in the future

    Also, the information in Scirra's official manual for Instant Games plugin is misleading. It says "Show a dialog to invite, request, challenge or share, in a chat or timeline. The text to use in the share message can be provided."

    This is how it supposed to work, but not how it really works.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • shareAsync has different intent types (Invite, Challenge etc.) that are supposed to invoke different dialogs, but apparently they don't work yet in current SDK. Also, the message I enter in the "Text" field is not displayed.

    Yeah, I already found the solution with chooseAsync function, it does work. You can't change the message or image, but it's better than nothing.

  • R0J0hound It worked, thanks!

    oosyrag Yeah, typical Scirra :)

  • Is it possible to find the source code of official plugins in C3? I'm guessing they are saved in some browser storage/cache?..

  • I also have a problem with the Invite feature.

    For some reason it opens a simple "post photo" dialog, there is no text, no link to the game, nothing but the picture:

    I tried "Share", "Challenge" and "Request" intents instead of "Invite", and there is no difference, they all show the same dialog.

    Here is my event:

    .

    What I need is this dialog, is it possible to get it? (it's a screenshot from another game)

  • You can't use standard "Array load from JSON" action here, because arrays and dictionaries in Construct require custom JSON format (header).

    That "JSON" object with a yellow icon on your screenshot - is it rex_hash object? In this case I believe you need to remove "Array load from JSON", and instead add a sub-event like this:

    JSON for each key -> Array push JSON.CurValue(JSON.CurKey)

    I never used this plugin, so I may be wrong.

    There is a sample capx on the plugin page, have you tried it?

    rexrainbow.github.io/C2RexDoc/plugins.md/rex_hash.html

  • You never mentioned touch, or slide, or player speed. Are we supposed to read your mind? :)

    Use "Is in touch" event and Touch.SpeedAt(0), Touch.AngleAt(0) expressions to get touch direction and speed of swipe gesture. Based on these values you can decide how to move the character.

    For more accurate swipe gesture recognition you can save initial coordinates in "On touch start" event, and then check how far the finger moved, using distance() expression.

  • Here is the expression for the angle/direction of momentum:

    angle(0, 0, Sprite.Physics.VelocityX, Sprite.Physics.VelocityY)

    So you can simply make particles with a narrow spray cone, and set the angle of particles object to that expression.

  • How big is the text file? I'm guessing hundreds of megabytes?

    You can try splitting it into many smaller parts. And maybe create one or several index files. So, for example, when you need data for the word "cap", you check the index file, it tells you which file contains all the details for this word (say, db0123.txt). Then you request db0123.txt with AJAX and load it into CSV.

    It may be slow, but hopefully will work.

    .

    Another (better) solution would be moving the whole thing into a MySQL database and communicating with it via PHP or JS.

    .

    By the way, you should probably compress some data in the file, storing each letter of the word in a separate column is not very efficient.

  • Note that in my capx the origin image point of the trees and player sprites is at the bottom. Also, it doesn't look like you separated trunks from the leaves, like I suggested in my previous comment.

    "Wait 0" is needed, because we have to wait 1 tick for the trees to be created, before sorting them.

    "For each ordered" because we need to cycle through all trees sorted from top to bottom.

    If all this doesn't help, please share your capx file.