dop2000's Forum Posts

  • You have expression editor on your screenshot, not a script.

    I believe C3 uses some proprietary way to encode color values. If there is no documented JS method, then your best bet is to convert the color in an event and then pass it to the script via a local variable.

  • rgb() is deprecated, it's left for compatibility with old project.

    There are four expressions you can use - rgba, rgbex, rgba255, rgbex255

    The first two take values from 0 to 100. For example rgba(100,0,0,0) is red.

    The other two take values 0-255, rgbex255(255,0,0) is red.

    You can find all this info in the documentation:

    construct.net/en/make-games/manuals/construct-3

  • .I want to spawn sprites when the dictianory is filled with keys, let's assume this is a websocket multiplayer game that is set up using inputform,

    In this case spawn the sprites in the same event where the keys are added to the dictionary. Or in some other event which is executed once.

    Just don't place the loop as a top-level event, because then it will run on every tick and spawn the sprites infinitely.

  • If you want to spawn those object when the layout starts, move the loop into "On start of layout" event.

    On Start of layout
    ... Dictionary for each key : Create object by name Dictionary.CurrentKey
    
  • The second event on your screenshot runs on every tick (60 times per second or more). That's why the objects continue spawning.

    Any events which are not triggers or functions run on every tick.

    You need to put the loop inside some triggered event, for example "On start of layout"

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You are using a wrong loop. Instead of "System -> For each dictionary" you need "Dictionary -> For each key"

    Inside the loop you can use Dictionary.CurrentKey and Dictionary.CurrentValue

    .

    Another option is to use "System Repeat Dictionary.keyCount" loop.

  • You can switch the sprite to another (empty) frame or animation.

    Or use this to clear the image:

    SnapshotSprite: Load image from "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVQYV2NgYAAAAAMAAWgmWQ0AAAAASUVORK5CYII=" (Keep current size, cross-origin anonymous)
    
    
    
  • Do you want just to position them in a circle, or should they move/rotate around the center of the circle?

    To position you can use a loop, for example for 16 sprites:

    Repeat 16 times:
     Create Sprite at (centerX, centerY)
     Sprite move 100px at angle loopindex*(360/16)
    
  • Isn't it better to use worker mode for performance?

    Yes it is. With the worker disabled in our project, there is now a significant lag before graphics is loaded for every object. You create a sprite and it appears a full second later...

  • I'm assuming you are making a platformer? There are hundreds of free examples in Construct, for beginners and advanced developers. You can open and study any of them, or even use them as a template for your own game.

  • For some reason it never occurred to me that I could create multiple instances of objects that don't have a location on screen.

    Yeah, it's a forbidden knowledge haha

    It's also possible to add an array to a container with other objects. For example, if you add StatsArray and Enemy sprite to a container, then each enemy instance will have its own instance of StatsArray.

  • You don't need CSV, you can simply copy-paste data from Excel directly into C3 array editor. Just create an array with enough empty cells and press Ctrl-V

    You can make 2D and even 3D arrays. For example, in our game we have ShopsStock array with multiple sheets. Each sheet is a different shop. On Y axis there are items, on X axis - properties like item cost, materials etc.

    Check out this comment:

    construct.net/en/forum/construct-3/how-do-i-8/trying-plan-code-game-start-179514

    I also suggest learning JSON, it can make your task much easier. I actually prefer using JSON now where possible.

  • You need to disable the worker in project properties. It's an NWjs bug, see comments in this post:

    github.com/nwjs/nw.js/issues/8075

    I really hope they fix this soon, because disabling the worker tanks the performance in our game.