Difference between revisions of "Portal:Scripting"

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search
imported>Qazaaq
m (that's a lot better)
imported>Bruneauinfo
m (→‎Scripting Basics: May be a better name for this concept.)
 
(39 intermediate revisions by 9 users not shown)
Line 1: Line 1:
__NOTOC__
==Overview==
'''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.


<div id="esstyle">
==Basic Tutorials==
<h2 class="header">Welcome to the Scripting Portal</h2>
 
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec tincidunt tempus neque. Morbi condimentum fermentum quam. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Etiam quis ipsum ac ante varius condimentum. Cras diam ipsum, cursus ut, molestie vitae, ullamcorper ut, nisl. Phasellus dignissim sem sed enim. In dolor ipsum, aliquam quis, fringilla at, pharetra eget, nisi. Vivamus tristique, arcu vel bibendum viverra, turpis massa gravida enim, vel viverra augue nulla ut nisl. Cras a turpis vitae ipsum aliquet mollis. Proin semper. Etiam vulputate, ante eget interdum ullamcorper, mi nulla porttitor felis, quis volutpat mi enim tincidunt nulla. Curabitur augue risus, volutpat at, rhoncus in, hendrerit quis, ante. Nullam ornare. Nullam eu sapien nec turpis ullamcorper commodo. Ut commodo diam nec pede. Praesent eget justo eget odio placerat auctor. Integer sit amet enim at erat luctus egestas.
<div id="esstyle" style="float: right; width: 40%;">
</div >


<div id="esstyle" style="width:333px;float:left;">
<h2 class="header">Featured</h2>
<h2 class="header">Featured</h2>
{{Portal:Scripting/Featured}}
[[Image:Scripttut2_testing2.JPG|thumb|right|The message box we wrote]]
==== My Second Script ====
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!
{{break}}
<div style="text-align:right; padding: 2px;">[[Scripting Tutorial: My Second Script|Read more...]]</div>
</div>
</div>


<div id="esstyle" style="width:333px;float:right;">
*[[Scripting Tutorial: My First Spell|My First Spell]] - With script effects.
<h2 class="header">Things you can do</h2>
*[[Scripting Tutorial: My Second Script|My Second Script]]
*Replace the [[:Category:Functions (CS 1.0)]] with <nowiki>[[Category:Functions CS]]</nowiki> on ~400 functions.
*[[Start Your Mod]]
*Discuss the future of the Wiki [http://www.bethsoft.com/bgsforums/index.php?showtopic=795927 right here]
*[[Scripting_Tutorial:_Creating_a_Simple_Timer|Creating a Simple Timer]]
</div>
*[[Scripting_Tutorial:_Modify_Weapon_On_Equip|Modify Weapon On Equip]]


<div id="esstyle" style="width:333px;float:right;">
==Functions==
<h2 class="header">Categories</h2>
* [[List of Functions|All Functions]]
*[[:Category:Scripting]]
** [[CS Functions]]
*[[:Category:Useful Code]]
** [[OBSE Functions]]
*[[:Category:Code Optimization]]
** [[Pluggy Functions]]
*[[:Category:Oblivion Script Extender]]
** [[TSFC Functions]]
</div>
*[[:Category: Functions|Function Categories]]


<div id="esstyle" style="width:333px;float:right;">
==General Knowledge==
<h2 class="header">Tutorials</h2>
*[[TES Files]] - Basic info about esp and esm files.
*[[Bound Arrows Tutorial]]
**[[Esp vs. Esm]] - Differences between esp and esm files.
*[[Casting Spells From An Activator]]
* [[Modding Terminology]] - Advanced discussion of modding terms.
*[[Combine your SI and non-SI mods into one (OBSE, Patch v1.1, Other mods too)]]
*[[:Category:Console Functions|Console Functions]] - Useful for playtesting.
*[[Getting started with TSFC]]
*[[Health Regeneration over Time]]
*[[MessageBox Tutorial]]
</div>


<div id="esstyle" style="width:333px;float:right;">
==Scripting Basics==
<h2 class="header">Related Portals</h2>
*[[Scripting Tutorial: Basic Scripting Knowledge|Basic Scripting Knowledge]]
*Portal:AI
*[[:Category:Commands|Commands]]
*Portal:Quests
*[[:Category:Variables|Variables]]
</div>
*[[If|Using "If" Conditions]]
* '''Types of Scripts'''
**[[Object scripts]]
**[[Quest scripts]]
**[[Global Scripts]]
**[[Magic effect scripts]]
*[[Script Processing]]
*[[Cross Script Variables]]


<div id="esstyle" style="width:333px;float:left;">
==Troubleshooting==
<h2 class="header">Troubleshooting</h2>
*[[Common Bugs]]
*[[Common Mistakes]]
*[[Common Mistakes]]
*[[Crashes]]
*[[Crashes]]
Line 48: Line 58:
*[[Performance Problems]]
*[[Performance Problems]]
*[[Debug Scripts]]
*[[Debug Scripts]]
</div>


<!-- to make sure the buttons don't do floating through the article -->
==Code Optimization==
<div style="clear:both"></div>
* [[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==
*[[Oblivion Script Extender]] - Oblivion scripting language extension.
*[[ESM Math Library]] - Math functions as stage function library.
*[http://www.uesp.net/wiki/Tes4Mod:Cobl/Modding Cobl] - Common Oblivion.
 
==Standard Solutions==
The following are standard solutions for solving various types of problems.
*[[Activation Functions]] - Simulating a function by means of a activate call.
*[[Combine your SI and non-SI mods into one (OBSE, Patch v1.1, Other mods too)|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]]
*[[Scripting Tutorial: Custom Bound Items|Custom Bound Items]]
*[[Distinguishing Between Physical and Magickal Hits]]
*[[GetActorType]] - Encode actor type (npc, creature, ghost, etc.) as a single number.
*[[Teleport Recall#Marker Rats|Marker Rats]] - Using hidden actors as stable marker points.
*'''Inventory'''
**[[DropAllItems|Drop All Items]]
**[[Generic Unequip]] - Remove an object from inventory without specifying its object id.
**[[Unplayable Items]] - Various uses of unplayable items.
** [[Walking Through Inventory Items]]
*'''Math Functions'''
**[[:Category:Extra Math Functions|Extra Math Functions]]
**[[:Category:Math Functions (OBSE)|OBSE Math Functions]]
*'''Messagebox Menus'''
**[[MessageBox Tutorial]] - Complicted messagebox and menu structures.
** [[Standard Menu UI]] - Menu triggers, options menus, hierarchical menus, number configuration, etc.
*[[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.
** [[Simulating new functions|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'''
** [[Text Input With OBSE]] - Simulating a text input box (OBSE).
** [[Text Input With Pluggy]] - [[:Category:Pluggy|Pluggy]] based text input.
** [[Text Input With TSFC]] - [[:Category:TSFC|TSFC]] based text input.
 
==Deprecated Articles==
*[[Dynamic Storage]] - General survey of arrays, linked lists, etc. in pre-pluggy world.
**[[Linked List Tutorial]] - Pre-pluggy approach to linked lists.

Latest revision as of 12:53, 30 December 2010

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]

Featured

File:Scripttut2 testing2.JPG
The message box we wrote

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!

Functions[edit | edit source]

General Knowledge[edit | edit source]

Scripting Basics[edit | edit source]

Troubleshooting[edit | edit source]

Code Optimization[edit | edit source]

Extensions and Libraries[edit | edit source]

Standard Solutions[edit | edit source]

The following are standard solutions for solving various types of problems.

Deprecated Articles[edit | edit source]