dop2000's Forum Posts

  • At runtime. I want to get rid of the errors in console log when a non-existing function is called.

  • I'm using runtime.callFunction to call C3 functions by name. Because there are hundreds of functions in the projects which can be called from dialogues, menus etc., it's much easier this way than creating function maps.

    Is there a way to check if the function with this name exists before attempting to call it?

    Tagged:

  • This is possible with function maps, there is a template in C3 showing how to do it. However, I find using function maps really difficult.

    So a much easier option is to call functions by name from a script. (Note, that this will probably not work with advanced minification)

    First save function name in a local or global variable. Then execute this script:

    runtime.callFunction(localVars.FunctionName)

  • Are coal mine and oil pump members of the Minerals family?

    I think you need to change the last event on your screenshot like this:

    Button on clicked
    Block pick instance with UID SelectedLocationUID
    Minerals is overlapping Block
     Minerals destroy
     ...
    

    Also, it's not very efficient to re-create the buttons all the time. You can build the whole menu on the layout with hierarchy, and created/destroy it with a single action.

  • Beyondgodd This plugin doesn't care about collisions. You need to tell it which tiles are walkable and which are not. You can use a separate (invisible) tilemap just for this purpose.

  • There are several ways:

    1. Create an instance variable MineUID on the progress bar.

    2. Add progress bar to the mine as a child. (hirerarchy)

    3. Add progress bar and mine to a container, but then you'll have to make the bar invisible, you will not be able to destroy it.

  • It depends on the size of assets in your game.

  • I prefer tiled background, here is a demo:

    howtoconstructdemos.com/simple-healthbar

    I don't know your game, so not sure what will be the right way to pick Minerals instance. If only one mine can be built at a time and you only need one progress bar, you can pick by UID or custom ID variable.

    If you need a separate progress bar for multiple mines, you can link them with hierarchy, or put in a container, or use MineUID instance variable on the bar object.

  • In the second event on your screenshot (Every tick) you need to pick the correct Minerals instance. If you don't pick it, then the value of BuildStatus will be taken from the first existing instance.

    Also, don't use the ProgressBar object, there are too many problems with it. Make your own progress bar with a sprite or TiledBackground, simply set its width to (BuildStatus/MaxBuildStatus)*BarWidth

  • Make a solid border for it. Also make sure there are no other behaviors. Bullet should not fall down and stop, you probably added Physics to it or something like that.

  • You can use Bullet behavior with bounce off solids enabled. Also Fade behavior to automatically destroy it after 10 seconds.

  • Have you tried saving the project in C3 and re-opening it?

    The issue may be with just one sprite or behavior or effect. Try finding which one.

    Also try a different browser, maybe you'll get a different error message in console.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I would definitely use one sprite for all powerups. You can set powerup type with an instance variable, or use different animations, or animations frames.

    For example:

    Player on collision with PowerUp
     PowerUp is playing "Invincibility" animation : Player set isInvinvible=true
    
     PowerUp is playing "Health" animation : Player add 1 to HP
    
     etc.
    
    
  • Check out the documentation, there are a few expressions you can use when dealing with multitouch.

    construct.net/en/make-games/manuals/construct-3/plugin-reference/touch

    Try setting the angle to:

    angle(Player.x, Player.y, Touch.XAt(1), Touch.YAt(1))

    where "1" is the index of the second touch (zero-based).