Overview[edit | edit source]
Scripts are used by modders to control the game in fairly direct ways and achieve effects that are far outside the normal scope of the game. If you're new to scripting, you should start at the top of the page, especially with the tutorials. If you're an experienced scripter, then the later parts of the page should be most useful.
Basic Tutorials[edit | edit source]
My Second Script[edit | edit source]
While the My First Script tutorial is a good first taste of scripting for Oblivion, it does not appreciably demonstrate what the scripting language in Oblivion can do. It is a wonderful introduction for those who have never seen a programming or scripting language before, but a more in-depth tutorial would be helpful to further introduce modders to this amazing resource.
This tutorial has been largely adapted from GhanBuriGhan's excellent Morrowind Scripting for Dummies; all credit goes to GhanBuriGhan for his fantastic work on the original.
This tutorial is meant to be a more complete introduction to scripting for Oblivion than the My First Script tutorial, and assumes that the reader is already familiar with My First Script. If you do not understand the main points of that tutorial, you may find yourself in over your head here. If you're comfortable with My First Script, though, let's begin scripting!
- My First Spell - With script effects.
- My Second Script
- Start Your Mod
- Creating a Simple Timer
- Modify Weapon On Equip
Functions[edit | edit source]
General Knowledge[edit | edit source]
- TES Files - Basic info about esp and esm files.
- Esp vs. Esm - Differences between esp and esm files.
- Modding Terminology - Advanced discussion of modding terms.
- Console Functions - Useful for playtesting.
Scripting Basics[edit | edit source]
- Basic Scripting Knowledge
- Using "If" Conditions
- Types of Scripts
- Script Processing
- Cross Script Variables
Troubleshooting[edit | edit source]
Code Optimization[edit | edit source]
- CPU-usage of Functions - Lists of functions and their effects on performance; notes on which drop FPS the most, etc.
- Minimizing your Script - Tips to keep the number of functions used down, how often sections of your script run, and more.
- Script Comparison Tests - Comparisons of script snippets and/or functions.
Extensions and Libraries[edit | edit source]
- Oblivion Script Extender - Oblivion scripting language extension.
- ESM Math Library - Math functions as stage function library.
- Cobl - Common Oblivion.
Standard Solutions[edit | edit source]
The following are standard solutions for solving various types of problems.
- Activation Functions - Simulating a function by means of a activate call.
- Adaptive Mods - Adjust a mod for presence or absence of SI, OBSE, Patch v1.1, etc.
- Dynamically Adding Spells to Merchants
- Casting Spells From An Activator
- Custom Bound Items
- Distinguishing Between Physical and Magickal Hits
- GetActorType - Encode actor type (npc, creature, ghost, etc.) as a single number.
- Marker Rats - Using hidden actors as stable marker points.
- Math Functions
- Messagebox Menus
- Programmable Spell Effects - Beyond scripted spell effects.
- Reference Variables for Nearby Actors
- Remote Activators - Uses of activating remote objects.
- Rotating an object around another object with a script
- Running Scripts On Arrows
- Category:Stage Functions - Simulating a function by means of a setStage call.
- Stages Functions - (Needs to be merged with base article.)
- Summon Object - Summon (move) an existing object to position in front of player.
- Teleport Recall - Establishing a teleport recall point.
- Text Input