CharacterCreation.CharacterSelectionContext

From Multiverse

Jump to: navigation, search

The CharacterCreation.CharacterCreationContext class is part of the Character Creation Framework in the Client Scripting API.




Contents

Constructor

Do not create an instance of the CharacterSelectionContext class; instead create a class that inherits from it. For example:

class SampleCharacterCreationContext(CharacterCreation.CharacterSelectionContext):
   ...
   # class constructor, methods, properties, etc.
   ...

Methods

GetCharacterAttribute

GetCharacterAttribute(characterId, attr)

Fetch the value of the given attribute for the given character ID.

Returns

Value of the specified attribute for the specified character ID. See Property Values for a list of valid attribute data types.

Parameters

  • self
  • characterId
  • attr

GetCharacterAttributes

GetCharacterAttributes(characterId)

Returns

A Dictionary containing a copy of the attributes sent from the server for the character with character ID. See Property Values for a list of valid data types for the attributes in this dictionary.

Parameters

  • self
  • characterId

GetCharacterIds

GetCharacterIds()

Returns

A list containing the character IDs of each character.

Parameters

self

Login

Login(characterId)

Connect to the world server with the specified character ID. This method returns a status code indicating the result of the connection.

Returns

Parameters

  • self
  • characterId

OnSelectionUpdated

OnSelectionUpdated(characterId)

Override this method in a derived class to implement whatever behavior is appropriate when the attributes change; for example, to update the displayed avatar.

Returns

Parameters

  • self
  • characterId

SetAttribute

SetAttribute(attr, val)

This method sets a single attribute. Other attributes may end up being altered by this change.

Returns

Parameters

  • self
  • attr
  • val - the value to set the attribute to. See Property Values for a list of valid data types for attributes.

SetAttributes

SetAttributes(primaryAttr, attrs)

Set the attributes of the character being created. In some cases the selection of attributes may be invalid, so the internal dictionary may not end up matching the passed attributes. This method requires primaryAttr to be a valid attribute name, and requires the entry for primaryAttr in the attrs dictionary to be valid. There must be some legitimate value for each other attribute. There must be an entry for each attribute in the attrs dictionary.

Returns

False if the attributes were modified. Otherwise, returns True.

Parameters

  • self
  • primaryAttr
  • attrs - a dictionary of attributes. See Property Values for valid data types for character selection attributes.
Personal tools