Room Numbers as enum #2625
Labels
ags 4
related to the ags4 development
context: script api
type: enhancement
a suggestion or necessity to have something improved
what: editor
related to the game editor
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: