dop2000's Forum Posts

  • Your project is quite big and messy, it's hard to find the problem, I can't even reproduce it. Make a small test project and maybe we could help.

    If you are using charm_multiply sprite just for the multiply effect, you can make it square shape. It doesn't need to be the same shape as the original sprite, as soon as they are both on a separate layer and you set "Force own texture=Yes" on the layer.

  • You can use "loopindex" expression in all loops.

    For example:

    for each Sprite -> sprite Set ID to loopindex

    If you have 5 sprite instances, this will set their ID variable to numbers from 0 to 4.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • oosyrag no, it doesn't.

  • Since you only have one spawner and one timer, with multiple instances of trolls they are restarting the timer all the time.

    You should probably move the Timer behavior to Troll object. When health<=0, instead of destroying this troll, hide it from the screen and start a timer on it for 2 seconds. On timer event, destroy this troll and spawn a new one. Or you can simply move it to spawner position and reset its health (make him alive again).

  • It may be something simple, like the text can not fit into the text box. Try increasing the width and height of characterName and occupyInfo_Cost objects.

    If this doesn't help, add a debug text object to the layout and print debug information into it, for example, "Debug append text array_Character.AsJSON" - you will see if the array actually contains the right data of not.

  • Did you add "Jumpthru" behavior to the table sprite? You can only add "Jumpthru" and remove "Solid".

  • What exactly have you tried? I don't see any attempts in your capx file.

    Taking screenshot is pretty easy and there are lots of examples and tutorials.

    scirra.com/tutorials/1087/using-nodewebkit-to-take-and-auto-save-screenshots-in-desktop-builds

    scirra.com/tutorials/9553/screenshot-capture-to-email

  • That 3D cube is insane!! Thank you for sharing!

  • "Tap" is a gesture, it's triggered only after the finger is lifted from the screen, and it's more suited for buttons. In your case you need "On any touch start" event, it allows much faster reaction.

    Also, your project is for C3, and you are posting in C2 forum.

  • I am not good at JS. I believe you can send multiple parameters, like this:

    c2_callFunction('UpdateOpacity', ['sprites', new_opacity]);

    And then in C2 you access these values from Function.Param(0), Function.Param(1) etc.

  • Oh, I'm terribly sorry, I read your question wrong. I thought you wanted to find this ID for form control objects.

    I'm not sure this is possible for other object types. Maybe you can work around this using C2 callback function. You can call this function from your JS, pass the object type in a parameter, and then in C2 function you pick objects of that type and do something with them (change opacity or whatever). Something like this:

    In JS:
    c2_callFunction('UpdateOpacity', ['sprites']);
    
    In C2:
    Function "UpdateOpacity" 
     Function parameter 0 ="sprites" -> AllSpritesFamily set opacity to 50
    
  • 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.