Open Surge Forum

A fun 2D retro platformer inspired by Sonic games and a game creation system

You are not logged in.

Announcement

Our community has moved to Discord! https://discord.gg/w8JqM7m

#1 2011-05-11 19:56:08

KZR
Member
Registered: 2010-07-14
Posts: 1,447
Website

[Suggestion] Debug commands

Would it be feasible to have some new commands and access to text strings based on what objects are doing?

for example:

ENABLE_DEBUG (persistent)

the object using this command would let its $OBJECT_NAME and $CURRENT_STATE be known and available for textout.

OBSERVE_OBJECT

intended only to use a second object to retrieve an object's readable functions like xpos(), angle() direction() etc, as well as the strings above, and use textout to show them.

this would allow us to script debug helpers for players and objects. part of this is possible, but some parts would have to be coded in each and every object, and this way, a separate object could do all the work.

Last edited by KZR (2011-05-11 19:57:46)


SD_sml.pngSeD_sml.pngLTot_W_sml.png
https://discord.gg/w8JqM7m ---> Open Surge's Discord server

Offline

#2 2011-05-11 20:40:20

Sugarmaster
Member
From: Barcelona, Spain
Registered: 2011-04-26
Posts: 132
Website

Re: [Suggestion] Debug commands

I thought of this when programming my airflows:

"This could be much easier if I could see the player_ypos() and the player_speed() in every moment of the process."

I am programming it blindly because it is not rocket science but a textout with that functions would be nice.

And not only with player_ypos or speed. The perfect thing should be to set a "debug_mode" to everything: active object and active state,  functions and also variables.

The text could go to an independent object deatached from camera just like KZR said.

It's a perfect idea that would bring happines and joy to us object programmers. smile

Last edited by Sugarmaster (2011-05-11 20:47:51)


"The true master is always learning"
Avatar by Raul Sama.

Offline

#3 2011-05-11 21:16:26

Alexandre
Administrator
From: Brazil
Registered: 2009-01-27
Posts: 3,300
Website

Re: [Suggestion] Debug commands

You can already achieve those goals using current features of the scripting engine.

Read xpos(), ypos(), etc. from other objects: make this using message passing. Global variables & change_closest_object_state should solve the problem.

$OBJECT_NAME, etc.: this string would hold the name of the object which called textout, hence you couldn't use a separate object to do the work for you. Unfortunately string support isn't feasible in the short-term. However, if you need to work with strings today, you can combine variables and the data of the .lng files. I know it's not the ideal, but it's what is feasible at this moment.

You can already make your debug system today.

"This could be much easier if I could see the player_ypos() and the player_speed() in every moment of the process."

I am programming it blindly because it is not rocket science but a textout with that functions would be nice.

It doesn't need to be that way. You can watch those values today.

Offline

Board footer

Powered by FluxBB  hosted by tuxfamily.org