Difference between revisions of "Base Objects vs References"

1,539 bytes added ,  20:45, 12 February 2011
Major revision
imported>Quetzilla
(New page: =Under Construction= When starting (or re-starting) with scripting with OBSE, you are very likely to come upon the concepts of '''Base Objects''' and '''References'''. Both can be stored...)
 
imported>QQuix
(Major revision)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
=Under Construction=
When starting modding, you pretty soon will come upon the concepts of '''''"Base Objects"''''' and '''''"References"'''''.  This page provides an introductory view of what they are. For a more complete explanation, read the [[Modding Terminology]] article.


When starting (or re-starting) with scripting with OBSE, you are very likely to come upon the concepts of '''Base Objects''' and '''References'''.  Both can be stored in [[reference variables]] but there are important differences.  This page will explain each, as well as how to use them with regard to OBSE functions.


==Overview==
'''Base Objects''' include everything listed in the [[Object Window]], as well as several things that can be accessed from the top menus of the Construction Set (such as Race, Hair, Magic Effects, etc.).  A '''base object''' can ''never'' be found in the world while playing Oblivion.


Every object found in the world while playing (including NPCs, plants, bridges, and other things) is a '''reference'''. '''References''' are instances of '''base objects''' that have been placed in the world either directly in the Construction Set, or by scripts.
==Base Objects==
Base Objects are like a blueprint. They are used to create actual objects and they can never be found in the world while playing Oblivion.


==Use in Scripting==
Base Objects contain whatever data is common to all objects derived from it, for example, the Apple Base Objects holds everything common to all Apples in the game, like its name and nif.  
Prior to OBSE, every function in the scripting language that returned an object that could be stored in a [[Reference Variables|reference variable]] returned a '''reference''', that is, they returned an object that existed in the world.


OBSE adds functions that allow you to use and manipulate the '''base objects''' from which items in the world have been created. Many functions return the '''base objects''' themselves which can then be stored in [[reference variables]]
If you change anything in the base form, the change applies to all instances of that object, for example, if you change the nif of the Apple Base Object to a banana nif, all apples in the game will turn into bananas.
 
Base Objects include everything listed in the [[Object Window]]. Open them to check which information each type of Base Object contains. For example, an NPC Base Object contains things like Race, Stats, and Face while a Container Base Object determines its initial contents and whether it respawns or not. If you change any of this data, either directly editing the object window or by script, ALL instances of that object in the game will be affected.
 
Some properties are present in most base Objects, like FormID, EditorID, Name and Script.
 
Base Objects are also called Base Forms or Base Records and, technically, several other things in the game are also Base Forms, like things that can be accessed from the top menus of the Construction Set (such as Race, Hair, Magic Effects, etc.). 
 
==References==
Every object found in the world while playing (including NPCs, plants, bridges, and other things) is a '''''reference'''''.  References are instances of Base Objects that have been placed in the world either directly in the Construction Set, dropped from inventories or by scripts.
 
The word "Reference" is also used referring to the Form or Record where the game keeps the data related to the reference (the object in game). For this article let's use "Reference" (capitalized) when referring to the Form, and "reference" when referring to the object.
 
The Reference contains all the information related to a particular reference, like its XYZ position and angle, EditorID, FormID, scale, etc. Different types of References keep different information, for example a Door Reference keeps the lock state and the teleport destination of that particular door, while a Container Reference will register the current contents of the container reference.
 
To see the information stored in each type of Reference, open the Reference Window, by either double-clicking on an object in the [[Render Window]] or choosing "Edit" after right-clicking on an object in the right panel of the [[Cell View Window]].
 
 
==See Also==
*[[Modding Terminology]]
*[[Reference]]
*[[Reference Variables]]
 
[[Category:Getting Started]]
Anonymous user