thegrind's Forum Posts

  • Problem Description

    Error related to containers and save/load. It is no problem to work around this, but probably shouldn't happen. It can be a nightmare to locate this error in large projects.

    Attach a Capx

    https://drive.google.com/file/d/0B6WdU5 ... sp=sharing

    Description of Capx

    Destroys object in container, and makes it possible to save/load.

    Steps to Reproduce Bug

    • Click button to go to main layout.
    • Click save button.
    • Refresh browser and load game.

    Observed Result

    Error.

    preview_prelude.js:30 Assertion failure: Unable to find instance by IID

    Stack trace:

    Error

    at assert2 (http://localhost:50001/preview_prelude.js:16:10)

    at pluginProto.Type.cr.type_getInstanceByIID [as getInstanceByIID] (http://localhost:50001/commonace.js:1198:3)

    at pluginProto.Type.cr.type_applySolToContainer [as applySolToContainer] (http://localhost:50001/commonace.js:1350:28)

    at Runtime.executeSingleTrigger (http://localhost:50001/preview.js:4903:26)

    at Runtime.triggerOnSheetForTypeName (http://localhost:50001/preview.js:4865:16)

    at Runtime.triggerOnSheet (http://localhost:50001/preview.js:4797:13)

    at Runtime.trigger (http://localhost:50001/preview.js:4774:12)

    at Runtime.loadFromJSONString (http://localhost:50001/preview.js:5786:9)

    at Runtime.handleSaveLoad (http://localhost:50001/preview.js:5444:9)

    at Runtime.logic (http://localhost:50001/preview.js:2662:8)

    Expected Result

    Load the game.

    Affected Browsers

    • Chrome: (YES)
    • FireFox: (YES)
    • Internet Explorer: (YES)

    Operating System and Service Pack

    Win10

    Construct 2 Version ID

    239

    Cheers,

    thegrind

  • Hi guys, I rep'ed C2 for the 7 day Kong jam. Made the game ZOON:

    From scratch in less than 7 days

    Theme was Attraction

    Modifier was No Text

    http://www.kongregate.com/games/jeagle747/zoon

    Give it a try, beat my score, and let me know what you think

    Control with left and right mouse button, or touch each side of screen. There is a bonus round if you last long enough to see the star collapse into a blackhole.

    I use a few behaviors; LineOfSight, Bullet, MoveTo, which do a nice job in a performance efficient way. Used particles for powerup pickups. Used warp effect for the star.

    It has a working score system, and I also implemented a simple AI to run if the player idles.

    Used C2 sprite editor for all gfx.

    I worked with a composer. We made 5 short audio themes to create a non-repetetive random background ambience. And also different sets of random sounds for game events.

  • Every X seconds is based on the system timer, not the running time of a layout.

    Stuff like this should really be in the documentation.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • With reference to this subject posted as bug: https://www.scirra.com/forum/turret-behavior-range_t117262

    The range is measured to the origin of an object. This can make it impractical to use in eg. a TD game.

    As pointed out in thread above, one solution is to put a number of invisible objects in a container with the target sprite, and then set the position to the target's imagepoints, and pin them. Then add the pinned sprites as turret targets. However this can cause the turret to target the corners of the target (if the target has a square shape), which is also impractical. Furthermore, you have to pin 8 objects to each different target, to achieve good measurement, if the target is changing angle, which is also often the case in TD games.

    I don't work on a TD game currently, but uses the turret bahavior for something similar, and my targets are changing their size too. This means that the pin behavior is partly useless, as you cant pin to imagepoints, and have to set the position of each of the pinned objects to the imagepoints, everytime the size of the target changes, making it even more impractical.

    Imo a nice solution would be to let the user set an attribute for the turret behavior; range to specific imagepoint (origin as default) or range to closest imagepoint. Alternatively range to collision box points could be used. I don't expect Ashley to make this change in C2, but maybe think about it, if a similar behavior is used in C3.

  • I don't think so, but you can put all your sprites in a family, all you buttons in another, etc., and destroy each family.

  • Apparently timer is a special case, so I would just do exactly what the manual recommends.

    But in general how you want to filter, depends on what you are comparing in your conditions. My code in the previous post is a good example on that.

    If you for instance only want to filter based on instance variables for one objects instances, you don't need 'for each'. Say you have a sprite with two instance variables, and want to filter on their value, this would do;

    sprite1 hitpoints = x

    sprite1 state = y

    Then you would end up with all the instances having these values.

    But if your conditions for example involve comparisons between 2 objects and multiple instances from each, you have to be more careful, and think about exactly what you want (revisit my previous post for example on exactly this).

  • Isn't it correct that triggered events (contrary to std. events), are triggered immediately by a single object instance? I thought that if multiple triggered events fire (semi)simultaneously, they would be handled like a stack in programming. In other words, instance filtering wouldn't be necessary in triggered events. Of course the triggered timer event suggests I'm wrong, but megatronx comment confuses me a little, as I had problems with timers around a year ago, and started using my own, until a couple of weeks ago.

    For example in my code from above - the block where I use the triggered collision event. I'd expect that if multiple sprite3 collided with sprite2, a stack of triggered events was created, and not one triggered event where I had to filter instances. Is this wrongly understood? Because it seem to work as is:

    ---

    The std. overlap event would also result in correct behavior according to my original goal, if modified as follows to filter instances:

  • Yes, it is the timer which is the problem, and I can see why now. Thanks a lot!

  • I did, thanks. This is the right one: https://drive.google.com/file/d/0B6WdU5 ... sp=sharing

  • Hi, I'd appreciate some help with this.

    Pls. take a look at url: http://occupy.bitballoon.com/

    The small blue squares looks to occupy the big squares for 3 seconds at a time. A big square can only be occupied by one blue square at once. The big squares are colored green when unoccupied and red when occupied.

    The problem is that after a while, at an arbitrary point in time, some of the big squares enters a permanent occupied state with no occupants.

    Events:

    Capx: https://drive.google.com/file/d/0B6WdU53eEV7JcUdwRWd0eUlaZWc/view?usp=sharing

    Edit: capx link fixed.

  • This is not a bug. It happens because when the layer is visible and you press 'V', the first triggered event evaluates to true, and the layer is set to invisible. Hereafter the second triggered event evaluates to true, and the layer is set to visible again.

    The right way to do it, would be to only use one triggered event - like this:

    Hope that helps.

  • Problem Description

    I'm experiencing failure when using an effect and 'fallback->destroy object' and runs it in a browser with no webgl.

    Attach a Capx

    https://drive.google.com/file/d/0B6WdU5 ... sp=sharing

    Description of Capx

    Applying 'Difference' effect to a sprite, with fallback set to 'Destroy object'.

    Steps to Reproduce Bug

    • Run it in a browser with webgl disabled.

    Observed Result

    See screens:

    1. https://drive.google.com/file/d/0B6WdU5 ... sp=sharing

    2. https://drive.google.com/file/d/0B6WdU5 ... sp=sharing

    Expected Result

    Destroy object.

    Affected Browsers

    On my desktop PC, webgl is for some reason only supported in Chrome.

    • Chrome: (NO)
    • FireFox: (YES)
    • Internet Explorer: (YES)

    (Footnote FYI: in my latest C2 game I now have around 60K users in the DB. 10,7% of them uses canvas2d. This is often not a direct consequence of archaic hardware, but rather because of browser gpu blacklist. Needless to say most of these users are experiencing low framerates. Another group of users experiencing low framerates have browser setting to disabled gpu hardware rendering. Unfortunately the developer pays the price as a result of bad reviews and complaints. Based on various Scirra forum posts a lot of developers seem to experience low framerates - they might just not realize, it is because of this issue, and blame C2 performance instead. However it is imho a problem, if C2 should be considered more than an engine for making hobby games and prototypes.)

    Operating System and Service Pack

    Win 7 - most recent service pack.

    Construct 2 Version ID

    216

  • I have had the same problem. Reached the same conclusion as you.

  • Ashley Would be nice and useful to be able to activate and deactivate most behaviours.

  • This is very basic stuff - it is just that I'm experiencing some weird results. Take a look at this:

    http://i.imgur.com/yJMJset.jpg

    If I have 2 visible sprite instances, I'd expect variable 'count' to go up by 2 per tick - right?