dop2000's Forum Posts

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

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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

  • If there are only two weapon slots, then it's even easier, you don't need the array.

    dropbox.com/s/ho7081r4jzgcuoe/WeaponChange2.capx

  • I don't think you can do this in one "Pick by evaluate" event..

    Here is my version, may not be the most efficient, but it works:

  • I think you should use EasyStar to find path on a grid, and then some other behavior (for example MoveTo) to move from one node of the path to another.