Renaming Families/Other Instability

Discussion and feedback on Construct 2

Post » Thu Aug 01, 2013 9:26 pm

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.
B
37
S
20
G
18
Posts: 259
Reputation: 12,922

Post » Fri Aug 02, 2013 3:39 am

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.
B
99
S
35
G
29
Posts: 3,139
Reputation: 28,421

Post » Fri Aug 02, 2013 8:13 am

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.Xionor2013-08-02 09:52:39
B
10
S
3
Posts: 233
Reputation: 1,537

Post » Wed Aug 07, 2013 4:16 am

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.

B
37
S
20
G
18
Posts: 259
Reputation: 12,922

Post » Wed Aug 07, 2013 4:36 am

@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.AmpedRobot2013-08-07 04:37:09
B
37
S
20
G
18
Posts: 259
Reputation: 12,922

Post » Thu Aug 15, 2013 4:48 am

@AmpedRobot .capx ?
B
99
S
35
G
29
Posts: 3,139
Reputation: 28,421


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 22 guests