File: POLsys.em
Description: Functions to access POL system data.
Last Modified: 6/18/2003
GetItemDescriptor(objtype) | |
---|---|
Parameters: | |
Name | Type |
objtype | int Objtype OR string ObjtypeName |
Explanation | |
Returns a struct of all itemdesc.cfg properties for the objtype. | |
The keys are the property names, i.e. "Color", "Desc", etc. The values can be String, Integer, Real. The exceptions are "CProps" and "StackingIgnoresCProps". "CProps" is a dictionary where the CProp name is the key, and the value can be any packable type (i.e. array, struct, etc.). "StackingIgnoresCProps" is an array of strings. | |
The primary use of this function is to pass it to any of the item creation functions, and the values in the struct will be used in place of the static itemdesc.cfg values. Use it to assign specific properties to an item during creation, rather than after. This allows easier stacking with existing item stacks. | |
Note not all properties can be assigned per-item, so editing the value in the descriptor struct will not be passed to the new item. | |
//For example, to stack with an existing stack with color 0x10 and cprop use uo; use polsys; program testdesc(who,objtype) var ret := GetItemDescriptor(CInt(objtype)); ret.Color := 0x10; ret.CProps.insert("blah","1"); //assuming the existing stack have this color and cprop ret.StackingIgnoresCProps.append("blingbling"); var item := CreateItemInBackpack(who,ret,10); if(item) print("OK!"); endif endprogram | |
To print the contents of the struct: var ret := GetItemDescriptor(objtype); foreach thing in ret print(_thing_iter + ": " + thing); endforeach | |
Return values | |
A struct of all itemdesc.cfg properties and values. | |
Errors | |
"Invalid parameter type" | |
"Itemdesc.cfg entry for objtype X not found." | |
Related Configs | |
itemdesc.cfg |
Packages() | |
---|---|
Explanation | |
Get an array of "package objects", with "name" and "supports_http" members. (more info TBD) | |
Return values | |
An array of package objects. |
ReadMillisecondClock() | |
---|---|
Explanation | |
Returns a long integer of the current millisecond clock. TBD: timebase of clock, saved with server? | |
Return values | |
Current time in milliseconds. |
ReloadConfiguration() | |
---|---|
Explanation | |
reloads pol.cfg (most entries) and npcdesc.cfg | |
Linux: HUP signal will cause ReloadConfiguration to be called. | |
Return values | |
1 |
SetSysTrayPopupText(text) | |
---|---|
Parameters: | |
Name | Type |
text | String tooltip text for systray icon |
Explanation | |
Sets the systray icon's tooltip text (win32 only) | |
Return values | |
1 |
StorageAreas() | |
---|---|
Explanation | |
Get an array of "Storage area objects", with "count" member, and [] operator. (more info TBD) | |
Return values | |
? |
If you know if any information is incorrect on these pages, mail your corrections to racalac@polserver.com
Copyright ©2003-2011 David Carpman, all rights reserved. DO NOT REPRODUCE, MIRROR, ALTER, SPINDLE, MUTILATE, OR SIT ON.