• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Question - IDE Code management

T

teedoubleu

Guest
Gone is the option to name code blocks in DnD and the GML projects give you only ONE (sic!) "code block" per event.

I have objects that have thousands of lines of code in single event. In GMS1 its not a problem because I have the code separated into several neatly named code blocks.

What is the intended way of managing larger projects in GMS2? This is a serious issues that is really stopping me from even trying to port my project.
 

TrunX

Member
You are in the GML-Mode, you can switch back to D&D (Or is it onl ypossible with a new project?) and use multiple code-blocks per event like in GMS1.
Another way would be to write the code in seperate scripts and call the scripts in the event.
 

sylvain_l

Member
@teedoubleu are you sure ? I can have as many code block I want in any event; but they all appear with the same label "Execute code"; no way to give them some more meaningfull label :(

as TrunX says, using script is a workaround. Works for small execute code block that don't required to access to much local variable, or moddify them, ro you have to break them in multiple script :-/
I also tried another dirty workaround with a dummy script function called "xbl" (eXecute Block Label), using as argument 0 a meaningfull string to describe the following code block -- so the line before the "execute code", I have "execute xbl("calculate the gravity origin and apply acceleration in that direction")"

I don't now if it's the intended way, but now I'm just moving to GML-mode project.

@TrunX, you can have as many code block as you wish in GMS2. But they will all appear in the list as "execute code" (which if you have a lot of things going on in an event don't really help to manage your code, and navigate.
 

TheMagician

Member
Look around the forums a little bit. This has been asked twice in the last 4 days.

1) In this thread from yesterday the developers acknowledge the fact that naming code blocks in DnD mode is a helpful feature and have put it on their To Do list.

2) This thread from Wednesday mentions again that GML mode will receive Code Folding to help structure your code.
 
T

teedoubleu

Guest
In the topic of code management the reason why lack of named code blocks/code folding is such an issue is that we have to put everything into the step event as there is no custom named events in GML. I think having separate events would be much more helpful in managing your code. Also, constructors...
 
Top