Jump to content

Recommended Posts

Posted

Hi all,

 

I'm trying to achieve what feels like the impossible at the moment.

 

Basically;

 

I've got a script which will randomly enable an NPC thus 'spawning' them.

The npc has an AI package which forces them to 'charge' towards an xmarker.

What I want is for the npc to hit a trigger, check if a variable from another script is true and disable (i.e. 'magic away') the NPC.

 

Given example;

 

Bob's our NPC; he spawns 7 seconds in, and charges the xmarker. He hits the trigger box, but the 'kill' variable is still 0. The player activates a key which sets the 'kill' variable to 1. Bob then magically disappears (whilst he's still inside the trigger).

 

I've poured my brain into GECK for hours trying to work out how to do this without much luck. Any theories greatly appreciated.

 

Kris

Posted

I'll offer a few tips:

You'll need a few scripts. One to enable the NPC. Immediately after enable, call EvaluatePackage on that NPC. He should charge now.

 

On trigger, Begin OnTriggerEnter bobref is what you want.

Insdie that block do If key == 1

Bobref.disable

Posted
Wonderful :) Thanks! Now, what if Bobref and his entire family turned up? So we're talking multiple NPC's now.
Posted

Well, if Bobref's family is only enabled when bob himself is enabled, then you can simply just make each family member have Bobref as their enable parent.

 

If bobref is disabled, every family member will be disabled as well. When you enable bobref, his entire family enables at the same time.

This is also helpful to keep the number of references down.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...