dop2000's Forum Posts

  • You are right about the part where the system treats multiple instances as one object, and when you try to access some property it takes it from the first instance etc. But I'm sure you are aware that "Compare instance variable" is very often used to pick or "filter out" instances. If you have multiple instances, some with id=0 and some with id=1, you can use this event to pick only instances with the id=1 for example.

    It has the same effect as using System event "Pick by evaluate" or "Pick by comparison". And actually you can change my capx to use "System Pick by evaluate Sprite.id=choose(0,1)" and it will have the same problem. The engine will loop through each instance, each time comparing with a different result of choose() expression.

    This seems wrong to me, because it works differently in SQL for example. If you do "SELECT * FROM table WHERE code=int(rand()*2)", this will select records with only one value in code field, either with 0 or 1, not a mix of both.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I submitted my entry, the game is called Damaged Controls

    It's a space shooter with (you guessed it!) damaged controls. There are five short levels, and in each level controls are messed up in a different way :)

    Warning - the game is hard! But if you are skillful, resourceful and lucky, it's possible to beat all levels in less than 5 minutes.

    This is the first I'm participating in a game jam, I really enjoyed it and hope you enjoy playing my little game!

  • I don't think what you are saying is correct, or maybe I didn't quite understand your message.

    "Compare instance variable" event picks instances. If I use "Compare instance variable id=1", this will pick all instances with id=1.

    So naturally I assumed if I use choose(0,1) in this event, it will first choose a random number (0 or 1) and then pick instances with id equal to that number.

    But what happens is that this event actually checks each instance separately, and for each instance calculates a new random number and compares id with this number. So it can pick one instance (which seems correct), but it can also pick two instances or none.

    See this example:

    dropbox.com/s/tsje45mszx2vepp/PickWithChoose3.capx

    Also, resetting opacity on start of the layout doesn't fix the issue, because all objects are reset anyway when the layout is restarted.

  • The wall in the top circle on your screenshot is dark because event #17 picked a dark FOW sprite nearest to it (the one that's on the right with opacity 80). So the wall sprite opacity is only 20.

    And that FOW sprite is dark because there is no line of sight to it. LoS behavior checks visibility in a line from the origin image point of one sprite (player) to the origin image point of the second sprite (FOW). In this case there is just a tiny portion of the corner of the wall that's blocking the sight.

    The red oval on the right on your screenshot - the wall is bright because it's part of the same Inner_DS sprite. You can't change opacity for a half of the sprite :)

    Anyway, I think the method you are using is really ineffective and too complex. I would replace all those hundreds of sprites with a single tilemap and use a separate round mask sprite for FOW, pinned to the player. You can use a trick with a shadow and blend modes from this post:

    construct.net/en/forum/construct-2/how-do-i-18/how-do-i-make-an-enemy-line-of-130966

  • Spax C3 Desktop build used to be sluggish when editing big layouts, but it seems to be fixed now. I tested on a big project (200 objects, 80 layouts, 4500 events) and I think it works even faster than C2.

  • Yes, I know about workarounds.

    It just seemed like such an obvious and easy way to pick random instances, and turned out that it doesn't work correctly. I will have to check all my old projects to make sure I didn't use this method...

  • You need to save the project as a single file and upload .capx file.

    .caproj is not enough to open your project.

  • 1. Select target using Line of Sight behavior or some other method, make sure to pick just one enemy instance (for example, with "pick nearest" event).

    2. Save target UID in missile's instance variable.

    3. Navigate to the target with Pathfinding behavior. If the enemy is moving, you'll have to refresh the path every 0.5 seconds or so.

  • Here is an easier way to do this:

  • There are a million possible reasons why this may happen and without seeing your project it's impossible to tell.

    The most common mistake is creating lots of objects over time and not destroying them. Run the game in Debug Mode, play it a bit and check the list of objects on the left, see if there are any unusually big numbers there.

  • Say there are two sprites, one with id=0, another with id=1

    If I want to pick a random sprite using condition "Sprite compare instance variable id=choose(0,1)" - it doesn't work as expected! Sometimes it picks one instance, sometimes two, sometimes none.

    Am I going crazy, or is there a reasonable explanation?

    I tested in both C2 and C3. Example capx:

    dropbox.com/s/z4zsaevq92byut3/PickWithChoose.capx

    .

    EDIT: Never mind, I think I know what's going on. This event loops through all instances, comparing each with choose() expression, each time calculating a different value for choose(). I wonder if this can be considered a bug...

  • It's the same in "C2 runtime" in Construct 3. And it's not just Bullet, pretty much any behavior..

    I'm guessing this is how C2 engine works. If this was a bug, it would have been discovered and fixed long time ago.

  • You are right about "trigger once", it cannot be used with multiple instances. There must be some mistake in your code, it will be easier to help if you could post your project file.

    Here is a similar project with multiple attacking enemies I fixed for someone else a few days ago:

    dropbox.com/s/9hf092r0ycwedae/AI%20top%20down%20example1%20with%20Shooting3.capx

  • You need to tween a value, say, from (sprite.angle) to (sprite.angle+200). And then while the tween is running, set sprite angle to Tween.value

    You can even make multiple rotations using this method - tween from 0 to 3600 will rotate the sprite 10 times.

  • When you are adding events or actions in C2/C3 and you see a field which allows you to type something - you can use expressions there.

    For example, add the following event: System -> Is between angles.

    If you click "Find expressions", you will find literally hundreds of useful expressions there.