Jump to content

Making an npc track down another npc


artificialsloth

Recommended Posts

Create a quest if you already don't have one, add a new alias set to specific reference but let the reference be empty, then set flag "Optional" on the alias. Click ok. Now create a new package that does exactly what you want. Then go back to the quest alias and add the package to the alias you created. Click ok, now from script you can do this:

ReferenceAlias Property killBearAlias Auto

function GoKillBear(Actor akKiller)
StopKillingBears()
killBearAlias.ForceRefTo(akKiller)
akKiller.EvaluatePackage()
endfunction

function StopKillingBears()
Actor prev = killBearAlias.GetReference() as Actor
killBearAlias.Clear()
if(prev)
prev.EvaluatePackage()
endif
endfunction

Set the alias property to the quest alias you created and use these functions on a NPC presumably in dialog fragments.

 

If you need more information on how to use those let me know. :)

Link to comment
Share on other sites

Create a quest if you already don't have one, add a new alias set to specific reference but let the reference be empty, then set flag "Optional" on the alias. Click ok. Now create a new package that does exactly what you want. Then go back to the quest alias and add the package to the alias you created. Click ok, now from script you can do this:

ReferenceAlias Property killBearAlias Auto

function GoKillBear(Actor akKiller)
StopKillingBears()
killBearAlias.ForceRefTo(akKiller)
akKiller.EvaluatePackage()
endfunction

function StopKillingBears()
Actor prev = killBearAlias.GetReference() as Actor
killBearAlias.Clear()
if(prev)
prev.EvaluatePackage()
endif
endfunction

Set the alias property to the quest alias you created and use these functions on a NPC presumably in dialog fragments.

 

If you need more information on how to use those let me know. :smile:

How do I use the functions in dialog fragments?

Link to comment
Share on other sites

Create new topic info, set flag "Goodbye" in scripts section under "End:" put:

Actor prev = killBearAlias.GetReference() as Actor
killBearAlias.Clear()
if(prev)
prev.EvaluatePackage()
endif
killBearAlias.ForceRefTo(akSpeaker)
akSpeaker.EvaluatePackage()

click "OK". It may say some errors click ok.

 

Open topic info again and choose the newly created fragment in scripts window, click Properties, click Add, choose ReferenceAlias and set name to "killBearAlias". Click Ok, select the property and edit value, select your quest that I talked about earlier, and select the correct alias that I talked about earlier.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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