Class providing access to the player character. More...
Read-Only Variables | |
Vector | position |
Holds the current position of the player's actor. | |
Vector2 | screenPosition |
Holds the current screen position of the player's actor. | |
int | viewPoint |
Holds the current player viewpoint: 0=1st person, 1=3rd person, 2=isometric, 3=fixed camera. | |
string | weapon |
Holds the name of the currently equipped weapon. | |
string | animation |
Holds the name of the current player animation. |
Low Level Methods | |
string | GetName () |
Get the name of the player. | |
void | SetWeapon (int slot) |
Set the player's weapon to the slot number specified. | |
void | SetWeapon (string weapon) |
Set the player's weapon to the specified weapon. | |
bool | SetWeaponMatFromFlip (string flipbook, int actorMaterialIndex, int flipbookImageIndex, int r, int g, int b) |
Replace the current player weapon's material with index actorMaterialIndex by the texture with index flipbookImageIndex of the specified FlipBook entity. | |
void | ChangeWeaponMaterial (string section) |
Change the material on the player's current weapon actor according to the specified section of material.ini. | |
void | SetUseItem (string item) |
Set the specified item to be the current Use Item. | |
void | ClearUseItem (string item) |
Remove the specified Use Item. | |
bool | HasAttribute (string attribute) |
Check if the player has the specified attribute. | |
void | SetAttribute (string attribute, int amount) |
Set the value of the player's attribute to the specified amount. | |
int | GetAttribute (string attribute) |
Get the amount of the specified attribute. | |
void | ModifyAttribute (string attribute, int amount) |
Modify the amount of the specified attribute. | |
void | AddAttribute (string attribute) |
Give the player the specified attribute. | |
void | AddAttribute (string attribute, int low, int high) |
Give the player the specified attribute. | |
void | SetAttributeValueLimits (string attribute, int low, int high) |
Set the low and high value limits of the specified attribute. | |
int | GetAttributeLowLimit (string attribute) |
Return the low limit of the player's attribute. | |
int | GetAttributeHighLimit (string attribute) |
Return the high limit of the player's attribute. | |
void | PowerUp (string attribute, int amount, bool setMaxAmount) |
Increase the upper limit of the specified attribute by the given amount. | |
int | GetPowerUpLevel (string attribute) |
Get the PowerUp level of the specified attribute. | |
void | SaveAttributes (string filename) |
Saves the current player attributes to a text file of the specified name. | |
void | SetMouseControlled (bool enable) |
Define whether the player can be controlled with the mouse or not. | |
void | AttachBlendActor (string slave) |
Attach the specified entity to the player's actor. | |
void | DetachBlendActor (string slave) |
Detach the specified entity from the player. | |
void | AttachAccessory (string slave) |
Attach the specified accessory to the player. | |
void | DetachAccessory (string slave) |
Detach the specified accessory from the player. | |
void | Render (bool enable) |
Controls the rendering and collision detection of the player actor. | |
void | MatchEntityAngles (string szEntityName) |
Rotate the pawn's actor to match the angles of the specified entity. | |
void | ChangeMaterial (string materialSection) |
Change the material on the player's actor according to the specified section of material.ini. | |
void | SetLighting (float fillR, float fillG, float fillB, float ambientR, float ambientG, float ambientB, bool ambientLightFromFloor) |
Set the FillColor and AmbientColor of the player's actor. | |
void | SetAlpha (float alpha) |
Set the transparency of the pawn's actor. | |
float | GetAlpha () |
Get the transparency of the pawn's actor. | |
void | SetScale (float scale) |
Set the scale of the player's actor to scale. | |
void | SetScale (float x, float y, float z) |
Set the scale of the player's actor to the given values. | |
void | SetPosition (Vector position) |
Move the player to the specified position. | |
void | SetPosition (float x, float y, float z) |
Move the player to the specified position. | |
Vector | GetPosition () |
Returns the current player position. | |
void | SetRotation (Vector rotation) |
Set the rotation of the player to (x, y, z). | |
void | SetRotation (float x, float y, float z) |
Set the rotation of the player to (x, y, z). | |
Vector | GetRotation () |
Returns the current player rotation. | |
void | Move (Vector distance) |
Move the player by the specified distance. | |
void | Move (float x, float y, float z) |
Move the player by the specified distance. | |
void | Rotate (Vector rotation) |
Rotate the player. | |
void | Rotate (float x, float y, float z) |
Rotate the player. | |
Vector2 | GetScreenPosition () |
Get the x and y coordinates of the player actor on the screen. | |
string | GetGroundTexture () |
Get the name of the texture beneath the player. | |
void | SetIcon (string icon) |
Set the name of the player's icon image. | |
string | GetIcon () |
Get the name of the player's icon image. | |
void | Speak (string textSection, string sound, float textScrollSpeed, float textDisplayTime) |
Show a text string and optionally play a sound at the player's position during a conversation. If not in a conversation, just play back the specified sound file. | |
void | PlaySound (string filename) |
Play the WAV file filename once using the default audible range. | |
void | PlaySound (string filename, float distance) |
Play the WAV file filename once. |
Class providing access to the player character.
string Player::GetName | ( | ) |
Get the name of the player.
void Player::SetWeapon | ( | int | slot | ) |
Set the player's weapon to the slot number specified.
slot | integer value specifying the weapon slot number (0 - 39). |
void Player::SetWeapon | ( | string | weapon | ) |
Set the player's weapon to the specified weapon.
weapon | String holding the name of the weapon to switch to. |
bool Player::SetWeaponMatFromFlip | ( | string | flipbook, |
int | actorMaterialIndex, | ||
int | flipbookImageIndex, | ||
int | r, | ||
int | g, | ||
int | b | ||
) |
Replace the current player weapon's material with index actorMaterialIndex by the texture with index flipbookImageIndex of the specified FlipBook entity.
flipbook | String holding the name of a Flipbook entity. |
actorMaterialIndex | integer value specifying the index of the actor material to change. |
flipbookImageIndex | integer value specifying the index of the image to use. |
r | Specifies the red color value of the image. |
g | Specifies the green color value of the image. |
b | Specifies the blue color value of the image. |
void Player::ChangeWeaponMaterial | ( | string | section | ) |
Change the material on the player's current weapon actor according to the specified section of material.ini.
section | String holding the name of a section in the material.ini file. |
void Player::SetUseItem | ( | string | item | ) |
Set the specified item to be the current Use Item.
item | String holding the name of the item to set as Use Item. |
void Player::ClearUseItem | ( | string | item | ) |
Remove the specified Use Item.
item | String holding the name of the Use Item to remove. |
bool Player::HasAttribute | ( | string | attribute | ) |
Check if the player has the specified attribute.
attribute | String holding the name of the player's attribute to check for. |
void Player::SetAttribute | ( | string | attribute, |
int | amount | ||
) |
Set the value of the player's attribute to the specified amount.
attribute | String holding the name of the player's attribute to change. |
amount | integer value determining the new value of the specified attribute. |
int Player::GetAttribute | ( | string | attribute | ) |
Get the amount of the specified attribute.
attribute | String holding the name of the player's attribute. |
void Player::ModifyAttribute | ( | string | attribute, |
int | amount | ||
) |
Modify the amount of the specified attribute.
attribute | String holding the name of the player's attribute to change. |
amount | integer value determining the amount the specified attribute will be modified by. |
void Player::AddAttribute | ( | string | attribute | ) |
Give the player the specified attribute.
Initialize the attribute to 0 and set the low and high value limits to 0 and 100, respectively.
attribute | String holding the name of the player's attribute to create. |
void Player::AddAttribute | ( | string | attribute, |
int | low, | ||
int | high | ||
) |
Give the player the specified attribute.
Initialize the attribute to 0 and set the low and high value limits to 0 and 100, respectively.
attribute | String holding the name of the player's attribute to create. |
low | integer value determining the low value limit of the new attribute. |
high | integer value determining the high value limit of the new attribute. |
void Player::SetAttributeValueLimits | ( | string | attribute, |
int | low, | ||
int | high | ||
) |
Set the low and high value limits of the specified attribute.
attribute | String holding the name of the player's attribute to modify. |
low | integer value determining the new low value limit of the attribute. |
high | integer value determining the new high value limit of the attribute. |
int Player::GetAttributeLowLimit | ( | string | attribute | ) |
Return the low limit of the player's attribute.
attribute | String holding the name of the player's attribute to check. |
int Player::GetAttributeHighLimit | ( | string | attribute | ) |
Return the high limit of the player's attribute.
attribute | String holding the name of the player's attribute to check. |
void Player::PowerUp | ( | string | attribute, |
int | amount, | ||
bool | setMaxAmount | ||
) |
Increase the upper limit of the specified attribute by the given amount.
attribute | String holding the name of the player's attribute to modify. |
amount | integer value determining the amount by which to increase the high value limit of the attribute. |
setMaxAmount |
|
int Player::GetPowerUpLevel | ( | string | attribute | ) |
Get the PowerUp level of the specified attribute.
The PowerUp level is equal to the number of times the attribute's upper limit was increased by the PowerUp method or the ModifyAttribute entity.
attribute | String holding the name of the player's attribute to check. |
void Player::SaveAttributes | ( | string | filename | ) |
Saves the current player attributes to a text file of the specified name.
filename | String holding the name of the file to write to. |
void Player::SetMouseControlled | ( | bool | enable | ) |
Define whether the player can be controlled with the mouse or not.
enable |
|
void Player::AttachBlendActor | ( | string | slave | ) |
Attach the specified entity to the player's actor.
The attached actor will use the same animation as the player and thus must have the same skeleton.
slave | String holding the name of the entity to attach. |
void Player::DetachBlendActor | ( | string | slave | ) |
Detach the specified entity from the player.
slave | String holding the name of the attached entity. |
void Player::AttachAccessory | ( | string | slave | ) |
Attach the specified accessory to the player.
The attached actor will use the same animation as the player and thus must have the same skeleton.
slave | String holding the name of the accessory to attach as defined in the pawn.ini file. |
void Player::DetachAccessory | ( | string | slave | ) |
Detach the specified accessory from the player.
slave | String holding the name of the attached accessory as defined in the pawn.ini file. |
void Player::Render | ( | bool | enable | ) |
Controls the rendering and collision detection of the player actor.
enable |
|
void Player::MatchEntityAngles | ( | string | szEntityName | ) |
Rotate the pawn's actor to match the angles of the specified entity.
szEntityName | String holding the name of the entity. |
void Player::ChangeMaterial | ( | string | materialSection | ) |
Change the material on the player's actor according to the specified section of material.ini.
materialSection | String holding the name of a section in the material.ini file. |
void Player::SetLighting | ( | float | fillR, |
float | fillG, | ||
float | fillB, | ||
float | ambientR, | ||
float | ambientG, | ||
float | ambientB, | ||
bool | ambientLightFromFloor | ||
) |
Set the FillColor and AmbientColor of the player's actor.
fillR | Specifies the new red color value of the entity's actor. |
fillG | Specifies the new green color value of the entity's actor. |
fillB | Specifies the new blue color value of the entity's actor. |
ambientR | Specifies the new red ambient color value of the entity's actor. |
ambientG | Specifies the new green ambient color value of the entity's actor. |
ambientB | Specifies the new blue ambient color value of the entity's actor. |
ambientLightFromFloor |
|
void Player::SetAlpha | ( | float | alpha | ) |
Set the transparency of the pawn's actor.
alpha | float value specifying the transparency of the actor with 0 being fully transparent and 255 being fully opaque. |
float Player::GetAlpha | ( | ) |
Get the transparency of the pawn's actor.
void Player::SetScale | ( | float | scale | ) |
Set the scale of the player's actor to scale.
scale | float value specifying the scale of the actor in x, y and z direction. |
void Player::SetScale | ( | float | x, |
float | y, | ||
float | z | ||
) |
Set the scale of the player's actor to the given values.
x | float value specifying the scale of the actor in x direction. |
y | float value specifying the scale of the actor in y direction. |
z | float value specifying the scale of the actor in z direction. |
void Player::SetPosition | ( | Vector | position | ) |
Move the player to the specified position.
position | vector specifying the x, y and z position. |
void Player::SetPosition | ( | float | x, |
float | y, | ||
float | z | ||
) |
Move the player to the specified position.
x | float value specifying the x position. |
y | float value specifying the y position. |
z | float value specifying the z position. |
void Player::SetRotation | ( | Vector | rotation | ) |
Set the rotation of the player to (x, y, z).
rotation | vector specifying the x, y, z rotation (in degrees). |
void Player::SetRotation | ( | float | x, |
float | y, | ||
float | z | ||
) |
Set the rotation of the player to (x, y, z).
x | float value specifying the x rotation (in degrees). |
y | float value specifying the y rotation (in degrees). |
z | float value specifying the z rotation (in degrees). |
void Player::Move | ( | Vector | distance | ) |
Move the player by the specified distance.
distance | vector specifying the distance to move. |
void Player::Move | ( | float | x, |
float | y, | ||
float | z | ||
) |
Move the player by the specified distance.
x | float value specifying the distance to move in x direction. |
y | float value specifying the distance to move in y direction. |
z | float value specifying the distance to move in z direction. |
void Player::Rotate | ( | Vector | rotation | ) |
Rotate the player.
rotation | vector specifying the amount to rotate around the x, y and z axes |
void Player::Rotate | ( | float | x, |
float | y, | ||
float | z | ||
) |
Rotate the player.
x | float value specifying the amount to rotate around the x axis (in degrees). |
y | float value specifying the amount to rotate around the y axis (in degrees). |
z | float value specifying the amount to rotate around the z axis (in degrees). |
string Player::GetGroundTexture | ( | ) |
Get the name of the texture beneath the player.
void Player::SetIcon | ( | string | icon | ) |
Set the name of the player's icon image.
icon | String holding the name of the CEGUI image used as the player's icon. |
string Player::GetIcon | ( | ) |
Get the name of the player's icon image.
void Player::Speak | ( | string | textSection, |
string | sound, | ||
float | textScrollSpeed, | ||
float | textDisplayTime | ||
) |
Show a text string and optionally play a sound at the player's position during a conversation. If not in a conversation, just play back the specified sound file.
textSection | String holding the name of a section in the conversation text file. |
sound | String holding the name of the sound file (WAV, OGG, MP3) in the dubbing directory to play (optional). |
textScrollSpeed | float value specifying the speed at which the individual letters of the text will be diplayed (optional). |
textDisplayTime | float value specifying the amount of time (in seconds) the text will be shown once it is completely displayed (optional). |
void Player::PlaySound | ( | string | filename | ) |
Play the WAV file filename once using the default audible range.
filename | String holding the name of the WAV file to play. The .wav extension must be included in the name. |
void Player::PlaySound | ( | string | filename, |
float | distance | ||
) |
Play the WAV file filename once.
filename | String holding the name of the WAV file to play. The .wav extension must be included in the name. |
distance | Specifies the audible radius of the sound. |