• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
  • 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 - Code Multiple code tabs per event

R

rsdavis

Guest
In GMS1, I used multiple pages of code for a single event (usually the step event). This helped with code organization for some of the bigger objects.

Is there any way to do this in GMS2? It seems like you may be able to get multiple tabs, but I don't see how.
Thanks, enjoying the beta so far!
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
GMS2 has a completely different paradigm for the workflow, and so no, this is currently not possible. However it has been requested many time now and the devs are aware that it's something a lot of people want and are considering options.
 

Mike

nobody important
GMC Elder
We have no plans for adding nested tabs within tabs - as that's seriously nasty, but we do have longer term plans to add code folding via #region marks (or something like this).
This would let you "block up" code within a single file.
 
R

rsdavis

Guest
Thanks for the response! I think regions would be a great feature to have.
 
X

Xskode

Guest
We have no plans for adding nested tabs within tabs - as that's seriously nasty, but we do have longer term plans to add code folding via #region marks (or something like this).
This would let you "block up" code within a single file.
so our code will now be one super long code within one event?? the nested tabs is very very helpful and useful. especially when it comes to de-bugging or quickly finding where you need to go to tweak something.
inside of step event i could have one code call 'movement' other called 'damage calculation' another (etc...) and if something happen with damage calculation or I wanted to change something. I can go to the 2nd 'nested tab' and everything that handles the damage stuff is right there.

this hastag region is it like nested tabs. or will it just put some heading in the mist of our really really long code??
 
G

Guest User

Guest
so our code will now be one super long code within one event?? the nested tabs is very very helpful and useful. especially when it comes to de-bugging or quickly finding where you need to go to tweak something.

this hastag region is it like nested tabs. or will it just put some heading in the mist of our really really long code??
as much as i liked code tabs too, if code folding works like it does in every program i've seen with this sort of thing it'll be a fine replacement with basically the same functionality but keeping the tabs-per-event to one.
Code:
[-] #region Foo
    /* A BUNCH */
    /* OF THAT */
    /* SWEET
    /* SWEET */
    /* GML */
[-] #region Bah
    /* EVEN MORE */
    /* CODE */
    /* HERE */
v v v v v v v
Code:
[+] #region Foo
[+] #region Bah
(idk if you can name them i just did that for a visual aid)
 
so our code will now be one super long code within one event?? the nested tabs is very very helpful and useful. especially when it comes to de-bugging or quickly finding where you need to go to tweak something.
inside of step event i could have one code call 'movement' other called 'damage calculation' another (etc...)
Why not just have something like this in the Step Event:

Code:
scr_movement();
scr_fire_weapons();
scr_calculate_damage();
Then, if you need to look at any of them, you can just middle-click on the relevant script name to open them directly.

Just a suggestion.
 
X

Xskode

Guest
as much as i liked code tabs too, if code folding works like it does in every program i've seen with this sort of thing it'll be a fine replacement with basically the same functionality but keeping the tabs-per-event to one.
Code:
[-] #region Foo
    /* A BUNCH */
    /* OF THAT */
    /* SWEET
    /* SWEET */
    /* GML */
[-] #region Bah
    /* EVEN MORE */
    /* CODE */
    /* HERE */
v v v v v v v
Code:
[+] #region Foo
[+] #region Bah
(idk if you can name them i just did that for a visual aid)
okay if it's like that and you can name them then that would be a nice replacement- for it pretty much the same thing.

Why not just have something like this in the Step Event:

Code:
scr_movement();
scr_fire_weapons();
scr_calculate_damage();

Then, if you need to look at any of them, you can just middle-click on the relevant script name to open them directly.
that can work too, but then you endup having a whole lot of scripts- but that can work too.
 
that can work too, but then you endup having a whole lot of scripts- but that can work too.
Yeah, good point. I guess I like to see my scripts out in the open. I never really used the nested tabs options for scripts much - I found they hid away things from me, whereas with separate scripts I can see each of them in my resource tree ( neatly organised into folders of course ).

Definitely can appreciate the power of nested tabs for organising scripts for those who found them useful.
 

Carloskhard

Member
We have no plans for adding nested tabs within tabs - as that's seriously nasty, but we do have longer term plans to add code folding via #region marks (or something like this).
This would let you "block up" code within a single file.
I don't think so, they are not nasty in my opinion, they are much better than what GM2 have right now, a super long code isntead of multiple tabs very well organized. Please fix this soon. I started using GM2 a few weeks ago and I am having a very bad time organizing my steps code compared with how easy it was in GM1 so do something please. Maybe add the option to use tabs or not.
 
Last edited:
Top