new to C2, got a minor question and a critical one

Get help using Construct 2

Post » Thu Feb 06, 2014 6:06 pm

Thanks for the help! Aside from inefficiencies, which will need to be cleaned up later, I'm looking for memory leaks and sources of crashes.

For instance, I have the opacity set to 100 whenever isCloaked is false, and set it to 50 when isCloaked is true. I know that is a bunch of actions that don't need to happen if I just set the opacity to every time it is toggled rather than running all the time. Will things like that crash my program?
B
4
S
1
Posts: 18
Reputation: 388

Post » Thu Feb 06, 2014 6:24 pm


Your big problem is the array "aggroArray" or rather the two instances of aggroArray that are created.

They are both increasing in size very rapidly indeed and are running the Browser out of mem.


Here's a pic of one, don't forget there are two instances increasing at the same rate which I guess is per tick or 60 times per second.


There are 10 types of people in the World, those that understand binary and those who don't.
B
7
S
2
Posts: 93
Reputation: 797

Post » Thu Feb 06, 2014 6:26 pm

Sorry I'm timing out a lot.

The above post should have also read

Fire up the debugger and watch what happens and where the resources go.

https://www.scirra.com/blog/124/introducing-the-construct-2-debugger-and-profiler
There are 10 types of people in the World, those that understand binary and those who don't.
B
7
S
2
Posts: 93
Reputation: 797

Post » Thu Feb 06, 2014 8:03 pm

Thanks so much guys. I was actually just wondering if C2 could handle thousands of events, and that question was answered. I know there are inefficiencies in programming that need to be fixed eventually, and I appreciate you guys helping me with it. My program was actually crashing before I added that aggro array stuff (everything south of "Debugging" is just testbed stuff that I throw in as I'm thinking about it so I don't forget, and I just added it).

But while we're on the subject, I wanted to create a 2D array with names in one column (x0) and number values in the second column (x1), and I wanted it to be as dynamic as possible, meaning for each new object on the screen, I can push a name onto x0y1 and a corresponding number onto x1y1. Is there a way to do that? I can't get my head around the push action in the manual.
B
4
S
1
Posts: 18
Reputation: 388

Previous

Return to How do I....?

Who is online

Users browsing this forum: David181, OBLIVION and 56 guests