dop2000's Forum Posts

  • Did you tick "Stop on solids" in MoveTo behavior? Also, did you specify filter name in the Solid behavior properties?

  • Email notifications should be going out - I'm not sure why they wouldn't be.

    I always receive them post factum, after the subscription has been renewed.

  • Laura_D Could you please add an email notification sent 1-2 days before the subscription expires?

    When the subscription is charged once a year, it's easy to forget about it. Many bad things can happen, the card may be expired or get overdrafted. Recently I was charged $70 for a friend's subscription which I had no intention to renew, only because my card was linked to it!

  • AJAX request is an asynchronous action, it is not completed immediately.

    Better move it to "On Start Of Layout" event, you don't need to read the file on every tap. And add "System Wait for previous action to complete" between the "AJAX request" and "JSON Parse".

  • If all hammer names are unique, it may be easier to get rid of the array and change your JSON to this:

    {
    	"hammers": {
    		"Basic": {"damage": 2, "speed": 3},
    		"Enchanted": {"damage": 4, "speed": 3},
    		"Massive": {"damage": 10, "speed": 1}
    	}
    }
    

    Then you will be able to access any hammer stats directly, for example:

    JSON.Get("hammers.Massive.speed")

  • "hammers" in your JSON is an array. If it contains more than one record, and you don't know the exact index, you will need to loop through it to find the right hammer record.

    JSON For Each entry in "hammers"
    JSON Has Key "." & hammer.AnimationName
    ---> Wheel add JSON.get("." & hammer.AnimationName & ".speed") to speedTotal
    
    

    When a path starts with "." it's a relative path. For example, once you set the path to "hammers.0.Basic", after that you can get speed value by a relative path ".speed":

    JSON Set path to "hammers.0.Basic"
    Wheel add JSON.Get(".speed") to speedTotal
    
  • Here is my usage case - I have a dialogue system based on JSON files. These dialogues may call various functions with variable number of parameters:

    {"function": "functionName", "params": ["foo", 1, 20, 30, "bar"]}
    

    So there is a single script which calls all these functions:

    if (localVars.params=="") {
     runtime.callFunction(localVars.fName);
    } else {
     var p = JSON.parse(localVars.params);
     runtime.callFunction(localVars.fName, ...p);
    }
    

    I guess this can be re-done with function maps, but it will probably be a huge task, taking hours.

  • A slightly better version:

    dropbox.com/scl/fi/kvw67jw5q5akbxnfndnc4/PageFlip3.c3p

  • The family trick should definitely work. But either you are using Pin or hierarchy, one instance is always a "parent" and another a "child". You can only control the parent instance.

    If you want to combine two instances and control them as a single object, you might need to think of some other approach. Maybe use an invisible sprite as a parent object, and pin both instances to it. Or paste them on a DrawingCanvas and destroy the original instances afterwards.

  • Here are recent poll results from a local C3 group:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Here is a demo I made some time ago, it's not as good as in the link you posted, but maybe you can get some ideas from it:

    dropbox.com/scl/fi/mm3c0s82kpqsory4ojf7u/PageFlip2.c3p

  • You will need to use a family. Add the sprite to a family, move Pin behavior to the family level.

    Then you will be able to pick one instance of the sprite and another instance of the family in the same event and pin them together. For example:

    Sprite On Collision with Family : Sprite Pin to Family
    

    Instead of Pin behavior you can use hierarchy - it's more advanced.

  • And these sprites have the colors already in instance variables, so i wonder what could be the best option to copy the clicked color of the sprite to the canvas.

    Once you grab the color values from the sprite, you can fill the entire canvas with that color using this action:

    -> DrawingCanvas: Clear canvas rgbex255(r, g, b)

    However, flood-filling a portion of the picture (like one tooth or one part of a tooth) is much more difficult. The example in that link I posted is using a JavaScript code to flood-fill an area.

    .

    There is a completely different approach without a canvas. Put each tooth in a separate animation frame in a sprite. Fill each surface of the tooth with different colors in the editor. So there will be 5 unique colors, repeating on every tooth in the sprite.

    And then use ReplaceColor effect. Here is a little demo:

    dropbox.com/scl/fi/mk2ypi9f5nhxvyffyzyv2/RainbowTeeth2.c3p

  • I don't know what to explain. Only one key will work at a time.