dop2000's Forum Posts

  • The common way to do this is by adding the object to a family. Move all variables and behaviors to the family level. Then you will be able to pick family instance and sprite instance independently in the same event, and copy values from one to another.

    With two parent instances it may be a bit trickier. You may temporary set an instance variable "IsParent" for two parents. (make sure it's not set for all other instances). Then pick a random parent.

    Family IsParent=1
    Pick random Parent instance
    ... Sprite set speed to Parent.speed
    
  • Instances which you've just created may not yet be available in other events. The easiest solution is to set the "current" variable in the same event where the card is created. But then you will have to calculate the permutation index.

    You can probably set this variable in On Created event:

    Card On Created -> Card set current to floor(AdvancedRandom.permutation(Card.IID)/2)

  • Perhaps C3 can't decompress the data. It definitely works with uncompressed data in TMX.

    Try exporting it uncompressed.

  • Function.Param is an old expression from Construct 2.

    Are you using this code inside a C3 function? Then instead of Function.Param type the parameter names.

  • What do you mean by "regular license"? With the Personal license you can publish your games anywhere you want.

  • How do you attach that child sprite to the parent? With hierarchy, physics joint, Pin?

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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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/s/2i07fpcg9b30env/PageFlip3.c3p