Arima's Recent Forum Activity

  • Whoops - I stand corrected. Sorry about giving out incorrect info, and thanks Ashley for pointing that out.

  • I'm not sure about the math, bust at a glance, use viewportbottom instead. Windowheight grabs the height of the whole window, rather than just the windows's content.

  • It's actually not strange - if there is at least one instance selected, the aces will keep running. If you have one instance in the layout, that is the max pickedcount can return. If you have 10 instances, at the start of the event sheet it will return 10 instead.

    If you have an example of code you want explained, post it and I'll explain what it's doing.

  • Hmm... Maybe it's safari unloading the textures on it's own. Browsers have their own memory management.

    Global means the object is not destroyed when switching layouts. You need to go to the layout it's on first, or create it in the layout instead. You'll probably still have the problem if you destroy all instances of it at any point. There must always be an instance of it somewhere, even if it's invisible, or you're going to have a pause when loading the textures when creating an instance again.

  • Mipey's right. If you do something like:

    If sprite is visible

    If sprite.pickedcount = 0

    Then if no sprites are visible, c2 stops running the event after 'if sprite is visible' returns false and proceeds to the next event, not even getting to the second condition. There are no situations where the sol has 0 picked instances of something and c2 continues running aces. You're thinking about it backwards - c2 doesn't start with no instances picked - it starts with ALL of them picked, then whittles the list down.

    To find out if no objects meet a criteria, I have an event that checks, for example, if an object is visible - then an else event after it, which only runs if the above event didn't run, meaning none are visible.

  • Are you using webgl? If so, c2 is using layout-by-layout loading - meaning anything not in the layout is dumped from memory. When you create an instance, it needs to be loaded again - resulting in a pause while it does so.

    To eliminate the pause, either keep it in the game as a global object or create an instance at the beginning of the layout and keep it invisible instead.

    I haven't tried it yet, but c2 also might not unload the sprite from memory when there are no instances if it was in the layout at from the start at edit time. That's just a thought though, I don't know if it's the case.

  • I updated it a bit with some more info and put it in the tutorials section: http://www.scirra.com/tutorials/418/for-each-tutorial

  • Correct, spread values is not required, but a lot of the time for each is not required either. For example, if you have the action "set sprite variable to sprite.x" without any loops c2 will set each instance's variable to that instance's x value.

    I wrote a tutorial a while ago about it here. I should update it a bit and put it in the c2 tutorials section...

    Edit: updated version with new info: http://www.scirra.com/tutorials/418/for-each-tutorial

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I think it's already implemented, but requires webgl. I recall reading something about ludei possibly implementing support for it in cocoonjs even without webgl, though.

    I'm not sure of the specifics, though - like if using it swaps images in and out of vram but still requires the images to be stored in ram or if they're read from disk when swapping instead.

  • Huh, interesting about the random hitting the performance. Thanks for the info.

  • You do not have permission to view this post

  • Argh stupid dll problems again...

    When I last looked into it apparently the eula said something like to distribute the dll's on a computer the user needs to agree to the direct x eula. With my CC game loot pursuit I'm going to combine the game and direct x Eula at time of installation. Still annoying, though. :/ At least it works at all without them even if it's without webgl (or if the computer doesn't need them).

Arima's avatar

Arima

Member since 11 Jun, 2007

None one is following Arima yet!

Connect with Arima

Trophy Case

  • Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • Email Verified

Progress

19/44
How to earn trophies