dop2000's Forum Posts

  • Try to delete the event, save the project, close it. Then re-open the project and create the correct event.

    If it still gives you the error, you need to post a bug report here:

    github.com/Scirra/Construct-3-bugs

  • You can save a boolean in Local Storage as any other variable.

    But you are right, to restore it you will need two events - "If value=1, then set boolean to true, otherwise set to false".

    That's why I never use booleans in Construct, it's so tiresome to deal with them. I use number variables with 0/1 values.

  • There is no WebStorage, it was replaced with Local Storage years ago. There are a few official examples on how to use it. Search for "Local Storage" or "High score" in the Construct 3 editor startup page.

    Local Storage allows to save boolean variables, but I guess internally they will be saved as 0 and 1 anyway.

  • You need to add this font to the project. And in Text objects select the font from the project.

  • Try this:

    Set frame to round(lerp(4, 0, HP/MaxHP))

  • Yeah, "Is animation playing" condition is misleading, because it doesn't check if an animation is actually playing. It should really be called "Compare animation name".

    Use "On animation finished" trigger to stop the talk noise. You can add an instance variable isPlaying to the sprite. Set it to 1 when you start the animation, and reset to 0 when animation is finished.

  • Not only the Timer is easier, but it's much more useful and versatile. You can pause/resume it or cancel completely. You can run different timers for different object instances, or multiple timers for one object. And the time doesn't have to be in integer seconds.

    Besides, "Every X seconds" is not accurate, it may trigger the first time earlier than needed. Say, if you are using your method to schedule some event for 2 seconds, it may actually happen in just 1.1s

  • You should post a suggestion here:

    construct3-21h2.ideas.aha.io

    Make sure to follow the guidelines.

  • I've never had this issue on Android. Can you share a demo apk?

  • What you did is not right, the new code has essentially the same problem as in your first comment. If there are several bad troops within 500px from the good guy, the first badtroops instance will be picked as a target. Not necessarily the nearest. And if several good guys see the same bad guys, they will all pick the same one badtroops instance.

    Also, there is no point in using TargetUID variable if you are refreshing targets on every tick. The whole idea is to prevent this - once a goodtroop has a target, it will stick to it and will not be distracted by other targets.

    Picking by comparing distance is the same as using LOS behavior, but the LOS behavior works faster.

    Finally, your events 8 and 9 are also very wrong. They shouldn't be nested inside the loop. I suggest using Timer behavior to shoot a bullet.

    Here is how I would do the whole thing:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You should probably use For Each loop if you want to assign a target for every good troop.

    For Each GoodTroops
    GoodTroops has LOS to BadTroops
    BadTroops pick nearest to GoodTroops
     .... GoodTroops Move To BadTroops
    

    But this may not work very well if there are several bad guys roughly at the same distance from the good guy - it will constantly switch targets.

    A proper solution would be saving the target UID in an instance variable on the GoodTroops. Once the target is selected, the good guy will move to it and ignore other targets until its target is destroyed. You can add other conditions to allow changing the selected target, for example, if another enemy has spawned much closer.

    .

    By the way, there is a mistake on your screenshot - in the first action you have Move To (Badtroops.X, Badtroops.X)

  • When you are using a condition like GoodTroops pick nearest to BadTroops.x/y, it will check all instances of GoodTroops, but only one (the first) instance of BadTroops.

    I suggest giving your family a Line Of Sight behavior and using it instead - GoodTroops has LOS to BadTroops.

  • Directly loading an image into a drawing canvas is still not possible. And doing this via a snapshot will be very slow. Can you paste canvas A on canvas B? This will work much faster.

  • Are you talking about a web game run in a browser on Android, or an Android app (apk)?

    I've never seen this issue in an apk. If this is a browser game you can use Chrome remote debugging to see if there are any error messages in the console log.