Jump to content

How do I make spell tomes?


Kolagon

Recommended Posts

What looks complicated? You can hardly make a shorter script and easier to reproduce.

 

To create the spells go in the magic menu, set your spell as a greater, lesser power or spell http://uesp.net/wiki/Oblivion:Magic_Overview

 

Open the merchant's inventory (choose one who sells spells in the vanilla game or create one) drag and drop the spells in his inventory.

Link to comment
Share on other sites

If I remember correctly, it should be possible to open the "spells" tab of an NPC (base object) and drag-and-drop the spells/powers into that one, the same way as you can drag-and-drop perks/abilities to NPCs. If that helps. I think there was a spells tab somewhere... but I could be wrong, would not be the first time. :blush:

 

As for whether an NPC will sell those spells... maybe. When I made a spell merchant (I suppose one can call them like that... :P), the NPC had to have a special class or something, or some flags ticked in his/her AI properties (the AI button in the NPC edit window) for any spells to appear for sale. Just like normal merchants. If you use an already existing NPC then there should not be any issues, at least in theory.

 

And to elaborate on the Spell Tome script: you can just use one script for each tome. For example if you had two spells:

  • YourPrefixSpellFastHealing
  • YourPrefixSpellHealingHands

And two spell tomes:

  • YourPrefixTomeFastHealing
  • YourPrefixTomeHealingHands

Without the use of OBSE, you could make one script for each tome (an object script would be the script type in the Construction Set script editor). I think a script with OnEquip block runs on the item itself and not the actor on which the item was equipped. In that case, you could use GetContainer to get the current container (the actor) and add the spell to that one (checking if the actor has the spell does not seem to be easy without OBSE).

 

For the first tome maybe something like this:

scriptname YourPrefixTomeFastHealingScript

; you can use a semicolon to write comments
; script for the fast healing spell tome

; this is a reference variable that points at game object/reference
ref Container

; this is an OnEquip script block that runs when this item (the item this script
; is attached to) is equipped on something
begin OnEquip
    ; GetContainer should return the current container, as in, the thing that has this
    ; item in its inventory - in this case, the actor that this was equipped on
    set Container to GetContainer
    ; AddSpell adds the spell to the actor
    Container.AddSpell YourPrefixSpellFastHealing
    ; the "end" defines the end of this script block
end

And for the second tome:

scriptname YourPrefixTomeHealingHandsScript

; script for the healing hands spell tome

ref Container

begin OnEquip
    set Container to GetContainer
    Container.AddSpell YourPrefixSpellHealingHands
end

I have not tested those, but maybe they can give you an idea of how to go about trying to make the tomes happen.

 

Hopefully that helps a bit. :thumbsup:

Link to comment
Share on other sites

If you have the spell and the corresponding spell tome item (a book, for example), you would need to create a new object script, add the necessary things in it, and attach the script to the book item. There should be plenty of items with scripts attached to them in the base game for reference. For example if you can find a book that, when opened, advances a quest, you could copy-paste the contents of the script on that book to your own script and change the quest advancement lines to lines that add the spell to whoever has equipped your book. The things above are examples of what a script attached to a spell tome could look like. They are identical, except for the comments in the first one, and different name as well as the spell to add.

 

There shold be some sort of scripting tutorials in the Construction Set wiki somewhere, I think. At least some sort of scripting tutorials.

Link to comment
Share on other sites

  • 3 years later...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...