SetCurrentFriend(object)

Set a specific creature as the caller's friend.

void SetCurrentFriend(
    object oFriend
);

Parameters

oFriend

The creature to store as the caller's friend.


Description

Set a specific creature as the caller's friend.

To remove the caller's friend, set it to OBJECT_INVALID.



Remarks

This sets a local object on the caller named "NW_ANIM_FRIEND".


Requirements

#include "x0_i0_anims"


Version

???

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);
        }
    }
}

See Also

functions:  GetCurrentFriend | GetRandomFriend
categories:  Action on Object Functions


author: Baragg, editor: Mistress, contributor: Kookoo