dop2000's Forum Posts

  • I posted a suggestion a few years ago for "Is project file exists" condition, but it was declined.

  • Instances on an inactive layout are not pre-created and can't be destroyed.

    When in runtime you need to create an instance of an object, C3 engine will search all layouts for this object. And, once found, will use it as a template. If the object exists on multiple layouts, the first found will be used.

    So my guess is that there is zero performance impact.

    There is another thing to consider though. When you create an object from an inactive layout, there may be a small lag while its images are loaded. (especially if it's a large sprite with lots of animations). Placing an object on the current layout and immediately destroying it allows to pre-load the textures into memory. So the next time you create an instance of it, it's created without a lag. However, you can use "System Preload images" actions to achieve the same result.

  • Why do you need all 8 directions? You can only detect left/right/up/down and the behavior will do the rest.

    Lefx X axis<deadzone : 8direction simulate pressing Left
    Lefx X axis>deadzone : 8direction simulate pressing Right
    Lefx Y axis<deadzone : 8direction simulate pressing Up
    Lefx Y axis>deadzone : 8direction simulate pressing Down
    

    Another option is to calculate the angle:

    Set a to angle(0,0, Gamepad.Axis(0,0), Gamepad.Axis(0,1))

    Then round it to the nearest 45 degrees:

    Set a round(((a+360)%360)/45)*45

    a will contain a number between 0 to 360 in 45 degree increments. For example a=135 means Down+Left.

  • Correct.

  • You will have to do this with events. When such slope is detected in front, change Player position directly, or apply VectorY+VectorX, or temporarily disable Platform behavior and move the character up the slope with MoveTo.

    Look for the examples of ladder implementation in platformer games, it should be pretty similar.

    Here is a simple example, but you can try other methods depending on your game.

  • "For each element", and then you can select: X, XY or XYZ.

    If you only need to search in one row or column of the array (say at Y=7), I suggest using System For loop.

    System For "x" from 0 to Array.width-1
    find(Array.at(loopindex,7), "chocolate")>=0
    
  • For a 2D array use "Array For each XY", or two nested "System For" loops.

  • Instance variables belong to object instances. When you restart the layout, object instances are destroyed and created again. That's why the variables reset.

    You can use global variables to store values which should not reset. Or data objects - arrays, dictionaries, JSON.

    Another option is to set your object as Global. It will not be destroyed as you restart or go to another layout. But be very careful, make sure that you are not creating multiple duplicates of this global object with every restart. Use Debug Mode to check.

  • Are enemy and enemy_gun sprites in the same container? If not, then your events will not work correctly. Because like I said, you need to pick the right instance of enemy_gun, which belongs to each particular enemy. How do you link/attach guns to enemies? Using hierarchy, or pin, or some other method?

  • You can loop through all array elements and use find() expression.

    Array for each element
    find(Array.CurValue, "chocolate")>=0 
    
  • You need to pick the gun instance which belongs to this particular enemy.

    There are different ways to do this, depending on how you build your game. You can use a container or a hierarchy, then the gun will be destroyed automatically when the enemy is destroyed.

    construct.net/en/make-games/manuals/construct-3/project-primitives/objects/containers

    construct.net/en/blogs/construct-official-blog-1/lets-talk-scene-graph-1569

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I found some strange routines expressed by the AI.

    I really don't recommend using it for Construct. As a test I asked it a few C3-related questions and the results were total nonsense (although seemingly convincing).

  • Just change the properties in the same event you spawn the object.

    -- Object Spawn Object

    -- Object Set Height 200

  • ChatGPT doesn't know Construct as well as other programming languages. It can only help with very basic questions. And will very often give wrong and confusing results.

    It can help with Javascript code, if it's not Construct-specific.

    Construct is intended for people with little or even zero programming experience. Study a few tutorials and built-in examples, and you could start making games in Construct in no time!