Talk:Scripting Tutorial: My First Spell

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search

Good to see more tutorials coming together. When working on a project I like to set Oblivion to run in windowed mode by full screen more to 0 in Oblivion.ini. While you can't make changes in real-time, it does help you to spot fix problems and refer to scripts and settings without having to quit out of the game entirely. JBurgess 09:21, 8 April 2006 (EDT)

That's a good idea. I'll modify the tutorial. I'm not sure my poor computer could handle running Oblivion and the CS at the same time though :) Mrflippy 15:54, 8 April 2006 (EDT)

How would I do this exact same function, but with a one-time use scroll instead? I have tried everything to make a scroll. But in my testing, unable to get it into my inventory using additem or addspell. --Brainspackle 04:04, 9 April 2006 (EDT)

RemoveAllItems[edit source]

Do you really want to use RemoveAllItems?

That seems a little drastic. Would that not cause the player's inventory to become blank when the spell is cast? If not, what does it do?

Callie 15:30, 12 April 2006 (EDT)

--Mrflippy 15:35, 12 April 2006 (EDT): Yes, that's what it does. This was a simple script example, and I wanted to do something interesting without going into spawning dynamic containers and returning the objects back to their rightful owners and all that. I don't even know if there's a way to make the NPCs reequip everything once they get it back. Maybe I should change the effect or put in a warning.

Query[edit source]

Hey this is a great explanation:

but what i don't understand are the small things, such as where to start a new line and why there are spaces where there are spaces.

but anyway, i would like to create a spell that summons three NPC's or creatures at once. and i would like this spell to be added to the players spell repetoire upon the equipping of a ring. How would i go about doing this?

any tips, guidelines or tutorial scripts would be greatly appreciated..

thanks, Luis

Small problem[edit source]

I made my simple spell. 100 fire damage and area 100. So it definitely should work. Then I saved it as a plugin, opened Oblivion launcher and checked my plugin from the Data Files. Once I get into the game, I type "player.addspell 01000CE8" into console, but I don't get my spell. Yes. I have checked that my spells Form ID is 01000CE8.

Are you sure the new plugin and Oblivion.esm are the only entries checked in the plugin list?
--Qazaaq 07:15, 20 April 2008 (EDT)
The first two digits of a FormID are the mod's index. Because when you load your mod in the CS, only it and Oblivion.esm are loaded, it gets 01 (Oblivion.esm gets 00). But when you load your plugin for a game, most likely that is not true (unless it was the only thing loaded with Oblivion.esm), so you have to figure out your mod index.
The mod index is a hexadecimal number representing the mod's place in the load order. Both Wrye Bash and OBMM offer ways of determining mod index. In Wrye Bash, it's the column next to the file name. In OBMM, simply hover your mouse over the .esp in the list on the left momentarily to get the Author, Description, and Mod Index. Then simply use "player.addspell ##000CE8", where ## is your mod index.
Dragoon Wraith TALK 08:37, 20 April 2008 (EDT)

The second digit in the Editor-ID could be also a character instead (A-?) in the game console.

Both digits are hexadecimal numbers, so A-F are also 'numbers' in this case. They correspond to 11-15, so '10' in hexadecimal really means '16' (in the regular decimal system):
00   00  Oblivion.esm
01   01  first optional mod file
02   02
03   03
04   04
05   05
06   06
07   07
08   08
09   09
0A   10
0B   11
0C   12
0D   13
0E   14
0F   15
10   16
  ...  
FD  253
FE  254  last mod file
FF  255  save file
I hope that explains things.
Also, please create your own account for the Wiki - using BugMeNot completely defeats the purpose of having accounts in the first place. Once you have your own account, please sign your comments in Talk pages with ~~~~.
Dragoon Wraith TALK 12:54, 15 November 2008 (EST)