Difference between revisions of "Category:Pluggy"

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search
imported>Haama
imported>Speedo
(Added note about ArrayID's)
Line 56: Line 56:
*Arrays have indexes from 0 to (array size - 1). The array size is set when you first create the array and can be modified with [[ArraySize]].
*Arrays have indexes from 0 to (array size - 1). The array size is set when you first create the array and can be modified with [[ArraySize]].
*There are 3 '''SetInArray''' and '''FindInArray''' functions: one for integers, one for floats, and one for references.
*There are 3 '''SetInArray''' and '''FindInArray''' functions: one for integers, one for floats, and one for references.
*Unlike [[Reference Variables]] or [[:Category: TSFC|TSFC]] StringID's, 0 is a valid ArrayID for Pluggy arrays.  If you wish to test a variable for a valid ArrayID, use the function [[ArrayCount]].
**While various Pluggy functions are capable of checking the validity of an ArrayID, [[ArrayCount]] is recommended since it does not have the potential to alter the array if used incorrectly.


[[Category: OBSE Plug-Ins]]
[[Category: OBSE Plug-Ins]]
[[Category: Functions]]
[[Category: Functions]]
[[Category: Functions (OBSE)]]
[[Category: Functions (OBSE)]]

Revision as of 12:54, 19 February 2008

Pluggy (latest version is Beta v30) is a plugin for OBSE that provides functions to create, store, and manipulate single-dimension arrays.

Download and Discussion Thread

Pluggy in the Bethesda Forums (Oblivion Mods)

What is an array?

You can think of a single-dimension array as an expandable piece of lined paper. Each line contains a bit of information. In Oblivion's case, the line can either be empty, a reference, an integer (long), or a float. Each line is called an index, and they start with 0.

An example array:

Index Info in index Type of info in index
Index 0 --- Empty
Index 1 0000000F (Gold) Reference
Index 2 658 Long
Index 3 4.563 Float

Where are the arrays stored?

  • The arrays are stored in separate .pluggy files.
  • A .pluggy file is created whenever the game is saved and there are arrays in use.
  • Each .pluggy file corresponds to it's save game file.
  • If all arrays are destroyed, or all mods that use the arrays are deactivated, the .pluggy file will be deleted.
  • The files are incredibly small - only 9 bytes per non-empty array index.

How much space and memory do the arrays take?

  • Memory (in-game) - 4 bytes per empty array index and 9 bytes per filled array index
  • HDD space - 9 bytes per filled array index

How fast are the functions?

  • Not fully tested, but running 900 Pluggy "Find" calls only took half a second while 900 GetInventoryObject calls took 10 seconds. In short, these are incredibly fast functions.

Some peculiarities (compared to other Oblivion functions)

  • Most Pluggy functions can be used to both return and set a value. This is determined by an optional flag - if it's left empty the value will be returned and if it's filled the value will be set to that flag.
    • For example, ArraySize 0 will return the size of Array 0 while ArraySize 0 10 will set Array 0's size to 10 indexes.
  • Each array is associated with a mod (either Esp or Esm). If the mod is removed then the array will be removed once the player saves.
    • There is also a system to prevent other mods from accidentally modifying your arrays and to prevent other mods from modifying your arrays.
      1. To modify an array from another mod the modder will need to include a special Global flag to their function.
      2. If you want to prevent any other mod from modifying your arrays, add a special Protection flag when you create it or set it later with ArrayProtect
      3. Note that other mods will be able to look at your array regardless of Protection or Global flags.
      4. The corresponding mod for each array can be changed with ArrayEsp.
  • Arrays have indexes from 0 to (array size - 1). The array size is set when you first create the array and can be modified with ArraySize.
  • There are 3 SetInArray and FindInArray functions: one for integers, one for floats, and one for references.
  • Unlike Reference Variables or TSFC StringID's, 0 is a valid ArrayID for Pluggy arrays. If you wish to test a variable for a valid ArrayID, use the function ArrayCount.
    • While various Pluggy functions are capable of checking the validity of an ArrayID, ArrayCount is recommended since it does not have the potential to alter the array if used incorrectly.

Subcategories

This category has the following 5 subcategories, out of 5 total.

A

F

H

S