Spirit_Shard Posted May 24, 2016 Posted May 24, 2016 I'm currently working on a new pets type mod but I'm having a few issues getting 2 specific mechanics to work. The mod summons creatures to fight along side you and they can be commanded and what-not. For one mechanic I want to alter the summon's stats as soon as it's spawned based on a few variables and the other mechanic would have a spell which hits a target then summons the creature to trigger SexLab onto (essentially a 'rape target' summon spell). My problem is, I don't know exactly how to reference the summon. For testing purposes I have a Dog which is set as a unique actor and is summonable in-game but I can't figure out how to reference the dog without doing some sort of radius scan of sorts (like using cloaks). Is there a way to directly reference the custom dog actor like you would the player with a PlayerAlias? EDIT : I also believe an 'on actor load' function would also work, I just can't find any references to it...
Guest Posted May 24, 2016 Posted May 24, 2016 If the actor (the dog) is unique, then just place it in a ReferenceAlias as unique NPC (not as Specific Actor), and grab the actor from the reference alias once it is summoned.
Spirit_Shard Posted May 24, 2016 Author Posted May 24, 2016 If the actor (the dog) is unique, then just place it in a ReferenceAlias as unique NPC (not as Specific Actor), and grab the actor from the reference alias once it is summoned. That's what I'm trying to do, but I'm obviously screwing up somewhere because Creation Kit won't find the Alias, or let me select the custom dog actor. Here's an example screen shot of how I have it set up... Do I need to use an "ObjectReference" instead? I still run into Creation Kit being unable to fill the alias. (sorry if the solution is simple, I'm just not finding it for some reason lol) EDIT : Ignore "actor dog = akTarget" from the script, that was just so it would compile lol
Guest Posted May 24, 2016 Posted May 24, 2016 The referencealias looks good. Can I ask what the problem is?
Spirit_Shard Posted May 24, 2016 Author Posted May 24, 2016 The referencealias looks good. Can I ask what the problem is? When I go to auto-fill for the script within the main quest script (which would hold the stat-altering function) or a magic effect script it won't fill. PlayerRef fills automatically but the custom dog won't auto-fill and I can't select the actor in the reference list, which leads to the script not actually functioning. Creation Kit's site says something about the actor needing to be in a persistent location, does this mean I have to place it in the world somewhere or something? Screen cap to 'try' and explain a bit better?
Guest Posted May 24, 2016 Posted May 24, 2016 Yes, if you want to fill an actor property, you need the actor to be in a cell. You have 3 options: 1) Put is in QASmoke (quick, easy, but can be problematic) 2) Create an empty cell, and put your actor in this empty cell (this is safe and fast) 3) Put the actor in a cell, but mark it as "disabled", then in your script you will, as first step, enable it. (This is my favorite solution.)
Spirit_Shard Posted May 24, 2016 Author Posted May 24, 2016 Yes, if you want to fill an actor property, you need the actor to be in a cell. You have 3 options: 1) Put is in QASmoke (quick, easy, but can be problematic) 2) Create an empty cell, and put your actor in this empty cell (this is safe and fast) 3) Put the actor in a cell, but mark it as "disabled", then in your script you will, as first step, enable it. (This is my favorite solution.) Well this at least sets me on the right track, thank you! I'll just make a small cell, bundle my 'pets' in there, and profit? I don't know the weight of enabling/disabling a cell, but if it's optimal to have it disabled until needed I'll try and run that.
Guest Posted May 24, 2016 Posted May 24, 2016 Addig an interior cell, with just your NPCs inside has a cost close to zero. Just as small recommendation: inside the cell, place also any ground object (the floor of a building, for example) or, in case you need to jump to the cell for debugging purposes you will fall forever.
Spirit_Shard Posted May 24, 2016 Author Posted May 24, 2016 Addig an interior cell, with just your NPCs inside has a cost close to zero. Just as small recommendation: inside the cell, place also any ground object (the floor of a building, for example) or, in case you need to jump to the cell for debugging purposes you will fall forever. Well, I got the cell working and everything but it seems the summon spell I have still creates a duplicate with a different reference and I don't know how to use the original quest alias to find the copy. No matter what I try I can't automatically target the summoned creature, everything requires some manual work around which just won't work for my idea to work.. would it be easier at this point to try and make a summon spell 'from scratch' instead of using Skyrim's default ones? or am I missing something >.<
Guest Posted May 24, 2016 Posted May 24, 2016 You may want to use a different template for the spell. "Summon" will actually create a copy of the NPC. It will NOT be unique. Use a template "script" and in the code do something like: Actor Property sup_pet_dog Actor Property PlayerRef Auto Event OnEffectStart(Actor t, Actor c) if sup_pet_dog.isDisabled() sup_pet_dog.moveTo(PlayerRef, 50) sup_pet_dog.enable(true) endIf EndEvent Event OnEffectFinish(Actor t, Actor c) sup_pet_dog.disable(true) EndEvent
Spirit_Shard Posted May 24, 2016 Author Posted May 24, 2016 You may want to use a different template for the spell. "Summon" will actually create a copy of the NPC. It will NOT be unique. Use a template "script" and in the code do something like: Actor Property sup_pet_dog Actor Property PlayerRef Auto Event OnEffectStart(Actor t, Actor c) if sup_pet_dog.isDisabled() sup_pet_dog.moveTo(PlayerRef, 50) sup_pet_dog.enable(true) endIf EndEvent Event OnEffectFinish(Actor t, Actor c) sup_pet_dog.disable(true) EndEvent That worked perfectly!.. sort of (had to move enable() above moveto() X.x). From this I can do everything I was able to do manually, will probably use a set of toggle-able Abilities to manage and tag pets. Thank you a ton, I really wish stuff like this was easier to find.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.