CreateSignPostNPC

From NWN Lexicon



Contents

[edit] CreateSignPostNPC(string, location)

Spawns a creature using the action queue.

void CreateSignPostNPC(
    string sTag,
    location lLocal
);

[edit] Parameters

sTag

The blueprint resref of the creature to spawn.

lLocal

The location to spawn the creature at.


[edit] Description

The main purpose of this function is to use the action queue to spawn creatures.

It is basically a simplified form of CreateObject that allows only creatures to be created. The main benefit of this function over CreateObject is that is has a void return type which allows it to be placed into the action queue using the ActionDoCommand function.



[edit] Requirements

#include " NW_I0_GENERIC "

[edit] Version

1.22

[edit] Example

// If the script below is placed into a creatures OnDamaged event
// it will cause the creature to run away from its attacker
// and summon its vicious evil chicken hordes to defend it.
 
#include "NW_I0_GENERIC"
 
void main()
{
    string sCreature = "nw_chicken";
 
    object oAttacker = GetLastDamager();
    location locAttacker = GetLocation(oAttacker);
 
    ActionMoveAwayFromObject(oAttacker, TRUE, 20.0f);
    ActionDoCommand(CreateSignPostNPC(sCreature, locAttacker));
    ActionDoCommand(CreateSignPostNPC(sCreature, locAttacker));
    ActionDoCommand(CreateSignPostNPC(sCreature, locAttacker));
    ActionDoCommand(CreateSignPostNPC(sCreature, locAttacker));
}

[edit] See Also



 author: Dave Withnall, editor: Tom Cassiotis
 

Personal tools
Categories