xoreos  0.0.5
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Engines::NWN2::Object Class Reference

An object within a NWN2 area. More...

#include <object.h>

Inheritance diagram for Engines::NWN2::Object:
Inheritance graph
[legend]
Collaboration diagram for Engines::NWN2::Object:
Collaboration graph
[legend]

Public Member Functions

 Object (ObjectType type=kObjectTypeInvalid)
 
virtual ~Object ()
 
ObjectType getType () const
 Return the exact type of the object. More...
 
virtual void loadModel ()
 Load the object's model(s). More...
 
virtual void unloadModel ()
 Unload the object's model(s). More...
 
virtual void show ()
 Show the object's model(s). More...
 
virtual void hide ()
 Hide the object's model(s). More...
 
const std::list< uint32 > & getIDs () const
 Return the object's model IDs. More...
 
const Common::UStringgetName () const
 Return the object's name. More...
 
const Common::UStringgetDescription () const
 Return the object's description. More...
 
const Common::UStringgetConversation () const
 Return the object's default conversation (DLG). More...
 
const Aurora::SSFFilegetSSF ()
 Return the object's sound set. More...
 
bool isStatic () const
 Is the object static (not manipulable at all)? More...
 
bool isUsable () const
 Can the object be used by the PC? More...
 
bool isClickable () const
 Can the player click the object? More...
 
AreagetArea () const
 Return the area this object is currently in. More...
 
void setArea (Area *)
 Set the area this object is currently in. More...
 
virtual void getPosition (float &x, float &y, float &z) const
 Return the object's position within its area. More...
 
virtual void getOrientation (float &x, float &y, float &z, float &angle) const
 Return the object's orientation. More...
 
virtual void setPosition (float x, float y, float z)
 Set the object's position within its area. More...
 
virtual void setOrientation (float x, float y, float z, float angle)
 Set the object's orientation. More...
 
Location getLocation () const
 Create a Location out of the object's area, position and orientation. More...
 
virtual void enter ()
 The cursor entered the object. More...
 
virtual void leave ()
 The cursor left the object. More...
 
virtual void highlight (bool enabled)
 (Un)Highlight the object. More...
 
virtual bool click (Object *triggerer=0)
 The object was clicked. More...
 
void speakString (const Common::UString &string, uint32 volume)
 Speak the specified string. More...
 
void speakOneLiner (Common::UString conv, Object *tokenTarget=0)
 Speak an one-liner from the specified conversation file. More...
 
void stopSound ()
 Stop the current object sound. More...
 
void playSound (const Common::UString &sound, bool pitchVariance=false)
 Play an object sound. More...
 
- Public Member Functions inherited from Aurora::NWScript::Object
 Object ()
 
uint32 getID () const
 
const Common::UStringgetTag () const
 
- Public Member Functions inherited from Aurora::NWScript::VariableContainer
 VariableContainer ()
 
virtual ~VariableContainer ()
 
bool hasVariable (const Common::UString &var) const
 
VariablegetVariable (const Common::UString &var, Type type=kTypeVoid)
 
const VariablegetVariable (const Common::UString &var) const
 
void setVariable (const Common::UString &var, const Variable &value)
 
void removeVariable (const Common::UString &var)
 
void clearVariables ()
 
- Public Member Functions inherited from Engines::NWN2::ScriptContainer
 ScriptContainer ()
 
 ~ScriptContainer ()
 
const Common::UStringgetScript (Script script) const
 
bool hasScript (Script script) const
 
bool runScript (Script script, const Aurora::NWScript::ObjectReference owner=Aurora::NWScript::ObjectReference(), const Aurora::NWScript::ObjectReference triggerer=Aurora::NWScript::ObjectReference())
 

Protected Member Functions

void loadSSF ()
 Load the object's sound set. More...
 
void readVarTable (const Aurora::GFF3List &varTable)
 Read the object's variable table. More...
 
void readVarTable (const Aurora::GFF3Struct &gff)
 
- Protected Member Functions inherited from Engines::NWN2::ScriptContainer
void clearScripts ()
 
void readScripts (const Aurora::GFF3Struct &gff)
 
void readScripts (const ScriptContainer &container)
 

Protected Attributes

ObjectType _type
 The object's type. More...
 
Common::UString _name
 The object's display name. More...
 
Common::UString _description
 The object's description. More...
 
Common::UString _conversation
 The object's default conversation. More...
 
uint32 _soundSet
 The object's sound set, as an index into soundset.2da. More...
 
Common::ScopedPtr< Aurora::SSFFile_ssf
 The object's sound set. More...
 
bool _static
 Is the object static? More...
 
bool _usable
 Is the object usable? More...
 
