-
Notifications
You must be signed in to change notification settings - Fork 162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Room Numbers as enum #2625
Comments
I feel the description may not be enough in itself. One could have rooms under folders and subfolders, yet use similar descriptions for ingame purposes. Then you can enforce uniqueness, unlike with on-the-fly generation from Description, where you might end with naming collisions, forcing you to append numbers, and possibly users renaming things and shifting those numbers unexpectedly. |
Suppose we add ScriptName to the Room, how do we initialize a default value there? I assume that if ScriptName is empty, then we should not generate any constant for it. Perhaps room's script names should be suggested as |
|
What happens to the default ScriptName if you change the room number? |
Another thing that I wonder about is, how to display the room in the explorer. Right now the room is the only item that displays its description, while others display script names. Should we display room's script name too instead, or both?
I suppose that it's possible to make so that it is renamed if it matches the default pattern. But that will of course won't work if user renamed it using another pattern. |
That's not unique to rooms. When you create, e.g., a new Character, it'll be assigned the autogenerated name cCharNUM. Normally as an AGS user, you'd then change the name to your liking, but you don't need to do that. You can proceed and change the Character number as a next step. As far as I know, the autogenerated name, once autogenerated, will simply stay as it was until the user assigns a different name manually. And I propose we handle the rooms the same way. |
I vote for consistency. That is, when all the other entities display their name in the explorer, also do this for the rooms. |
This is from an interesting proposal in comments here.
Autogenerate
eRoomName
enum constants for rooms. Have these constants declared in a formrmRoomName
, where RoomName is converted from Room's Description string with all invalid symbols removed (meaning - symbols that are not allowed to be in script keyword).Alternatively, have a separate Room's property for this. Probably a Name or ScriptName, which is restricted to be script-compatible, just like any other script name.
Change the signature of the
ChangeRoom
function toCharacter::ChangeRoom(eRoomNumber room)
.Similarly change Character.Room to return eRoomNumber.
For example, this would result in a generated enum like:
Then users can code
player.ChangeRoom(rmLivingRoom);
instead ofplayer.ChangeRoom(37);
if they wish. The room names will appear in Autocomplete, making it easier to find and type them.See Also: #1175
The text was updated successfully, but these errors were encountered: