artificialsloth Posted November 18, 2013 Share Posted November 18, 2013 For example say you tell this npc to go kill a bear for you then that npc would run to the nearest bear and attack it, how would one go about making something like that happen. Link to comment Share on other sites More sharing options...
DeathWishFK Posted November 18, 2013 Share Posted November 18, 2013 bump ^ Link to comment Share on other sites More sharing options...
meh321 Posted November 18, 2013 Share Posted November 18, 2013 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 endfunctionSet 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 More sharing options...
artificialsloth Posted November 18, 2013 Author Share Posted November 18, 2013 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 endfunctionSet 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 More sharing options...
meh321 Posted November 18, 2013 Share Posted November 18, 2013 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 More sharing options...
artificialsloth Posted November 18, 2013 Author Share Posted November 18, 2013 How do I make the package because apparently what I did doesn't work? Link to comment Share on other sites More sharing options...
Recommended Posts