std::list< uint32_ids
 The object's model IDs. More...
 
Area_area
 The area the object is currently in. More...
 
float _position [3]
 The object's position. More...
 
float _orientation [4]
 The object's orientation. More...
 
Sound::ChannelHandle _sound
 The currently playing object sound. More...
 
- Protected Attributes inherited from Aurora::NWScript::Object
uint32 _id
 
Common::UString _tag
 

Additional Inherited Members

- Static Public Member Functions inherited from Engines::NWN2::ScriptContainer
static bool runScript (const Common::UString &script, const Aurora::NWScript::ObjectReference owner=Aurora::NWScript::ObjectReference(), const Aurora::NWScript::ObjectReference triggerer=Aurora::NWScript::ObjectReference())
 
static bool runScript (const Common::UString &script, const Aurora::NWScript::ScriptState &state, const Aurora::NWScript::ObjectReference owner=Aurora::NWScript::ObjectReference(), const Aurora::NWScript::ObjectReference triggerer=Aurora::NWScript::ObjectReference())
 

Detailed Description

An object within a NWN2 area.

Definition at line 58 of file object.h.

Constructor & Destructor Documentation

◆ Object()

Engines::NWN2::Object::Object ( ObjectType  type = kObjectTypeInvalid)

Definition at line 53 of file object.cpp.

References Aurora::NWScript::Object::_id, _orientation, _position, Common::generateIDNumber(), and ObjectMan.

Here is the call graph for this function:

◆ ~Object()

Engines::NWN2::Object::~Object ( )
virtual

Reimplemented from Aurora::NWScript::Object.

Definition at line 68 of file object.cpp.

References ObjectMan.

Member Function Documentation

◆ click()

bool Engines::NWN2::Object::click ( Object triggerer = 0)
virtual

The object was clicked.

Reimplemented in Engines::NWN2::Creature, Engines::NWN2::Placeable, and Engines::NWN2::Door.

Definition at line 178 of file object.cpp.

Referenced by Engines::NWN2::Area::click().

Here is the caller graph for this function:

◆ enter()

void Engines::NWN2::Object::enter ( )
virtual

The cursor entered the object.

Reimplemented in Engines::NWN2::Creature, Engines::NWN2::Placeable, and Engines::NWN2::Door.

Definition at line 169 of file object.cpp.

Referenced by Engines::NWN2::Module::replaceModule(), and Engines::NWN2::Area::setActive().

Here is the caller graph for this function:

◆ getArea()

Area * Engines::NWN2::Object::getArea ( ) const

◆ getConversation()

const Common::UString & Engines::NWN2::Object::getConversation ( ) const

Return the object's default conversation (DLG).

Definition at line 96 of file object.cpp.

References _conversation.

◆ getDescription()

const Common::UString & Engines::NWN2::Object::getDescription ( ) const

Return the object's description.

Definition at line 92 of file object.cpp.

References _description.

Referenced by Engines::NWN2::Module::getDescription().

Here is the caller graph for this function:

◆ getIDs()

const std::list< uint32 > & Engines::NWN2::Object::getIDs ( ) const

Return the object's model IDs.

Definition at line 118 of file object.cpp.

References _ids.

◆ getLocation()

Location Engines::NWN2::Object::getLocation ( ) const

Create a Location out of the object's area, position and orientation.

Definition at line 130 of file object.cpp.

References _area, _position, Engines::NWN2::Location::setArea(), Engines::NWN2::Location::setFacing(), and Engines::NWN2::Location::setPosition().

Here is the call graph for this function:

◆ getName()

const Common::UString & Engines::NWN2::Object::getName ( ) const

Return the object's name.

Definition at line 88 of file object.cpp.

References _name.

Referenced by Engines::NWN2::Module::enter(), Engines::NWN2::Module::getName(), Engines::NWN2::Area::getName(), Engines::NWN2::Functions::sendMessageToPC(), and speakString().

Here is the caller graph for this function:

◆ getOrientation()

void Engines::NWN2::Object::getOrientation ( float &  x,
float &  y,
float &  z,
float &  angle 
) const
virtual

Return the object's orientation.

Definition at line 148 of file object.cpp.

References _orientation.

Referenced by Engines::NWN2::Situated::loadModel(), Engines::NWN2::Creature::loadModel(), Engines::NWN2::Situated::setOrientation(), and Engines::NWN2::Creature::setOrientation().

Here is the caller graph for this function:

◆ getPosition()

void Engines::NWN2::Object::getPosition ( float &  x,
float &  y,
float &  z 
) const
virtual

◆ getSSF()

const Aurora::SSFFile * Engines::NWN2::Object::getSSF ( )

Return the object's sound set.

Definition at line 100 of file object.cpp.

