Renaming Families/Other Instability

0 favourites
  • 6 posts
  • I just saw some terrifying code instability with very simple operations.

    I had a very simple capx file for testing purposes.

    All I did was copy some sprites from another capx and the same code would sporadically work, then not.

    All I was doing was:

    1) Keyboard/Right Arrow is down -> For each instance of Sprite/Set X to Self.X+3

    2) Keyboard/Right Arrow is down -> For each instance of Sprite/Set X to Self.X+3*dt

    The bizarre thing was that line 1 would work great initially, but as soon as I added a sub-event to roll another sprite at the same time, everything would stop working. Also, the *dt initially does not work at all (I know I mentioned this, but it's occasionally an issue), but would work sporadically after I removed the second family of sprites to be rolled.

    Renaming the family of sprites to be moved pretty much killed everything and the same code that worked a second ago would not work at all, even though it updated correctly in the events.

    Also, deleting the second family of sprites to be rolled suddenly made line 1 without dt go REALLY REALLY FAST (and never before).

    I was doing some funky things like opening up another capx within the first one, so maybe that screwed something up.

    Everything seems to go away when you import sprites properly (without copying between capxs) and remaking the code from scratch.

    It's just a bit scary.

    I know I should submit a capx, but I'd have to remake from scratch when I have the time.

    Just thought I'd mention.

    I'm on Vista 64-bit.

    Why dt does not work sporadically for me is a mystery, but I just tested the prototype on another windows computer and it works great without it, so I moved on for the time being.

    Still might be something worth looking into.

  • 60*dt as 60 seconds at fps, it would translate Self.X+1

    180*dt translates Self.X+3, deltatime would help to mantain object do not skip the movement when fps changes.

  • How is that "scary" and "terrifying" ? It's like i'm reading a tabloid article.

    Anyway, I've often copied events across projects and it's always worked fine for me. Indeed a CAPX example is needed for us to be able to look into this.

  • I don't want to knock Construct 2 because so far I've been able to do some amazing things with it and I plan to do a lot more, but, yes, it is scary when something that's supposed to work doesn't.

    I'm veering away from copying code between capx's too, for example, because that's making corrupt files and other weirdness. Keeps telling me I have some existing group which doesn't exist and more, even after rebooting.

    I'm also not doing some other shortcuts recommended in tutorials because they make weird stuff happen, so I'm working around the limitations of the software, at least for me.

    I'm glad it's working for you.

    Maybe it's because I'm on Vista, 64-bit.

  • Joannesalfa

    Problem is, movemenet for a family of every instance of a sprite (there's not that many; maybe 2 dozen on screen) stops completely when I add dt (delta time) into the mix.

    Also, incredibly enough I tested the file on another computer and it works the same without dt. Not sure if it's luck or what.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • AmpedRobot .capx ?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)