Skip to content
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 creation commands now default the new room's typeclass to that of the caller's location #3500

Closed
wants to merge 1 commit into from

Conversation

chiizujin
Copy link
Contributor

Brief overview of PR changes/additions

The comments in ObjManipCommand.get_object_typeclass state:

For instance, when using dig, the system can use this to autodetect which kind of Room typeclass to use based on where the builder is currently located.

However, this is not the case as rooms are always created as typeclasses.rooms.Room if no typeclass is specified.

This PR adds that behaviour.

Motivation for adding to Evennia

"New" feature.

Other info

I'm not sure whether or not this should be included as it changes the default behaviour of some commands, though the comment suggests that this might have originally been intended. Or maybe it was removed at some point and the comment wasn't updated.

Examples

Before

>ex
--------------------------------------------------------------------------------
Name/key: cave (#13)
Typeclass: TestRoom (typeclasses.rooms.TestRoom)
(...)
>dig/teleport cave2
(...)
>ex
--------------------------------------------------------------------------------
Name/key: cave2 (#14)
Typeclass: Room (typeclasses.rooms.Room)
(...)

After

>ex
--------------------------------------------------------------------------------
Name/key: cave (#12)
Typeclass: TestRoom (typeclasses.rooms.TestRoom)
(...)
>dig/teleport cave3
(...)
>ex
--------------------------------------------------------------------------------
Name/key: cave3 (#15)
Typeclass: TestRoom (typeclasses.rooms.TestRoom)
(...)
>ex
--------------------------------------------------------------------------------
Name/key: cave2 (#14)
Typeclass: Room (typeclasses.rooms.Room)
(...)
>dig/tele cave4
(...)
>ex
--------------------------------------------------------------------------------
Name/key: cave4 (#16)
Typeclass: Room (typeclasses.rooms.Room)
(...)
dig/teleport cave5:typeclasses.rooms.TestRoom
(...)
>ex
--------------------------------------------------------------------------------
Name/key: cave5 (#17)
Typeclass: TestRoom (typeclasses.rooms.TestRoom)
(...)
>tunnel s=cave6
(...)
>s
(...)
>ex
--------------------------------------------------------------------------------
Name/key: cave6 (#18)
Typeclass: TestRoom (typeclasses.rooms.TestRoom)
(...)

Copy link
Member

@Griatch Griatch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This a nice and reasonable take from the given info, but afaik the dig command never worked this way. The text in the ObjManipCommand is unfortunately phrased, it's just meant to be a possible way the hook could be used to tweak a command's function.

So thanks for your work on this, but I won't merge this one, I think it would break backwards compatibility too much. I will rephrase the docstring to have a clearer intent.

@Griatch Griatch closed this Apr 27, 2024
@chiizujin chiizujin deleted the room_create2 branch April 28, 2024 01:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants