Stupid Flock Of Birds!

Intended effect:
Spawn flock of ravens (3), then scatter to lLoc4 waypoint.
As is - ravens spawn but won’t scatter to waypoint?

Be gentle…
code so far:

// Varable stack.
object oRaven1;
object oRaven2;
object oRaven3;

// Waypoints.
location lLoc1;
location lLoc2;
location lLoc3;

location lLoc4;

#include "nw_i0_2q4luskan"

void main() // Begin main.
{
    object oPC = GetEnteringObject();
    if (!GetIsPC(oPC)) return;

    // Declare birds.
    oRaven1 = GetObjectByTag("RAVEN_01");
    oRaven2 = GetObjectByTag("RAVEN_02");
    oRaven3 = GetObjectByTag("RAVEN_03");
    SetCommandable(TRUE, oRaven1);
    SetCommandable(TRUE, oRaven2);
    SetCommandable(TRUE, oRaven3);

    // Waypoints.
    lLoc1 = GetLocation(GetWaypointByTag("RAVENSPAWN_01"));
    lLoc2 = GetLocation(GetWaypointByTag("RAVENSPAWN_02"));
    lLoc3 = GetLocation(GetWaypointByTag("RAVENSPAWN_03"));

    // Final destination waypoint.
    lLoc4 = GetLocation(GetWaypointByTag("FLOCK_KILL"));

    // Apply an effect.
    ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect
    ( VFX_IMP_DUST_EXPLOSION ), lLoc2);

    // Spawn critters.
    DelayCommand(0.3, CreateObjectVoid(OBJECT_TYPE_CREATURE, "raven001", lLoc2));
    DelayCommand(0.6, CreateObjectVoid(OBJECT_TYPE_CREATURE, "raven002", lLoc1));
    DelayCommand(0.9, CreateObjectVoid(OBJECT_TYPE_CREATURE, "raven003", lLoc3));

    // Create flock scatter.
    DelayCommand(1.1, AssignCommand(oRaven1, ActionForceMoveToLocation(lLoc4)));
    DelayCommand(1.5, AssignCommand(oRaven2, ActionForceMoveToLocation(lLoc4)));
    DelayCommand(1.8, AssignCommand(oRaven3, ActionForceMoveToLocation(lLoc4)));

    // Clean up encounter.
    DestroyObject(oRaven1, 5.0);
    DestroyObject(oRaven2, 5.3);
    DestroyObject(oRaven3, 5.5);
} // End main.

Thanks, you guys are the best. :slight_smile:

1 Like

Based on assumptions - Try this:

#include "ginc_actions"

void DoRavenScene(string sTemplate, location lLoc)
{
	object o = CreateObject(OBJECT_TYPE_CREATURE, sTemplate, lLoc);
	
	DelayCommand(0.8f, AssignCommand(o, ActionForceExit("FLOCK_KILL")));
}

void main()
{
    object oPC = GetEnteringObject();
	
    if (!GetIsPC(oPC)) return;

    location lLoc1 = GetLocation(GetWaypointByTag("RAVENSPAWN_01"));
    location lLoc2 = GetLocation(GetWaypointByTag("RAVENSPAWN_02"));
    location lLoc3 = GetLocation(GetWaypointByTag("RAVENSPAWN_03"));

	ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect	(VFX_IMP_DUST_EXPLOSION), lLoc2);
	
	DelayCommand(0.3f, DoRavenScene("raven001", lLoc1));
	DelayCommand(0.6f, DoRavenScene("raven002", lLoc2));
	DelayCommand(0.9f, DoRavenScene("raven003", lLoc3));
}
1 Like

Gonna give this a go. Thanks for the code pointers. I’ll post back with the results.

This post was meant for the NWN1 boards.
How the heck did I end up in NWN2? Anyway, I tried your code. I think some functions are missing from the library along with the include file. Go figure… (❁´◡`❁)

1 Like

You are in a maze of twisty little passages, all alike…

1 Like