dop2000's Forum Posts

  • curFrame variable is local, it's reset to default value at the end of each tick. You need to set it as Static - then it will remember its value.

    Check your other local variables, you may need to make some of them static as well.

  • There is a new feature in C3 - interactive layers.

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

    You can set "interactive" property only for the layer with the current difficulty, then all other non-interactive layers will not receive mouse events.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • This will be really difficult to make a system which will parse object names and instance variables in JSON strings. What I usually do is I add simple tags, for example: "Hey, (player_name)! If you bring me the magic scroll I will give you (coins) gold coins!"

    And then before showing this line on the screen I replace tags with real values.

    Set text to replace(text, "(playerName)", Player.Name)
    Set text to replace(text, "(coins)", NPC.questPrize)
    
  • Use "Platform Set Vector X" action. On collision with the wall, if the wall is to the right from the player (compare wall.x), then apply a negative vector, for example -100. If the wall is to the left, apply positive vector +100.

  • I think falling back to the default instance is reasonable if the given template does not exist.

    Template name will often be generated from some expression and I would prefer if nothing is created when such template doesn't exist. In many cases this will be less harmful than creating the wrong default instance. Here is an example:

    Maybe as an alternative solution you could add some method to check if a template with the given name exists? Say, a System condition. And also an expression to get the template name of the created instance? (so that I could immediately destroy it if it's wrong)

  • It's impossible to read that code you posted. Can you share your project file or a screenshot of events?

  • DiegoM I discovered that when you try to create an instance with a non-existing template name, the default instance is created. I think the correct behavior here would be not create anything - similar to how nothing is created if you specify a non-existing layer name.

  • Ashley

    Templates may help to spawn the right tilemap instance, but there may be cases when this will not work.

    In my example, some scenes may not contain a tilemap. If I create a scene by template and then attempt to create a (non-existing) tilemap instance with the same template name, the default instance of the tilemap will be created. By the way, this seems like a bug, I think if the template doesn't exist, then the instance should not be created. Like when you try to create an object on a non-existing layer.

    Of course, it's possible to find workarounds, but they will require a lot more effort. It would be much easier if tilemaps supported hierarchy.

  • When using a variable like "menuIsOpen", or checking if the menu layer is visible, the important thing is to change this variable (or layer visibility) after a small delay. For example:

    Mouse On MenuCloseButton clicked 
    Layer "menu" is visible
    ... Wait 0
    ... Set layer "menu" invisible
    

    There is a new cool feature in Construct - interactive layers. When layer is not interactive, objects on it will not receive click events. But you still need to be careful not to enable layer interactivity setting in the same tick with the mouse click, if you don't want the same click to go through to that layer.

    Mouse On MenuCloseButton clicked 
    ... Wait 0
    ... Set layer "game" interactive True
    
  • I think you can only show Applovin ads in C3 via mediation. If you can't use Admob, the other two options are IronSource and Tapdaq.

    IronSource addons are part of the Construct Collection, I think you can get it cheaper on itch.io, or chat with the developer at constructcollection.com , he might offer you a discount.

    Tapdaq addons are only about $10, but I haven't used them and can't tell you anything about them.

    .

    EDIT: Looks like there is also a Cordova plugin available. It may be possible to implement it without the C3 addon, but this will be a difficult task - you'll have to call JS methods and build with Cordova CLI.

  • Cocoon Ads is a very old addon. If you send me the project, I can remove it for you. My email is here.

  • You do not have permission to view this post

  • That particular demo is not mine and it's a bit too advanced for this task.

    I would probably use Bullet behavior with gravity, there must be a simple math formula to calculate bullet speed to land at the particular spot.

    Another easy option is running two tweens - one to move horizontally, and the second one with "ping-pong" setting to move up and then down.

  • I have two popular templates where random levels are built from "scenes", each scene contains a small tilemap and other objects.

    All scenes are currently stored on the main game layout, which is pretty messy. It would make sense to move all those scenes to a separate repository layout and use the new Templates feature to spawn them. But because tilemaps can't be added to the hierarchy, this is not possible.