References _ssf, Common::ScopedPtrBase< T, Deallocator >::get(), and loadSSF().

Here is the call graph for this function:

◆ getType()

ObjectType Engines::NWN2::Object::getType ( ) const

Return the exact type of the object.

Definition at line 72 of file object.cpp.

References _type.

Referenced by Engines::NWN2::Functions::getNearestObject(), Engines::NWN2::Functions::getObjectType(), and Engines::NWN2::Functions::getParamObject().

Here is the caller graph for this function:

◆ hide()

void Engines::NWN2::Object::hide ( )
virtual

Hide the object's model(s).

Reimplemented in Engines::NWN2::Area, Engines::NWN2::Creature, Engines::NWN2::Door, Engines::NWN2::Placeable, and Engines::NWN2::Situated.

Definition at line 85 of file object.cpp.

Referenced by Engines::NWN2::Waypoint::~Waypoint().

Here is the caller graph for this function:

◆ highlight()

void Engines::NWN2::Object::highlight ( bool  enabled)
virtual

(Un)Highlight the object.

Reimplemented in Engines::NWN2::Creature, Engines::NWN2::Placeable, and Engines::NWN2::Door.

Definition at line 175 of file object.cpp.

◆ isClickable()

bool Engines::NWN2::Object::isClickable ( ) const

Can the player click the object?

Definition at line 114 of file object.cpp.

References _static, and _usable.

Referenced by Engines::NWN2::Situated::loadModel(), and Engines::NWN2::Creature::loadModel().

Here is the caller graph for this function:

◆ isStatic()

bool Engines::NWN2::Object::isStatic ( ) const

Is the object static (not manipulable at all)?

Definition at line 106 of file object.cpp.

References _static.

Referenced by Engines::NWN2::Area::loadModels().

Here is the caller graph for this function:

◆ isUsable()

bool Engines::NWN2::Object::isUsable ( ) const

Can the object be used by the PC?

Definition at line 110 of file object.cpp.

References _usable.

◆ leave()

void Engines::NWN2::Object::leave ( )
virtual

The cursor left the object.

Reimplemented in Engines::NWN2::Creature, Engines::NWN2::Module, Engines::NWN2::Placeable, and Engines::NWN2::Door.

Definition at line 172 of file object.cpp.

Referenced by Engines::NWN2::Area::removeFocus(), and Engines::NWN2::Area::setActive().

Here is the caller graph for this function:

◆ loadModel()

void Engines::NWN2::Object::loadModel ( )
virtual

Load the object's model(s).

Reimplemented in Engines::NWN2::Creature, and Engines::NWN2::Situated.

Definition at line 76 of file object.cpp.

Referenced by Engines::NWN2::Area::loadModels().

Here is the caller graph for this function:

◆ loadSSF()

void Engines::NWN2::Object::loadSSF ( )
protected

Load the object's sound set.

Definition at line 182 of file object.cpp.

References _soundSet, _ssf, Aurora::NWScript::Object::_tag, Common::UString::c_str(), Common::UString::empty(), Common::exceptionDispatcherWarning(), Aurora::TwoDAFile::getRow(), Aurora::TwoDARow::getString(), Aurora::kFieldIDInvalid, Common::ScopedPtrBase< T, Deallocator >::reset(), and TwoDAReg.

Referenced by getSSF().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ playSound()

void Engines::NWN2::Object::playSound ( const Common::UString sound,
bool  pitchVariance = false 
)

◆ readVarTable() [1/2]

void Engines::NWN2::Object::readVarTable ( const Aurora::GFF3List varTable)
protected

◆ readVarTable() [2/2]

void Engines::NWN2::Object::readVarTable ( const Aurora::GFF3Struct gff)
protected

Definition at line 240 of file object.cpp.

References Aurora::GFF3Struct::getList(), Aurora::GFF3Struct::hasField(), and readVarTable().

Here is the call graph for this function:

◆ setArea()

void Engines::NWN2::Object::setArea ( Area area)

Set the area this object is currently in.

Definition at line 126 of file object.cpp.

References _area.

Referenced by Engines::NWN2::Module::enterArea(), and Engines::NWN2::Module::movePC().

Here is the caller graph for this function:

◆ setOrientation()

void Engines::NWN2::Object::setOrientation ( float  x,
float  y,
float  z,
float  angle 
)
virtual

Set the object's orientation.

Reimplemented in Engines::NWN2::Creature, and Engines::NWN2::Situated.

Definition at line 162 of file object.cpp.

References _orientation.

Referenced by Engines::NWN2::Waypoint::load(), Engines::NWN2::Situated::setOrientation(), and Engines::NWN2::Creature::setOrientation().

