Inventory system commands

Last Updated: September 16, 2000

 

 

All of the inventory system information is stored in scripts/inventory.txt.

In the game, to bring it up, the cmd is "inventory."  To reload the file, type "inv_restart"

 

Overview

 

The inventory is three tiered.  The first tier is the list of item types.  Each of these has three shaders - a normal shader, a hover shader, and a selected shader

 

The hover shader is shown when the mouse is over the type

The selected shader is shown when the type is selected but the user is browsing weapons

The normal shader is shown when neither of the above two are.

 

The types all have the same width and height.

 

When a type is selected, on the right comes all the weapons (or ammo types) represented by models.  Each of these models can be moved around or scaled.  In addition, when the models are selected, they are brightened a bit and can either spin or bob at variable amounts.  When an item is selected, a context menu pulls out to the right showing the actions that can be taken on the item.  Right now, these are "Use," "Dual," "Left," and "Right."  A programmer would need to change these.

 

When a user selects "Use" or "Dual," "use <itemname>" is stuffed to the console.  When left is selected, "use <itemname> 1" is stuffed, when right is selected "use <itemname> 0" is stuffed.

 

Types:

string

A text string.  If you want it to have spaces, put it in quotes

number

An integer

float

A floating point number (number with decimals)

vector

Three floats in quotes, like: ”0 20 21.3”

 

Script commands:

 

 

The following script commands can be issued at any time in the inventory script:

inv_width <number>, inv_height <number>

Sets the width and height of each inventory type

{, }

These  can be used to organize sections, but serve no functional purpose.

typedef  <string>

Begins a new type.  The string can be anything, and is used only as a convenience to the programmers and the person writing the inventory script, it has no real meaning in the game

The following commands can only be issued after a typedef command

and are associated with that type:

button_shader <string>

The normal shader associated with the type of the first tier of the inventory

sel_shader <string>, hover_shader <string>

The selected and hover shaders, respectively, for the type (displayed in the first tier)

bg <string>

Specifies the background shader for the list of items in the second tier

bg_tile

If this line is there, the background shader above will be tiled

 

width <number>, height <number>

The default width/height for all items in this type (on the 2nd tier of the inventory)

item <string>

You’re about to describe an item in this type (example: sword).  <string> is the internal name of the item that the game uses (the name passed to “use” at the console).  You should ask a programmer what this name is, it is not just an arbitrary name you can make up

 

The following commands can only be issued after an item command, and are associated with that item:

 

width <number>, height <number>

The width/height for this item only.  It doesn’t change the default width/height for items of this type

 

equip <string>, [string],

Ways you can equip this item.  Various strings can be left, right, dual, or use.  Examples of use:
equip use
equip dual
equip left right
equip left

 

model <string>

Specifies the TIKI file to use for this item

angles <vector>

Angles to rotate the model all the time

 

offset <vector>

Offset to move the model all the time

scale <float>

Scale of the model all the time

move <string>

How the item will move when it’s selected.  Either bob or spin.

 

angledeltas <vector>

Which way to spin or bob and how fast ( deltas of “10 0 0” will spin or bob slower than “20 0 0”.  Higher numbers also make it bob farther.

 

rotateoffset <vector>

Offset of origin to rotate or bob about in the model