SetCurrentFriend
From NWN Lexicon
Contents |
[edit] SetCurrentFriend(object)
Set a specific creature as the caller's friend.
void SetCurrentFriend( object oFriend );
[edit] Parameters
oFriend
The creature to store as the caller's friend.
[edit] Description
Set a specific creature as the caller's friend.
To remove the caller's friend, set it to OBJECT_INVALID.
[edit] Remarks
This sets a local object on the caller named "NW_ANIM_FRIEND".
[edit] Requirements
#include " x0_i0_anims "
[edit] Version
???
[edit] Example
// See if there is a creature tagged "CLN_BARAGG" nearby, if so make him our friend if we do not already have a friend. #include "x0_i0_anims" void main() { object oCritter; // Check to see if we currently have no friend. Boohoo. if(OBJECT_INVALID == GetCurrentFriend()) { oCritter = GetNearestObjectByTag("CLN_BARAGG"); // oCritter is valid so make him our bud if(GetIsObjectValid(oCritter)) { SetCurrentFriend(oCritter); } } }
[edit] See Also
functions: |
author: Baragg, editor: Mistress, contributor: Kookoo