Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- character_attributes = ["languages", "speaking", "personal_scent", "reputation", "personality", "peoplecolor",
- "speechcolor", "pose_default", "pose", "travelstring_default", "travelstring",
- "voicetype", "voicedesc", "birthday", "armor", "covered", "bodyparts", "clothes",
- "origin", "handedness", "age", "gender", "heritage", "background", "privatepast",
- "desc", "height", "weight", "eyecolor", "skincolor", "haircolor", "hairstyle",
- "handwriting", "skills", "stats", "currency"]
- string = ""
- string = "|R# CHARACTERS|n|/"
- string = f"{string}|/limbo = caller.search('#2', global_search=True)|/|/"
- char_id = 1
- for char in Character.objects.all():
- # collect the account it belongs to, in order to search out and attach to in the build
- if char.account:
- char_account_name = char.account.name
- else:
- char_account_name = "Aleph"
- # Set up string to create new character object
- string = f"{string}|/character_{char_id}s = create_object(Character, key='{char.key}s', location=limbo)|/"
- # Attach the object to the right account
- string = f"{string}|/for player in Account.objects.all():|/" \
- f"|-if player.key == '{char_account_name}':|/" \
- f"|-|-player.db._playable_characters.append(character_{char_id}s)|/"
- # Fix the attributes of the new object
- for attribute in character_attributes:
- string = f"{string}character_{str(char_id)}.db.{attribute} = {char.attributes.get(attribute)}|/"
- char_id = char_id + 1
- self.caller.msg(string)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement