Ironman5000 Posted October 17, 2013 Share Posted October 17, 2013 Howdy doody! I'm making a kind of 'vanilla magic extended' mod with some cool new stuff and want to make a 'doppelganger' spell. Shivering Isles achieved this for Symbols of Office quest but i'm unsure how it was done. I checked the CS (quest "SE11") but i'm struggling to find how it was done. Frankly I suck at scripting and baffled by papyrus, so as much of a long shot as this I would like to ask any skilled scripters if they would be prepared to convert this TES4 script to work as a spell in skyrim? I would obviously give credits for your work, this is just something i've been after for some time and would fit in really well with a massive lore-friendly magic overhaul (what i'm going for). Here is the long and scary script anyway, of course chunks of it aren't needed and don't know if this would even work but would be great to have if it did, scn SE11bStandingStoneScript short StandingStoneActivate ;Controls standing stone state short DopplegangerRandom ;Set to 1 to begin random doppleganger creation short Dice ;Used for random doppleganger creation short DopplegangerHealth ;Variable for holding the doppleganger's health short DopplegangerSpeed ;Variable for holding the doppleganger's speed short PrefersBlunt ;Set to 1 if blunt skill is higher than blade short PrefersBlade ;Set to 1 if blade skill is higher than blunt short doOnce ;Internal control variable short Tick ;Internal control variable float RandomTimer float timer ;Timer ref SE11DopplegangerRef ;Reference variable for doppleganger BEGIN OnLoad SE11DopplegangerRef.AddSpell SE11DopplegangerSpell END BEGIN GameMode ;this block creates and sets the doppleganger if ( doOnce == 0 ) ;creates doppleganger and applies effects set SE11DopplegangerRef to player.CreateFullActorCopy SE11DopplegangerRef.AddSpell SE11DopplegangerSpell ;Doubles the dopplegangers health for balance set DopplegangerHealth to ( Player.GetBaseAv Health * 2 ) SE11DopplegangerRef.SetAv Health DopplegangerHealth ;Halves the dopplegangers speed for balance set DopplegangerSpeed to ( Player.GetBaseAv Speed / 2 ) SE11DopplegangerRef.SetAv Speed DopplegangerSpeed ;Determines the preferred weapon for the doppleganger if Player.GetAv Blade >= Player.GetAv Blunt set PrefersBlade to 1 else set PrefersBlunt to 1 endif ;moves doppleganger to holding pen SE11DopplegangerRef.moveto SE11bDopplegangerHoldingMarker ;Removes quest items, problem spells, and problem items from doppleganger SE11DopplegangerRef.RemoveItem DASkullCorruption 1 SE11DopplegangerRef.RemoveItem DAClavicusUmbraSword 1 SE11DopplegangerRef.RemoveItem DAWabbajack01 1 SE11DopplegangerRef.RemoveItem FGD03BWCBlade 1 SE11DopplegangerRef.RemoveItem MG03Staff 1 SE11DopplegangerRef.RemoveItem MG08Staff 1 SE11DopplegangerRef.RemoveItem Dark01KnifeBlade 1 SE11DopplegangerRef.RemoveItem OldDAVolendrung 1 SE11DopplegangerRef.RemoveItem MS40Dagger 1 SE11DopplegangerRef.RemoveItem FGC06WeapSteelLongsword 1 SE11DopplegangerRef.RemoveItem FGC06WeapSteelWarhammer 1 SE11DopplegangerRef.RemoveItem FGC06WeapSteelBow 1 SE11DopplegangerRef.RemoveItem SE09BreathNet 1 SE11DopplegangerRef.RemoveItem FGD03BlackwoodShield 1 SE11DopplegangerRef.RemoveItem DAGoldbrand 1 SE11DopplegangerRef.RemoveItem DASanguineRose 1 SE11DopplegangerRef.RemoveItem MGStaffofWorms 1 SE11DopplegangerRef.RemoveItem DAEbonyBlade 1 SE11DopplegangerRef.RemoveItem DAMephalaDalviluDagger 1 SE11DopplegangerRef.RemoveItem DAMolagBalCursedMace 1 SE11DopplegangerRef.RemoveItem DAMolagBalMace 1 SE11DopplegangerRef.RemoveItem Dark05Blade 1 SE11DopplegangerRef.RemoveItem TG01RohssansSword 1 SE11DopplegangerRef.RemoveItem TG05HrormirsIcestaff 1 SE11DopplegangerRef.RemoveItem TG11ElvenLongSword 1 SE11DopplegangerRef.RemoveItem TG11ElvenMace 1 SE11DopplegangerRef.RemoveItem SvenjaBow 1 SE11DopplegangerRef.RemoveItem SilvDagshimmerthorn, 1 SE11DopplegangerRef.RemoveItem SQ10Rockshatter01, 1 SE11DopplegangerRef.RemoveItem SQ10Rockshatter05, 1 SE11DopplegangerRef.RemoveItem SQ10Rockshatter10, 1 SE11DopplegangerRef.RemoveItem SQ10Rockshatter15, 1 SE11DopplegangerRef.RemoveItem SQ10Rockshatter20, 1 SE11DopplegangerRef.RemoveItem SQ10Rockshatter25, 1 SE11DopplegangerRef.RemoveItem Torch02, 99 SE11DopplegangerRef.RemoveSpell SE07SaintSpell SE11DopplegangerRef.RemoveSpell SEPwSummonGoldenSaint SE11DopplegangerRef.RemoveSpell SE07SeducerSpell SE11DopplegangerRef.RemoveSpell SEPwSummonDarkSeducer SE11DopplegangerRef.RemoveSpell StandardSummonAtronachFlameJourneyman SE11DopplegangerRef.RemoveSpell StandardSummonAtronachFrostExpert SE11DopplegangerRef.RemoveSpell StandardSummonAtronachStormMaster SE11DopplegangerRef.RemoveSpell StandardSummonClannfearExpert SE11DopplegangerRef.RemoveSpell StandardSummonDaedrothExpert SE11DopplegangerRef.RemoveSpell StandardSummonDremoraJourneyman SE11DopplegangerRef.RemoveSpell StandardSummonDremoraLordMaster SE11DopplegangerRef.RemoveSpell StandardSummonLichMaster SE11DopplegangerRef.RemoveSpell StandardSummonSkeletonApprentice SE11DopplegangerRef.RemoveSpell StandardSummonSkeletonChampionExpert SE11DopplegangerRef.RemoveSpell StandardSummonSkeletonGuardianJourneyman SE11DopplegangerRef.RemoveSpell StandardSummonSkeletonHeroExpert SE11DopplegangerRef.RemoveSpell StandardSummonSpiderDaedraExpert SE11DopplegangerRef.RemoveSpell StandardSummonWraithFadedExpert SE11DopplegangerRef.RemoveSpell StandardSummonWraithGloomMaster SE11DopplegangerRef.RemoveSpell StandardSummonXivilaiMaster SE11DopplegangerRef.RemoveSpell StandardSummonZombieApprentice SE11DopplegangerRef.RemoveSpell StandardSummonZombieHeadlessJourneyman SE11DopplegangerRef.RemoveSpell SEStdSummonAtronachFlesh2Apprentice SE11DopplegangerRef.RemoveSpell SEStdSummonAtronachFlesh3Journeyman SE11DopplegangerRef.RemoveSpell SEStdSummonAtronachFlesh4Expert SE11DopplegangerRef.RemoveSpell SEStdSummonAtronachFlesh5Master SE11DopplegangerRef.RemoveSpell SEStdSummonHunger2Apprentice SE11DopplegangerRef.RemoveSpell SEStdSummonHunger3Journeyman SE11DopplegangerRef.RemoveSpell SEStdSummonHunger4Expert SE11DopplegangerRef.RemoveSpell SEStdSummonHunger5Master SE11DopplegangerRef.RemoveSpell SEStdSummonShambles3Journeyman SE11DopplegangerRef.RemoveSpell SEStdSummonShambles4Expert SE11DopplegangerRef.RemoveSpell SEStdSummonShambles5Master ;Sets doppleganger combat style SE11DopplegangerRef.SetCombatStyle SE11DopplegangerCombatStyle ;Removes doppleganger from all guilds SE11DopplegangerRef.SetFactionRank MagesGuild, -1 SE11DopplegangerRef.SetFactionRank ThievesGuild, -1 SE11DopplegangerRef.SetFactionRank Beggars, -1 SE11DopplegangerRef.SetFactionRank ICWaterFrontResident, -1 SE11DopplegangerRef.SetFactionRank FightersGuild, -1 SE11DopplegangerRef.SetFactionRank DarkBrotherhood, -1 SE11DopplegangerRef.SetFactionRank DarkPlayer, -1 SE11DopplegangerRef.SetFactionRank EvilSolo, 0 ;blocks the script from running twice set doOnce to 1 endif ;Sets stage when player enters cell if ( player.GetInCell XPMilchar03 == 1 ) && ( getStageDone SE11 150 == 0 ) SetStage SE11 150 endif if ( SE11DopplegangerRef.getDead == 1 ) && ( getStageDone SE11 160 == 0 ) setstage SE11 160 SE11DopplegangerRef.pme strp SE11DopplegangerRef.setdestroyed 1 endif if ( GetStageDone SE11 155 == 0 ) if ( Player.GetDistance SE11bStandingStoneRef < 500 ) ;sets standing stone to active state set StandingStoneActivate to 1 set timer to 12 ;sets quest stage setstage SE11 155 endif endif ;This block is run when the player activates the standing stone if ( StandingStoneActivate == 1 ) if ( timer >= -1 ) set timer to timer - GetSecondsPassed endif if ( timer < 11 ) && ( tick == 0 ) SE11CloneFXREF.PlayGroup forward 1 set Tick to 1 elseif ( timer < 5 ) && ( tick == 1 ) SE11DopplegangerRef.addScriptPackage SE11DopplegangerArrivePackage SE11DopplegangerRef.additem SE11AnimObject 1 SE11DopplegangerRef.evp set Tick to 2 elseif ( timer < 3 ) && ( tick == 2 ) ;Adds and equips the doppleganger's sword if ( PrefersBlade == 1 ) SE11DopplegangerRef.AddItem SE11LLDoppleGangerSword 1 SE11DopplegangerRef.UnequipItem Torch02, 1 if ( SE11DopplegangerRef.GetItemCount SE11ShadowBlade01 >= 1 ) SE11DopplegangerRef.EquipItem SE11ShadowBlade01 setAlert 1 elseif ( SE11DopplegangerRef.GetItemCount SE11ShadowBlade05 >= 1 ) SE11DopplegangerRef.EquipItem SE11ShadowBlade05 setAlert 1 elseif ( SE11DopplegangerRef.GetItemCount SE11ShadowBlade10 >= 1 ) SE11DopplegangerRef.EquipItem SE11ShadowBlade10 setAlert 1 elseif ( SE11DopplegangerRef.GetItemCount SE11ShadowBlade15 >= 1 ) SE11DopplegangerRef.EquipItem SE11ShadowBlade15 setAlert 1 elseif ( SE11DopplegangerRef.GetItemCount SE11ShadowBlade20 >= 1 ) SE11DopplegangerRef.EquipItem SE11ShadowBlade20 setAlert 1 elseif ( SE11DopplegangerRef.GetItemCount SE11ShadowBlade25 >= 1 ) SE11DopplegangerRef.EquipItem SE11ShadowBlade25 setAlert 1 elseif ( SE11DopplegangerRef.GetItemCount SE11ShadowBlade30 >= 1 ) SE11DopplegangerRef.EquipItem SE11ShadowBlade30 setAlert 1 endif endif if ( PrefersBlunt == 1 ) SE11DopplegangerRef.AddItem SE11LLDoppleGangerAxe 1 SE11DopplegangerRef.UnequipItem Torch02, 1 if ( SE11DopplegangerRef.GetItemCount SE11ShadowAxe01 >= 1 ) SE11DopplegangerRef.EquipItem SE11ShadowAxe01 setAlert 1 elseif ( SE11DopplegangerRef.GetItemCount SE11ShadowAxe05 >= 1 ) SE11DopplegangerRef.EquipItem SE11ShadowAxe05 setAlert 1 elseif ( SE11DopplegangerRef.GetItemCount SE11ShadowAxe10 >= 1 ) SE11DopplegangerRef.EquipItem SE11ShadowAxe10 setAlert 1 elseif ( SE11DopplegangerRef.GetItemCount SE11ShadowAxe15 >= 1 ) SE11DopplegangerRef.EquipItem SE11ShadowAxe15 setAlert 1 elseif ( SE11DopplegangerRef.GetItemCount SE11ShadowAxe20 >= 1 ) SE11DopplegangerRef.EquipItem SE11ShadowAxe20 setAlert 1 elseif ( SE11DopplegangerRef.GetItemCount SE11ShadowAxe25 >= 1 ) SE11DopplegangerRef.EquipItem SE11ShadowAxe25 setAlert 1 elseif ( SE11DopplegangerRef.GetItemCount SE11ShadowAxe30 >= 1 ) SE11DopplegangerRef.EquipItem SE11ShadowAxe30 setAlert 1 endif endif ;moves doppleganger to grove area SE11DopplegangerRef.UnequipItem Torch02, 1 SE11DopplegangerRef.moveto SE11bDopplegangerMarker ;SE11DopplegangerRef.evp set Tick to 3 elseif ( timer < 2 ) && ( tick == 3 ) set Tick to 4 elseif ( timer <= 0 ) && ( tick == 4 ) SE11bDopplegangerSpawnEffectRef.disable ;forces doppleganger to attack the player SE11DopplegangerRef.startcombat player SE11DopplegangerRef.moddisposition player -200 ;sets standing stone to inactive state set StandingStoneActivate to 0 setDestroyed 1 set Tick to -1 endif endif END BEGIN OnActivate if ( GetStageDone SE11 155 == 0 ) if ( isactionRef Player == 1 ) ;sets standing stone to active state set StandingStoneActivate to 1 set timer to 12 ;sets quest stage setstage SE11 155 endif endif END Link to comment Share on other sites More sharing options...
DrakeTheDragon Posted October 17, 2013 Share Posted October 17, 2013 I can't help you with the Papyrus scripting, because I'm still as unable to go on modding Oblivion or buy and even play Skyrim to begin with due to a massive lack of freetime as I was when it was first released 11/11/11, but I can help you de-complexify this oh-so-scary script you posted and the magic behind the doppelganger effect used in Shivering Isles back then,...oh and also for the famous Bruma Statue, in case you didn't know it was exactly the same thing as well but without doppelganger specialeffects and rendered immobile. If you take a look at what this script does and all the remarks given within, the whole magic easily boils down to one single function call, CreateFullActorCopy, and everything else is just either specialeffects, for sake of making the quest encounter more interesting, or undoing most of the stuff this incredibly powerful Vanilla game function did, as well as fixing most of the few documented inevitable drawbacks. In fact "player.CreateFullActorCopy" on its own does already create an exact doppelganger of the player. Everything else in this script is just... cosmetics, more or less. So, if there is a similar function to CreateFullActorCopy available in Papyrus as well, you're already set and good to go right away. Your doppelganger can already be created.The few cosmetics to create the appearance of a magic effect, or give the doppelganger some useful traits afterwards, I'm sure you'll be able to add in yourself without much trouble later then. Link to comment Share on other sites More sharing options...
Ironman5000 Posted October 17, 2013 Author Share Posted October 17, 2013 (edited) Awesome well this is good starting point, I might be able to swap this command with a line in a similar vanilla papyrus then :D Looking it and the unique effects nif used I assumed it was mostly aesthetic and didn't notice this command, neither would I have assumed it would work in skyrim papyrus. I'll play around with this then shouldn't be difficult if do it right, thanks! Edit: Shite. Selecting the papyrus script manager crashes my CK...typical.Edit: Fixed :) Edited October 17, 2013 by Ironman5000 Link to comment Share on other sites More sharing options...
Ironman5000 Posted October 17, 2013 Author Share Posted October 17, 2013 (edited) OK I have this but doesn't compile, not surprised as I said my skills n this area suck. Don't suppose this can be fixed? Scriptname I5KDoppelgangerScript extends activemagiceffect Event OnEffectStart(Actor caster, actor target) Player.CreateFullActorCopy EndEvent Output: Starting 1 compile threads for 1 files...Compiling "I5KDoppelgangerScript"...c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\I5KDoppelgangerScript.psc(5,0): variable Player is undefinedc:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\I5KDoppelgangerScript.psc(5,7): none is not a known user-defined typeNo output generated for I5KDoppelgangerScript, compilation failed. Batch compile of 1 files finished. 0 succeeded, 1 failed.Failed on I5KDoppelgangerScript EDIT: Had a look around and found what was supposedly a more correct template Scriptname I5KDoppelgangerScript extends activemagiceffect ActorBase property player auto Event OnEffectStart(Actor caster, actor target) Game.GetPlayer().CreateFullActorCopy (player,1) EndEvent Which gave an output stating "CreateFullActorCopy is not a function or does not exist" :psyduck: Edited October 17, 2013 by Ironman5000 Link to comment Share on other sites More sharing options...
IsharaMeradin Posted October 17, 2013 Share Posted October 17, 2013 Try this instead Scriptname I5KDoppelgangerScript extends activemagiceffect Actor Property PlayerRef Auto Event OnEffectStart(Actor caster, actor target) ActorBase Player = PlayerRef.GetBaseObject() as ActorBase PlayerRef.PlaceActorAtMe(Player,1) EndEvent There is no such command as CreateFullActorCopy. But by using PlaceActorAtMe you can spawn an actor that uses the same actorbase as the player. You may need additional scripting to change initial inventory, but that should create an actor near the player that looks like the player. Link to comment Share on other sites More sharing options...
Ironman5000 Posted October 17, 2013 Author Share Posted October 17, 2013 Try this instead Scriptname I5KDoppelgangerScript extends activemagiceffect Actor Property PlayerRef Auto Event OnEffectStart(Actor caster, actor target) ActorBase Player = PlayerRef.GetBaseObject() as ActorBase PlayerRef.PlaceActorAtMe(Player,1) EndEvent There is no such command as CreateFullActorCopy. But by using PlaceActorAtMe you can spawn an actor that uses the same actorbase as the player. You may need additional scripting to change initial inventory, but that should create an actor near the player that looks like the player.Thanks Ishara, well this one did compile but using it as a spell doesn't seem to be working. I might have missed something but I can't see what, I edited a vanilla summon magic effect, adding this as a new script, changed archetype to script. I changed nothing else and made a spell out of it but when it casts nothing happens apart form the Imod, which I am guessing might be because of a missing an associated item...unless this script negates the need for one? But there is no assoc. item to choose from. I tried again, opening the script properties and changing the ref cell to any and the ref to player but didn't change anything Link to comment Share on other sites More sharing options...
IsharaMeradin Posted October 17, 2013 Share Posted October 17, 2013 Ask Yoghurt how they did it.http://forums.nexusmods.com/index.php?/topic/1118065-cloning-player/ Link to comment Share on other sites More sharing options...
Ironman5000 Posted October 17, 2013 Author Share Posted October 17, 2013 Done it :) Link to comment Share on other sites More sharing options...
Recommended Posts