scruffylovin Posted September 1, 2013 Share Posted September 1, 2013 Okay so I really want to make a mod but it would require some scripting which I can not seem to wrap my head around. I have tried google and delved around the internet looking for something similar but I cannot find a way to make it work. So here is what I need help with, if someone can find it in their hearts to lend assistance. I am trying to make a mod that creates a companion that on entering combat (or upon death,doesn't really matter, i believe i can tweak it if I have a basic script to work from) this NPC is replaced by a different NPC. Basically it makes the NPC transform into another person when entering combat. Now upon either death or leaving combat I would like the new NPC to go back to his holdingcell or w/e he is hidden from the rest of the game world and have the previous NPC called back. Any help would be amazing! Link to comment Share on other sites More sharing options...
SeraphimKensai Posted September 1, 2013 Share Posted September 1, 2013 So kinda of like a Dr. Jekyll and Mr. Hyde effect? Its an interesting idea. I may take a look into the feasibility of the scripting of it. I've never messed with companions but if I figure out a script that can apply your effect I'll try putting it on a potion or spell to see if the script works. Link to comment Share on other sites More sharing options...
Daedthr Posted September 1, 2013 Share Posted September 1, 2013 Hey, My idea is this: Make whatever companion you would like and then put a script on the actor then use the OnDeath event (http://www.creationkit.com/OnDeath_-_Actor), to define the time at which the Set Race command (http://www.creationkit.com/SetRace_-_Actor) is used on the actor to change him into whatever race you want it to be. Simply in this way you can have two companions in one, one in normal circumstance and then on death it turns into another race. This eliminates the need for two separate actors, avoiding the messy art of moving people out of non-rendered holding cells and what not. I do NOT know how this would work if you the face only to change, and not the race, I believe Set Race to something other than the original race will give the actor the default face of the race. You can also use the same command to return the race to the original. One problem is that if the condition is OnDeath, the actor will change, but it will still be dead, you would have to resurrect the actor first in the script and THEN change the race to circumvent the issue. You could also make this work upon entering or leaving combat, I believe their are the appropriate conditions. Now if your circumstance is something like this: You want a wimpy looking breton to turn into a Nordic God of War in full daedric armor upon entering combat. Then you could also add and remove items from the inventory of said NPC after his race has been changed. To put it simply, make a companion that changes race upon death and get things added or removed from his inventory. In this way you essentially get a different NPC in combat than outside. Hope I've helped, I'll check again in a few days if you have any questions. Daedthr P.S If YOUR trying to make the mod, you might be better off putting something like this in Mod Troubleshooting. In this area your more likely to get people posting mod requests or looking for a mod to make themselves, than people helping a new modder. Not trying to be a vigilante :D Just a thought. Link to comment Share on other sites More sharing options...
SeraphimKensai Posted September 2, 2013 Share Posted September 2, 2013 Daedthr,Its easier and at least in my opinion, more logical to do the swap via a holding cell. Reason being, is SetRace is limited in what appearance the "transformed" look would appear as, not to mention the sometimes infamous issue with the body and head skin colors not matching (which is more common especially of someone uses a custom body). Additionally, utilizing a holding cell you could have multiple settings for stats, aggression, disposition etc. Ultimately, I think you get more options. With SetRace, you have to script floating variables to store details such as the original race, otherwise reverting form will fail (like if you consoled a target to become a werewolf, they would be permanently a werewolf as the game wouldn't have saved their initial race, and the only way back is if you reverted them via console commands. The other problem with OnDeath/SetRace is you've effectively created a loop that automatically dumps its stored inventory every time it cycles a death transformation (because unless I'm mistaken there's no easy way to script a "target.resurrect(1)" command as it only uses "target.resurrect"). The only work around with that would be then to script a transfer of the inventory to a "Holding Cell" and back upon resurrection. So it seems at least likely to me, you're going to be using a holding cell anyways, so why not use it for the bulk of the work and mitigate some of the workload? Link to comment Share on other sites More sharing options...
Daedthr Posted September 2, 2013 Share Posted September 2, 2013 (edited) Seraphim, Looking on it I think I would have to agree, using a holding cell would CERTAINLY allow for more customization. I was suggesting the Set Race idea because I have previously encountered problems in using holding cells, such as the whatever I am transferring simply not appearing (probably due to my own scripting ineptitude). As for the inventory idea, the old inventory could be easily withheld simply by using equip commands instead of removing all items from the inventory and then adding the ones you want. In this way what they are using is changed, but they still have everything there upon return. However, I think maybe a better idea would be to give the follower a spell, and then force them to cast it via script, which isn't really difficult. The animation wouldn't even appear! This spell could then simply summon the new companion and you can use whatever customization options you want. If you were to also add a script effect to this spells you could Disable the original actor an Enable him when combat is over. This would use two scripts, the first would be on the first Actor, and would use a condition that stated on entering combat he casts a spell that summons the new follower, and then a second script on the new follower would kill the new actor and Enable the old one. Does the above sound more feasible? In terms of scripting it should be very easy, I have effectively done it when I created a portal for another mod. Daedthr, EDIT: Really there are so many ways to do this whichever suits are new modder the best is the one he should choose, the reason I am looking for methods other than I holding cell to do this (which I am sure is very effective) is simply because when I started modding I did a project involving this and I couldn't get it to work. I probably could now, but it has always put me off a tad, having to create new cells, moving the actor via script, so on. One more thing scruffy, if this is going to be a companion are they not going to be essential, or at the very least protected? If so using OnDeath may not be the wisest idea. Edited September 2, 2013 by Daedthr Link to comment Share on other sites More sharing options...
scruffylovin Posted September 3, 2013 Author Share Posted September 3, 2013 Well, my thoughts on the death thing was I would want him to just revert back to normal from his powerful form if he was killed. I thought I could add a little bit of scripting I found such as this. I found it from a previous poster and edited times. But after dying the NPC would lay there for a couple of seconds and then be transported back to the holding cell, and after 3 minutes resurrect. I guess my main problem with the scripting I am trying to achieve is I cannot get a grasp of holding cells. I can get an NPC to be transported back to one and to resurrect there, but I do not know how to create the script that would summon the NPC(say NPC2) as a replacement for the NPC1 that called the script, send NPC1 to the holding cell NPC2 came from, and call it back upon death of NPC2. Thank you all for your responses so far, they are helping spur a few new ideas of how to make it work. :) Event OnDying(Actor akKiller) Utility.Wait(10.0) Self.PlaceAtMe(BanishFX) MoveTo(HoldingCellMarker) Utility.Wait(180.0) Self.Resurrect(1)EndEvent Link to comment Share on other sites More sharing options...
Recommended Posts