dewdropcat Posted November 8, 2017 Share Posted November 8, 2017 (edited) So I have a mod idea that will allow the player to gain access to every spell in the game just by reading a specific spell tome. I just can't figure out how to make it so I can put more than one spell on the book. Any ideas are welcome. Edited November 8, 2017 by dewdropcat Link to comment Share on other sites More sharing options...
greyday01 Posted November 8, 2017 Share Posted November 8, 2017 Script with an onread event then run down the list of spells adding each to the player? Link to comment Share on other sites More sharing options...
dewdropcat Posted November 8, 2017 Author Share Posted November 8, 2017 What would the script be for that? I am quite new to scripting and modding in general. Link to comment Share on other sites More sharing options...
dewdropcat Posted November 8, 2017 Author Share Posted November 8, 2017 I tried this script but it didn't work. My character didn't gain anything from it. How can I fix this? Event OnRead() Debug.Trace("You feel as though your knowledge of magic has been expanded greatly") Game.GetPlayer().AddSpell(BaneoftheUndead) Game.GetPlayer().AddSpell(BanishDaedra) Game.GetPlayer().AddSpell(Blizzard) Game.GetPlayer().AddSpell(BoundBattleAxe) Game.GetPlayer().AddSpell(BoundBow) Game.GetPlayer().AddSpell(BoundSword) Game.GetPlayer().AddSpell(CallToArms) Game.GetPlayer().AddSpell(Calm) Game.GetPlayer().AddSpell(Candlelight) Game.GetPlayer().AddSpell(ChainLightning) Game.GetPlayer().AddSpell(CircleOfProtection) Game.GetPlayer().AddSpell(Clairvoyance) Game.GetPlayer().AddSpell(CloseWounds) Game.GetPlayer().AddSpell(CommandDaedra) Game.GetPlayer().AddSpell(ConjureDremoraLord) Game.GetPlayer().AddSpell(ConjureFamiliar) Game.GetPlayer().AddSpell(ConjureFlameAtronach) Game.GetPlayer().AddSpell(ConjureFrostAtronach) Game.GetPlayer().AddSpell(ConjureStormAtronach) Game.GetPlayer().AddSpell(Courage) Game.GetPlayer().AddSpell(DeadThrall) Game.GetPlayer().AddSpell(DetectLife) Game.GetPlayer().AddSpell(DetectDead) Game.GetPlayer().AddSpell(Dragonhide) Game.GetPlayer().AddSpell(DreadZombie) Game.GetPlayer().AddSpell(Ebonyflesh) Game.GetPlayer().AddSpell(ExpelDaedra) Game.GetPlayer().AddSpell(FastHealing) Game.GetPlayer().AddSpell(Fear) Game.GetPlayer().AddSpell(Fireball) Game.GetPlayer().AddSpell(Firebolt) Game.GetPlayer().AddSpell(FireRune) Game.GetPlayer().AddSpell(FireStorm) Game.GetPlayer().AddSpell(flameCloak) Game.GetPlayer().AddSpell(Flames) Game.GetPlayer().AddSpell(FlameThrall) Game.GetPlayer().AddSpell(Frenzy) Game.GetPlayer().AddSpell(Frostbite) Game.GetPlayer().AddSpell(FrostCloak) Game.GetPlayer().AddSpell(FrostRune) Game.GetPlayer().AddSpell(FrostThrall) Game.GetPlayer().AddSpell(Fury) Game.GetPlayer().AddSpell(GrandHealing) Game.GetPlayer().AddSpell(WardGreater) Game.GetPlayer().AddSpell(GuardianCircle) Game.GetPlayer().AddSpell(Harmony) Game.GetPlayer().AddSpell(Healing) Game.GetPlayer().AddSpell(HealingHands) Game.GetPlayer().AddSpell(HealOther) Game.GetPlayer().AddSpell(Hysteria) Game.GetPlayer().AddSpell(IceSpike) Game.GetPlayer().AddSpell(IceStorm) Game.GetPlayer().AddSpell(IcySpear) Game.GetPlayer().AddSpell(Incinerate) Game.GetPlayer().AddSpell(Invisibility) Game.GetPlayer().AddSpell(IronFlesh) Game.GetPlayer().AddSpell(WardLesser) Game.GetPlayer().AddSpell(LightningBolt) Game.GetPlayer().AddSpell(LightningCloak) Game.GetPlayer().AddSpell(LightningStorm) Game.GetPlayer().AddSpell(Magelight) Game.GetPlayer().AddSpell(MassParalysis) Game.GetPlayer().AddSpell(Mayhem) Game.GetPlayer().AddSpell(Muffle) Game.GetPlayer().AddSpell(Oakflesh) Game.GetPlayer().AddSpell(Pacify) Game.GetPlayer().AddSpell(Paralyze) Game.GetPlayer().AddSpell(RaiseZombie) Game.GetPlayer().AddSpell(Rally) Game.GetPlayer().AddSpell(ReanimateCorpse) Game.GetPlayer().AddSpell(RepelLesserUndead) Game.GetPlayer().AddSpell(RepelUndead) Game.GetPlayer().AddSpell(Revenant) Game.GetPlayer().AddSpell(Rout) Game.GetPlayer().AddSpell(ShockRune) Game.GetPlayer().AddSpell(SoulTrap) Game.GetPlayer().AddSpell(Sparks) Game.GetPlayer().AddSpell(WardSteadfast) Game.GetPlayer().AddSpell(Stoneflesh) Game.GetPlayer().AddSpell(StormThrall) Game.GetPlayer().AddSpell(Telekinesis) Game.GetPlayer().AddSpell(Thunderbolt) Game.GetPlayer().AddSpell(TransmuteOreMineral) Game.GetPlayer().AddSpell(TurnGreaterUndead) Game.GetPlayer().AddSpell(TurnLesserUndead) Game.GetPlayer().AddSpell(TurnUndead) Game.GetPlayer().AddSpell(WallOfFlames) Game.GetPlayer().AddSpell(WallOfFrost) Game.GetPlayer().AddSpell(WallOfStorms) Game.GetPlayer().AddSpell(Waterbreathing)endEvent Link to comment Share on other sites More sharing options...
FrankFamily Posted November 8, 2017 Share Posted November 8, 2017 (edited) And have you made and filled properties for all those spells? You'd write them like this: Spell Property WhateverName AutoOne property for each spell, and then fill them in the property window, if you name them as the forms (like you seem to have in the code) then you can click the Auto-Fill button. So you'll have something like this: Scriptname....... Spell Property BaneOfTheUndead Auto Spell Property BanishDaedra Auto etc Event OnRead() Debug.Trace("You feel as though your knowledge of magic has been expanded greatly") Game.GetPlayer().AddSpell(BaneoftheUndead) Game.GetPlayer().AddSpell(BanishDaedra) etc EndEvent Edited November 9, 2017 by FrankFamily Link to comment Share on other sites More sharing options...
dewdropcat Posted November 9, 2017 Author Share Posted November 9, 2017 And have you made and filled properties for all those spells? You'd write them like this: Spell Property WhateverName AutoOne property for each spell, and then fill them in the property window, if you name them as the forms (like you seem to have in the code) then you can click the Auto-Fill button. So you'll have something like this: Scriptname....... Spell Property BaneOfTheUndead Auto Spell Property BanishDaedra Auto etc Event OnRead() Debug.Trace("You feel as though your knowledge of magic has been expanded greatly") Game.GetPlayer().AddSpell(BaneoftheUndead) Game.GetPlayer().AddSpell(BanishDaedra) etc EndEventWhenever I try to add a property, I get an errorStarting 1 compile threads for 1 files...Compiling "newscript"...C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\NewScript.psc(1,0): missing SCRIPTNAME at 'Spell'C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\NewScript.psc(1,6): required (...)+ loop did not match anything at input 'Property'C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\NewScript.psc(1,35): mismatched input '\\r\\n' expecting STATEC:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\NewScript.psc(185,13): script property NewProperty already definedC:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\NewScript.psc(185,13): script variable ::NewProperty_var already definedC:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\NewScript.psc(185,13): script property NewProperty already has a get function definedC:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\NewScript.psc(185,13): script property NewProperty already has a set function definedC:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\NewScript.psc(0,0): filename does not match script name: spellNo output generated for newscript, compilation failed. Batch compile of 1 files finished. 0 succeeded, 1 failed.Failed on newscript Link to comment Share on other sites More sharing options...
nerdofprey Posted November 9, 2017 Share Posted November 9, 2017 I don't know if it's just me reading that wrong, but do you actually have "NewScript" in there instead of the name of your script, and "NewProperty" instead of the names of the spells? Cause that would definitely be a major problem... Link to comment Share on other sites More sharing options...
foamyesque Posted November 9, 2017 Share Posted November 9, 2017 A much simpler piece of script would pull them from a formlist: FormList Property SpellList Auto Event OnRead() if !SpellList return endif Actor PlayerRef = Game.GetPlayer() if !PlayerRef return endif int i = SpellList.GetSize() while i > 0 i-=1 Spell testSpell = SpellList.GetAt(i) if testSpell PlayerRef.AddSpell(testSpell) endif endwhile EndEvent This way you only require one property, a formlist that contains every spell you want to add. Link to comment Share on other sites More sharing options...
dewdropcat Posted November 10, 2017 Author Share Posted November 10, 2017 A much simpler piece of script would pull them from a formlist: FormList Property SpellList Auto Event OnRead() if !SpellList return endif Actor PlayerRef = Game.GetPlayer() if !PlayerRef return endif int i = SpellList.GetSize() while i > 0 i-=1 Spell testSpell = SpellList.GetAt(i) if testSpell PlayerRef.AddSpell(testSpell) endif endwhile EndEvent This way you only require one property, a formlist that contains every spell you want to add.So, I'm new at coding. I tried to do a property but it didn't work when I tested it. Link to comment Share on other sites More sharing options...
foamyesque Posted November 10, 2017 Share Posted November 10, 2017 A much simpler piece of script would pull them from a formlist: FormList Property SpellList Auto Event OnRead() if !SpellList return endif Actor PlayerRef = Game.GetPlayer() if !PlayerRef return endif int i = SpellList.GetSize() while i > 0 i-=1 Spell testSpell = SpellList.GetAt(i) if testSpell PlayerRef.AddSpell(testSpell) endif endwhile EndEvent This way you only require one property, a formlist that contains every spell you want to add.So, I'm new at coding. I tried to do a property but it didn't work when I tested it. Okay, so to fill properties, there'll be a 'fill properties' button next to the script window. It will allow you to select any of the appropriate forms to fill into the property, which will then pass the information to the game when the script actually gets called. Link to comment Share on other sites More sharing options...
Recommended Posts