Scrabbulor Posted April 18, 2012 Share Posted April 18, 2012 (edited) Good day folks. I'm working on a new guild and quest chain and everything is going well, except, I want to spawn an actor or actors ONLY when accepting/entering a specific stage of the quest. Can I get an example of what this script might look like and how I might go about doing this? I assume the actor will need to have a script as well? Edited April 18, 2012 by Scrabbulor Link to comment Share on other sites More sharing options...
ACSputnik Posted April 19, 2012 Share Posted April 19, 2012 1) Add the NPCs to the world and change them to Initially Disabled 2) Add the NPCs to the Quest Aliases tab of your quest. Give the reference a name (For example Ulfric) and point it to the actor in the Render Window.3) In the quest fragments of the stage you want them to appear you need to add in Alias_Ulfric.GetReference().Enable()This will make the NPC begin to exist in the world during that quest stage. You can also insert this line in the last stage of the quest to turn the NPCs off again. Alias_Ulfric.GetReference().Disable() For more in depth explanations on Aliases and Quest fragments check out these links AliasesQuest Objectives and Fragments Link to comment Share on other sites More sharing options...
Jadak Posted April 19, 2012 Share Posted April 19, 2012 If you have a lot of them to enable/disable, a more elegant solution may be to place an XMarker and set the 'Enable Parent' property of all your NPC's to point to it. Then you only have to Enable/Disable the XMarker in the script, and all NPC's linked to it will be affected as well. Like if you had a whole squad of Imperial soldiers which are supposed to appear and attack some bandits for example. This also lets you change the actors that will be affected without having to rework the scripts.This is pretty much how the furniture upgrades for the houses work, only with static objects instead of actors. Link to comment Share on other sites More sharing options...
tunaisafish Posted April 19, 2012 Share Posted April 19, 2012 ^Yep what Jadak said.Any reference you use in a script (or as a forced alias) will become permanently persistent. So using one Xmarker saves a heap of memory too. Link to comment Share on other sites More sharing options...
DangerManzo Posted April 19, 2012 Share Posted April 19, 2012 I never tried doing it this way:Alias_Ulfric.GetReference().Enable() I have always usedAlias_Ulfric.TryToEnable() Enable is for references, TryToEnable is for aliases, but both ways should work. I think the second method is better for aliases that may or may not be filled or that can be filled by different things. Link to comment Share on other sites More sharing options...
ACSputnik Posted April 19, 2012 Share Posted April 19, 2012 Ditto for the xmarker if you have a lot of actors to swap out or if you need one to fade out and one to fade in (just set one to be opposite of parent enable state). I use this in my quest to replace captives in cage with the kidnappers. A little justice I think ;) Link to comment Share on other sites More sharing options...
Recommended Posts