Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Janik on Fri 16/09/2005 06:18:49

Title: Suggestion:View names - non alphanumeric? (IMPLEMENTED)
Post by: Janik on Fri 16/09/2005 06:18:49
This is a pretty minor point, but ...

Is there any particular reason that view names can't have any characters other than capital letters and numbers? I would like to name a view "Davy_Walk" for instance, because "DAVYWALK" is harder to read.

Like I said, this is really minor, but if it's easy to change then it would be great.

Thanks!

Edit by strazer:

AGS v2.71 RC1:
* Underscores can now be used in GUI and view names, and invalid names pasted into the box are now rejected.
Title: Re: View names - non alphanumeric?
Post by: scotch on Fri 16/09/2005 11:46:32
The usual way of making the start and end of words in a variable name clear is to capitalise the first letter of each new word, like "DavyWalk" or "MoveCharacterBlocking", if you use a capital letter to start depends on taste really, I use lower case for the start of variable names and upper case for functions, I personally prefer this way, and it is what AGS uses for most in built things, but some people use underscores and there's no harm in supporting them I guess.
Title: Re: View names - non alphanumeric?
Post by: SSH on Fri 16/09/2005 11:48:20
And of course, view names are all uppercase anyway  :P
Title: Re: Suggestion:View names - non alphanumeric?
Post by: Pumaman on Fri 16/09/2005 18:37:44
Because view names are implemented as #defines, for consistency they are upper case to show that they are not objects that you can call methods on.

As for supporting an underscore in the names, I guess it would be possible if people would find it useful.
Title: Re: Suggestion:View names - non alphanumeric?
Post by: Scorpiorus on Fri 16/09/2005 20:19:16
I would find this really useful, especially if it would be possible to have underscore in GUI names (and hence in their script O-names) too.
Title: Re: Suggestion:View names - non alphanumeric?
Post by: Janik on Sat 17/09/2005 02:39:42
I just found an interesting work-around: if I type the view name I want elsewhere (notepad), and then copy/paste into the text box, it works. So I tried doing that and making a view "DAVY_WALK", and it works fine when I refer to that in a script.

Note that it's possible to create invalid view names that way (putting punctuation or spaces in there) and those may or may not cause problems with other stuff. Certainly the underscore worked fine.

It looks like it works with GUI names too. The same warning applies there.
Title: Re: Suggestion:View names - non alphanumeric?
Post by: Scorpiorus on Sat 17/09/2005 16:12:40
Hehe, nice hack! I guess it will also be fixed along with the possibility to use underscore I hope. :)
Title: Re: Suggestion:View names - non alphanumeric?
Post by: Pumaman on Sat 17/09/2005 16:15:07
Hehe well spotted, I'll take a look at that ;)