Repository: evennia/evennia

Issue:
[BUG] `CmdCreate` fails on creating any character-type classes.
#### Describe the bug

When attempting to use `create` to create any typeclass descending from (and including) `DefaultCharacter`, the system will attempt to create a basic `Character` object and fail. This includes attempting to create an object of the basic `Character` typeclass.

#### To Reproduce
```
create/drop bob:evennia.contrib.rpg.rpsystem.rpsystem.ContribRPCharacter
["An error occurred while creating object 'bob object: 'Character' object has no attribute 'check_available_slots'"]
create/drop bob:evennia.DefaultCharacter
["An error occurred while creating object 'bob object: 'Character' object has no attribute 'check_available_slots'"]
create/drop bob:characters.Character
["An error occurred while creating object 'bob object: 'Character' object has no attribute 'check_available_slots'"]
```
#### Expected behavior
The object should be created with the given typeclass. Also, Characters should be `create`able.

#### Environment, Evennia version, OS etc
Evennia 3.0.0
Python 3.10

#### Additional context
I'll be working on fixing this, but I wanted to create an issue to track it first.


Discussion:

Resolving patch:
diff --git a/evennia/commands/default/building.py b/evennia/commands/default/building.py
--- a/evennia/commands/default/building.py
+++ b/evennia/commands/default/building.py
@@ -660,7 +660,13 @@ def func(self):
                 continue
 
             obj, errors = obj_typeclass.create(
-                name, caller, home=caller, aliases=aliases, report_to=caller, caller=caller
+                name,
+                account=caller.account,
+                location=caller,
+                home=caller,
+                aliases=aliases,
+                report_to=caller,
+                caller=caller,
             )
             if errors:
                 self.msg(errors)
diff --git a/evennia/objects/objects.py b/evennia/objects/objects.py
--- a/evennia/objects/objects.py
+++ b/evennia/objects/objects.py
@@ -2588,7 +2588,14 @@ def get_default_lockstring(
         return ";".join([puppet, delete, edit])
 
     @classmethod
-    def create(cls, key, account=None, **kwargs):
+    def create(
+        cls,
+        key,
+        account: "DefaultAccount" = None,
+        caller: "DefaultObject" = None,
+        method: str = "create",
+        **kwargs,
+    ):
         """
         Creates a basic Character with default parameters, unless otherwise
         specified or extended.


Test patch:
diff --git a/evennia/commands/default/tests.py b/evennia/commands/default/tests.py
--- a/evennia/commands/default/tests.py
+++ b/evennia/commands/default/tests.py
@@ -726,23 +726,34 @@ def test_quell(self):
 class TestBuilding(BaseEvenniaCommandTest):
     def test_create(self):
         typeclass = settings.BASE_OBJECT_TYPECLASS
-        name = typeclass.rsplit(".", 1)[1]
+        typename = typeclass.rsplit(".", 1)[1]
         self.call(
             building.CmdCreate(),
             f"/d TestObj1:{typeclass}",  # /d switch is abbreviated form of /drop
-            "You create a new %s: TestObj1." % name,
+            f"You create a new {typename}: TestObj1",
         )
+        # confirm object was added to the room's contents
+        self.assertEqual(self.room1.contents[-1].name, "TestObj1")
         self.call(building.CmdCreate(), "", "Usage: ")
         self.call(
             building.CmdCreate(),
-            f"TestObj1;foo;bar:{typeclass}",
-            "You create a new %s: TestObj1 (aliases: foo, bar)." % name,
+            f"TestObj2;foo;bar:{typeclass}",
+            f"You create a new {typename}: TestObj2 (aliases: foo, bar).",
+        )
+        # confirm object was added to the caller's contents
+        self.assertEqual(self.char1.contents[-1].name, "TestObj2")
+
+    def test_create_characters(self):
+        """verify creating DefaultCharacter-descendant objects works, for NPCs"""
+        self.call(
+            building.CmdCreate(),
+            "/d TestNPC:evennia.DefaultCharacter",
+            "You create a new DefaultCharacter: TestNPC",
         )
 
     def test_examine(self):
         self.call(building.CmdExamine(), "", "Name/key: Room")
         self.call(building.CmdExamine(), "Obj", "Name/key: Obj")
-        self.call(building.CmdExamine(), "Obj", "Name/key: Obj")
         self.call(building.CmdExamine(), "*TestAccount", "Name/key: TestAccount")
 
         self.char1.db.test = "testval"