System Debugging Feature?

Discussion and feedback on Construct 2

Post » Thu Jul 05, 2012 11:39 pm

Hey,
Would it be possible to add a simple debugging feature to C2 - I'm thinking along the lines of just Console prints - like echo in PHP or System.out.print in java. Just an action called "Print to Console" or something - because as of now in order to check variables you would have to make popups using browser or add unnecessary text objects to the screen - just to be undone after. I don't know if this is possible, but I really hope it is :)
Thanks!
B
40
S
8
G
6
Posts: 61
Reputation: 5,941

Post » Fri Jul 06, 2012 12:49 am

My workaround for this right now is to have a "debug" layer, on that layer I add all of my debug info, whenever I am ready to release all I need to do is be sure the debug layer is not visible. I have 1 text object with instance variables to link it to different functions, and 1 sprite with animation frames to have different colors to represent different things while debugging. A in-engine debugging feature would be nice, but with a bit of setup checking things using the tools available isn't super hard.
B
9
Posts: 59
Reputation: 997

Post » Fri Jul 06, 2012 1:22 am

@Greg I know its not really super hard, but it would be a lot more practical to have something like this. Its less time consuming, it would obviously have the option to be hidden, and would really make the engine more... engine like.
B
40
S
8
G
6
Posts: 61
Reputation: 5,941

Post » Fri Jul 06, 2012 3:03 am

There's also an "is previewing" condition to make it automatic to delete debug objects when running an exported version.
Moderator
B
87
S
32
G
33
Posts: 3,005
Reputation: 27,397

Post » Fri Jul 06, 2012 3:40 am

@Arima Yes, but that would help along what Greg said about his workaround - but the reason I suggested this was so that debugging can be done much easier than making new layers and text things (which takes a bit and is annoying). And it would really help larger projects with lots of variables to keep track of. 10 texts on 1 page and you need to recognize which one is which is sort of "in the way".
B
40
S
8
G
6
Posts: 61
Reputation: 5,941

Post » Fri Jul 06, 2012 7:23 am

You don't need multiple text objects or even layers to keep track of variables - you only need one, with something like:

action: set text to:

"Variable 1: " & variable1 & newline & (press shift enter here to start a new line in the expression editor - doesn't create a new line at runtime, that's what newline is for)
"Variable 2: " & variable2

Etc.Arima2012-07-06 07:24:39
Moderator
B
87
S
32
G
33
Posts: 3,005
Reputation: 27,397

Post » Fri Jul 06, 2012 1:13 pm

Wasn't there a third party plugin that could write to the browser console?

We want to hold off making a full blown debugger for the time being, because it is an extremely complicated feature which will take a long time to get right. We have to get a few other things sorted first.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,518

Post » Fri Jul 06, 2012 1:31 pm

@Arima but again, that could still be large and disrupt bugtesting. A console would be a lot more practical, but yes, it would definitely work.
@Ashley I found it, and it looks great, thanks!
B
40
S
8
G
6
Posts: 61
Reputation: 5,941

Post » Fri Jul 06, 2012 4:51 pm

there is?! All I know about is the dialogbox one. Id love to be able to write to the console! I use alert windows for all my debugging lol
B
13
S
5
G
2
Posts: 306
Reputation: 3,262


Next

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 12 guests