Encounter Woes

Howdy,
I have a goblin lookout who, when perceives a PC, runs to an exit waypoint where he vanishes. All good.
However, on the way there, he crosses a custom encounter trigger which is supposed to spawn three more goblins as if the lookout had alerted them.
Sadly, said goblins obstinately refuse to appear!
The encounter trigger is set to Single Shot, 3 Max/3Min (unique instances), Active, and the Player Triggered Only box is Unchecked.
The encounter faction is set to a custom faction which is hostile to the goblins (hostile themselves).
I have tried using stock opposed factions such as Defender, but an article in the Lexicon by Maxam says that doing this might not work.
He is not wrong…
Am I doing something dumb, or is this a known issue?
I have searched both here and on other sites, and have gone through all of my toolset and building info, but to no avail. Any tips/advice would therefore be extremely welcome.
Many thanks,
Mr T

Remove the encounter and replace it with a generic trigger. Then write a simple script to spawn in three goblins when the lookout enters it.

TR

2 Likes

And unchecking the Player Triggered Only checkbox under Advanced doesn’t work?
image

If the faction of the encounter is hostile towards goblin and viceversa it should work. But I won’t be really suprised if it won’t despite the setting is correct, encounters are extremely limited in functionality…

better replace it with generic trigger and script OR spawn them delayed automatically after some time the goblin starts running (if still alive)

1 Like

Thank you, good sirs, for your advice.
I have cobbled together the following script (and was VERY surprised when it actually worked!!)
However, as Shadooow suggests, I REALLY want to delay the spawning of the reinforcements for seven seconds following the despawning of the sentry.
I have fiddled about with such things as DelayCommand for a week or so now, but to no avail.
Any pointers to getting this right would be very gratefully received!!

// ONENTER SCRIPT FOR A TRIGGER TO SPAWN GOBLIN REINFORCEMENTS

// sentrytrigger01.nss

// This trigger should be painted immediately in front of a "Sentry Flee-to-Exit WP".
// If the fleeing sentry enters the trigger on his way to the WP, it generates
// 1-4 similar NPCs to simulate extra guards having "heard" his warning.

// The reinforcements will be spawned on the Flee-to-Exit Waypoint, after
// which the trigger destroys itself.

// If desired a "Sentry Alarm WP - Goblin" can be placed somewhere between the
// exit waypoint and the Senty's original location.
// This POST waypoint enables the reinforcements to move from their
// spawn-point as if coming to investigate the cause of the sentry's alarm.

// If the sentry is killed or somehow stopped from reaching the exit waypoint,
// the trigger won't fire since ONLY the sentry can activate it. This rewards
// smart PCs - a few less bad-guys to deal with.


void main()
{

   int iRandom = Random(3)+1;  // Decide how many to spawn.

   object oSpawn = GetNearestObjectByTag("EXIT_SENTRY01"); // Find exit WP.

   location lSpawn = GetLocation(oSpawn);  // Get location of exit WP.


   // Get Entering Object & Verify it is the lookout.

   object oLookout = GetEnteringObject();   // ID the entering NPC.
   string sLookoutTag = "SENTRY01";         // Reference the sentry's Tag.

      if (GetTag(oLookout) == sLookoutTag)  //Yes, it is the lookout.

         {
            for(iRandom;iRandom<5;iRandom++)  //set up the For loop.

            switch(Random(4))  // Spawn 1-4 goblins randomly from the list.
            {
            case 0:
            CreateObject(OBJECT_TYPE_CREATURE, "forestgoblin01", lSpawn);
            break;
            case 1:
            CreateObject(OBJECT_TYPE_CREATURE, "forestgoblin02", lSpawn);
            break;
            case 2:
            CreateObject(OBJECT_TYPE_CREATURE, "forestgoblin03", lSpawn);
            break;
            case 3:
            CreateObject(OBJECT_TYPE_CREATURE, "forestgoblin04", lSpawn);
            break;
            }
         }

   // Destroy trigger after spawning reinforcements.
   DestroyObject(OBJECT_SELF));

}  // End of script.

Thanks again,
Mister T