CharacterCreation.CharacterCreationContext

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 CharacterCreationContext class; instead create a class that inherits from it. For example:

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

Methods

CreateCharacter

CreateCharacter()

This call actually causes the character to be created on the server.

Returns Zero (0) if successful, or an error code if something failed.

Parameters

  • self -

GetAttribute

GetAttribute(attr)

Get the value of a current attribute.

Returns

The value of the character creation attribute. See Property Values for a list of valid data types.

Parameters

  • self
  • attr

GetAttributes

GetAttributes()

Get a copy of the current attributes dictionary.

Returns

Dictionary of current attributes. See Property Values for a list of valid data types for attributes.

Parameters

  • self

GetValidAttributeValues

GetValidAttributeValues(attr)

Get a list of legal values for the given attribute, based on the set of attribute values that have been set on our character.

Returns

Parameters

  • self
  • attr

OnAttributesUpdated

OnAttributesUpdated()

Override this method in a subclass to implement behavior appropriate when the attributes change. Typically, this method updates the displayed avatar.

Returns

None.

Parameters

None.

SetAttribute

SetAttribute(attr, val)

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

Returns

None.

Parameters

  • self
  • attr
  • val - the value of the attribute. 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 a list of valid attribute data types.
Personal tools