Here is the caller graph for this function:

◆ setPosition()

void Engines::NWN2::Object::setPosition ( float  x,
float  y,
float  z 
)
virtual

Set the object's position within its area.

Reimplemented in Engines::NWN2::Creature, and Engines::NWN2::Situated.

Definition at line 156 of file object.cpp.

References _position.

Referenced by Engines::NWN2::Waypoint::load(), Engines::NWN2::Situated::setPosition(), and Engines::NWN2::Creature::setPosition().

Here is the caller graph for this function:

◆ show()

void Engines::NWN2::Object::show ( )
virtual

Show the object's model(s).

Reimplemented in Engines::NWN2::Area, Engines::NWN2::Creature, Engines::NWN2::Door, Engines::NWN2::Placeable, and Engines::NWN2::Situated.

Definition at line 82 of file object.cpp.

◆ speakOneLiner()

void Engines::NWN2::Object::speakOneLiner ( Common::UString  conv,
Object tokenTarget = 0 
)

◆ speakString()

void Engines::NWN2::Object::speakString ( const Common::UString string,
uint32  volume 
)

Speak the specified string.

Definition at line 245 of file object.cpp.

References getName(), and status().

Referenced by Engines::NWN2::Functions::actionSpeakString(), speakOneLiner(), and Engines::NWN2::Functions::speakString().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stopSound()

void Engines::NWN2::Object::stopSound ( )

Stop the current object sound.

Definition at line 280 of file object.cpp.

References _sound, and SoundMan.

Referenced by playSound().

Here is the caller graph for this function:

◆ unloadModel()

void Engines::NWN2::Object::unloadModel ( )
virtual

Unload the object's model(s).

Reimplemented in Engines::NWN2::Creature, and Engines::NWN2::Situated.

Definition at line 79 of file object.cpp.

Member Data Documentation

◆ _area

Area* Engines::NWN2::Object::_area
protected

The area the object is currently in.

Definition at line 160 of file object.h.

Referenced by getArea(), getLocation(), and setArea().

◆ _conversation

Common::UString Engines::NWN2::Object::_conversation
protected

The object's default conversation.

Definition at line 150 of file object.h.

Referenced by getConversation(), Engines::NWN2::Situated::loadProperties(), Engines::NWN2::Creature::loadProperties(), and speakOneLiner().

◆ _description

Common::UString Engines::NWN2::Object::_description
protected

The object's description.

Definition at line 148 of file object.h.

Referenced by getDescription(), Engines::NWN2::Situated::loadProperties(), and Engines::NWN2::Creature::loadProperties().

◆ _ids

std::list<uint32> Engines::NWN2::Object::_ids
protected

The object's model IDs.

Definition at line 158 of file object.h.

Referenced by getIDs(), Engines::NWN2::Situated::loadModel(), and Engines::NWN2::Creature::loadModel().

◆ _name

Common::UString Engines::NWN2::Object::_name
protected

◆ _orientation

float Engines::NWN2::Object::_orientation[4]
protected

The object's orientation.

Definition at line 163 of file object.h.

Referenced by getOrientation(), Object(), and setOrientation().

◆ _position

float Engines::NWN2::Object::_position[3]
protected

The object's position.

Definition at line 162 of file object.h.

Referenced by getLocation(), getPosition(), Object(), and setPosition().

◆ _sound

Sound::ChannelHandle Engines::NWN2::Object::_sound
protected

The currently playing object sound.

Definition at line 165 of file object.h.

Referenced by playSound(), and stopSound().

◆ _soundSet

uint32 Engines::NWN2::Object::_soundSet
protected

The object's sound set, as an index into soundset.2da.

Definition at line 152 of file object.h.

Referenced by Engines::NWN2::Creature::loadProperties(), and loadSSF().

◆ _ssf

Common::ScopedPtr<Aurora::SSFFile> Engines::NWN2::Object::_ssf
protected

The object's sound set.

Definition at line 153 of file object.h.

Referenced by getSSF(), and loadSSF().

◆ _static

bool Engines::NWN2::Object::_static
protected

Is the object static?

Definition at line 155 of file object.h.

Referenced by Engines::NWN2::Creature::init(), isClickable(), isStatic(), and Engines::NWN2::Situated::loadProperties().

◆ _type

ObjectType Engines::NWN2::Object::_type
protected

The object's type.

Definition at line 145 of file object.h.

Referenced by getType().

◆ _usable

bool Engines::NWN2::Object::_usable
protected

Is the object usable?

Definition at line 156 of file object.h.

Referenced by Engines::NWN2::Creature::init(), isClickable(), isUsable(), and Engines::NWN2::Situated::loadProperties().


The documentation for this class was generated from the following files: