Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Scorpiorus on Sun 05/09/2004 16:33:11

Title: An idea on user-defined #sections in scripts
Post by: Scorpiorus on Sun 05/09/2004 16:33:11
Ã,  Ã, At present, working on a game project being constantly improved a developer may find that it becomes rather difficult to control the scripts. The idea of having modules is to surely help with scripting and later maintaing the source code but it also requires quite a few efforts to be put into its implementation.
   So, I thought, what if the AGS Editor would allow us to define our own sections, so that we could put them around the script and then easily navigate through the sections menu to be provided.
With a section has been chosen, only a relevant portion of code becomes accessible (just like with interactions) but, the thing is, what if we could assign a section for not only one function. Thus, it could be possible to isolate parts of the code which are (and not) worked on.
   It could also be useful for templates. A developer of the template provides menus with a list of sections that an end-user can look in. It could be some sort of a complicated battle system with several event functions that are provided to define the behaviour when they are invoked. These functions could be put into one section to be shown as soon as an appropriate section is chosen.
   Each script file could have its own number of sections. Currently, it's one for the global script, one for the script header, and others, those for each room script.


Example:

// room script file


...
...
if (...) some_event_function(10, 2);
...
...

#usersectionstart On event section

function some_event_function(int x, int y) {

// TODO

}

function some_other_event_function(int x, int y) {

// TODO

}

#usersectionend On event section
...
...
...

#usersectionstart Info

// This template provides...
// ....
// Some other info on the template.
// ....
// ....

#usersectionend Info




Room 1 sections:
1. Info
2. On event section

The same for the global and the script header files.

I appreciate it may not be of high priority, just a suggestion, so what do you guys think? :)
Title: Re: An idea on user-defined #sections in scripts
Post by: Dusk on Sun 05/09/2004 19:49:33
As you say, not high priority, but an useful editor improvement.
I'd also like to see something like

#sectionstart CHEWIE_LOOK
and not
#sectionstart character6_a

but I put something similar as comment and use the Find function... a little patience, and no problem, at the end :)
Title: Re: An idea on user-defined #sections in scripts
Post by: Pumaman on Mon 06/09/2004 21:09:13
I can see how this would be useful. It's low priority as you say, but I'll add it to my list.
Title: Re: An idea on user-defined #sections in scripts
Post by: monkey0506 on Tue 07/09/2004 01:20:59
Well, you CAN do this, it just doesn't do anything...Ã,  :P

EDIT: But yeah, good idea.