Help - Search - Members - Calendar
Full Version: Script Help?
The Nexus Forums > Specific Games > Oblivion > Oblivion Modifications > General Mod Talk
tnu
i was wondering if anyone could give me a script to apply to a book thats similer to Spell Tomes book scripts but with some extras. checks to see if you already have the spells provided by the script. and for it to loop so it initiates every time you opent he book
tyreil829
still looking for a fix for it?

LTD might know if he is around

Col John Sheppard
tnu
right if anyone can help me with that fix the main post is actually about a page down
LoginToDownload
I never downloaded Spell Tomes, but basically you open a book and a spell is given, right? Any particular reason why you want a check for if the player already has the spell, or just clean scripting? AddSpell doesn't actually do anything if the player already has the spell.
tnu
yeah i just want the powers added to the player whenever he reads the book. i'm just looking for a way to fix the bug of the vanishing spells in the older Toaster Says Share and Recruit
LoginToDownload
In that case, the script should go...

CODE
scn MySpellbookScript

Begin OnActivate
     AddSpell MySpell
    ;Repeat for other spells if necessary
end

Begin OnEquip
     AddSpell MySpell
    ;Repeat for other spells if necessary
end


OnActivate runs when the book is activated in the world, and OnEquip when you select the book in your inventory.

tnu
ok thanks a bunch but how do i attatch the script to the book? and does addspell work on powers too?

EDIT: Oh and do i use the spells Base or Ref ID?

EDIT: i tried it and it said nested sotmhign blocks arnt allowd what did i do wrong?
darkninjaproductions
you use the spell Ref ID.
you find the book you want in the CS and then open up its properties and click drop down menu and select the script.


there is the window that should pop up.
what do you mean by powers ?
cus if you mean skills then yes
CODE
player.ModActorValue "(Replace with skill)"

and this will boost your skill.

so in theory you will have something like this.

CODE
scn MySpellbookScript

Begin OnActivate
     AddSpell MySpell
     player.ModActorValue "skill"
   ;Repeat for other spells/skills if necessary
end

Begin OnEquip
     AddSpell MySpell
     player.modactorvalue "skill"
   ;Repeat for other spells/skills if necessary
end
tnu
no by powers i mean greater and Lesser powers that are also present int he spellbook but not considerd spells

EDIT still what did they mean "Nested Begin/end blocks are not allowd"?
darkninjaproductions
just make shore there is a gap between begin and wat follows and between end and whatever is b4 it.
LoginToDownload
Make sure that the structure of the Begin/End blocks goes...

Begin
Do Stuff
End

Begin
Do Stuff
End, instead of something like...

Begin
Do Stuff
Begin
Do Stuff
End
End. AddSpell does work on Greater and Lesser powers, and incidentally Abilities and Diseases. In fact, they're all (including actual spells) subtypes of the Spell. To attach the script to your book, open up the book in the Object window and select your script from the drop-down box labeled "Script", just below the ID.
tnu
does that include the two begins that exist in the two diffrent parts of the script? its listed above
LoginToDownload
Yup. You have to end the first before beginning the next.
tnu
ok now i'm confused. how do i add powers? i'm tryign to have the book add some lesser powers
LoginToDownload
You add powers as if they were spells. AddSpell VampDisease, (Porphyric Hemophilia) AddSpell BSMage, (Mage Birthsign Attributes) AddSpell lpRaceKhajiitNighteye (Eye of Night Lesser Power), and AddSpell StandardFireDamageTarget1Novice (Flare Spell) are all equally valid.
tnu
ok i'll see how this works
tnu
ok this script isnt working. I keep getting this messege



line 9 Nested Begin/end blocks are not allowd
LoginToDownload
Can you copy the exact script you use? The example doesn't turn up any errors in my CS...
tnu
scn ToasterSpellBookScript

Begin OnActivate
AddSpell 1toastcrybattle.
AddSpell 1toastmenuspell
AddSpell 1toastpowerofhate
AddSpell 1toastpowerofsharing

Begin OnEquip
AddSpell 1toastcrybattle
AddSpell 1toastmenuspell
AddSpell 1toastpowerofhate
AddSpell 1toastpowerofsharing

end
LoginToDownload
Yup. You're missing an "end". As is, it goes Begin Begin End. Add another end a line above Begin OnEquip and you should be golden.
tnu
thanks but i give up i cant get this fix working
ihateregisteringeverywhere
And I held so much faith in you... sad.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.