dop2000's Forum Posts

  • GetAsBeautifiedString() expression returns a portion of JSON as a string, which contains key names and values, with quotation marks "" and line breaks. These special characters need to be escaped with "\" if you want to store them in JSON as a string.

    To be honest, I don't understand what you are trying to do. If you want to copy all values from "Equip.0" into "Item", use Set JSON action:

    JSON Set JSON: "Item" to JSON.GetAsCompactString("Equip.0")

  • Your events 26-27 can potentially run on every tick. And you have "Wait" action in them. This can cause serious problems.

    My guess is that the issue you are having is caused by that Wait action - even when the condition becomes false, all delayed actions from previous ticks will continue to run for 3 seconds! And if you reset isFinished to false in some other event, these delayed actions will continue to set it to true for 3 seconds.

    Use Timer behavior instead of wait - Timer runs per instance and can be stopped or paused.

  • You do not have permission to view this post

  • when I used the action to set collision cell size to 10x10 it reduces the checks down from 125000 to 800.

    This is insane! I wonder if collision checks actually work correctly with such heavy optimization.

    Ashley Could you comment? 125000 to 800 seems too good to be true.

  • So I tested again and here are the results:

    There are 1000 instances of sprite A and 1000 instances of sprite B. Animation frame is set to 1 for half of them.

    250K collision checks per tick - collision cells are working.

    125K collision checks - collision cells are working. And it's more efficient because we eliminate half of A instances.

    500K collision checks - collision cells are NOT working.

    Test project:

    dropbox.com/scl/fi/u8tlp28lh0fj87yh1n6n9/coll_cell_test.c3p

  • The way you are using functions is very wrong. Functions should be at the top level, avoid nesting them under other events or conditions. Also, "Every X seconds" inside the function won't work.

    And that chain of functions calling each other is completely unnecessary..

    Say, you want to spawn a new wave of sharks every 2 seconds. And each wave should contain 5 more sharks. Then you can do something like this:

  • Yeah, you are right! With no sub-events I get ~430 iterations. With two nested sub-events only 163

  • You are adding children to Button family. It should be "ButtonNormal add child ButtonPressed".

    Even if Button and ButtonNormal is the same object, Construct treats the family as a different object in events, allowing to pick family instances independently from object instances.

    Also, the second event should probably look like this:

    Cursor is over ButtonNormal 
    Cursor Left button is down
    .. ButtonNormal pick child ButtonPressed : ButtonPressed set visible
    Else 
    .. ButtonNormal pick child ButtonPressed : ButtonPressed set invisible
    

    And by the way, while hierarchies is an awesome feature in Construct, in this particular case it would be better to use a container instead. Then both objects in a container will exist as a pair, creating one will automatically create another, picking one will pick another and so on.

  • This is odd, I'm getting the same v=237 on my laptop and desktop pc. And then "Maximum call stack size exceeded" error in console.

  • Weird, I just tested with 2000 sprite instances, and I'm getting the same number of collision checks and the same fps with "Is overlapping" being the first, second or only condition in the event.

  • I did a test to see how many times I can call a function recursively in C3:

    And the answer is 237.

    Is this a hard limit? Or can it be higher/lower on other devices, depending on the amount of RAM etc.?

    Tagged:

  • If you know the IIDs of two instances, you can do this without the family:

    Slot(iid1).AnimationFrame=1 | Slot(iid2).AnimationFrame=2

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You mean compare animation frames of TWO instances of the same sprite?

    The easiest solution is to use a family. Add slot to a family, and use two conditions:

    Slot animation frame=1
    SlotFamily animation frame=2
    
  • It's not possible. And Construct game won't run properly at framerates lower than 30.

    Perhaps I misunderstood your problem, but if you want your animations to run at 8 frames per second, you need to set animation speed to 8. They will run at this speed at any framerate.

  • Have you tried changing layout scale? What exactly doesn't work and what did you try?