Jump to content
DavidW

List of WEIDU functions

Recommended Posts

In the last few years there's been a transformative improvement in the function library shipped with WEIDU, but the list of functions is hard to navigate. I've just spent a few minutes organizing it for my own benefit, and thought I'd share.

Morphic functions (work as ACTION or SPELL, don't alter game resources)

No-side-effect, no game dependency

tb#factorial
tb#fix_file_size
SUBSTRING
DIRECTORY_OF_FILESPEC
FILE_OF_FILESPEC
RES_OF_FILESPEC
EXT_OF_FILESPEC

No side-effect, game-dependent

RES_NUM_OF_SPELL_NAME
RES_NAME_OF_SPELL_NUM
NAME_NUM_OF_SPELL_RES

Patch functions (work on specific file types)

.ARE

ADD_AREA_ITEM
ADD_AREA_REGION_TRIGGER
ALTER_AREA_ACTOR
ALTER_AREA_CONTAINER
ALTER_AREA_DOOR
ALTER_AREA_ENTRANCE
ALTER_AREA_REGION
DELETE_AREA_ITEM
REPLACE_AREA_ITEM

.CRE

ADD_CRE_EFFECT
ADD_CRE_ITEM_FLAGS
ADD_CRE_SCRIPT
ALTER_EFFECT
CLONE_EFFECT
DELETE_CRE_ITEM
DELETE_EFFECT
FJ_CRE_VALIDITY
FJ_CRE_REINDEX
FJ_CRE_EFF_V2
READ_SOUNDSET
REMOVE_CRE_ITEM_FLAGS
SET_CRE_ITEM_FLAGS
T-CRE_EFF_V1
WRITE_SOUNDSET

.ITM

ADD_ITEM_EFFECT
ADD_ITEM_EQEFFECT
ALTER_EFFECT
ALTER_ITEM_HEADER
CLONE_EFFECT
DELETE_EFFECT
DELETE_ITEM_HEADER
ITEM_EFFECT_TO_SPELL

.SPL

ADD_SPELL_EFFECT
ADD_SPELL_CFEFFECT
ALTER_EFFECT
ALTER_SPELL_HEADER
CLONE_EFFECT
DELETE_EFFECT
DELETE_SPELL_HEADER

.STO

DELETE_STORE_ITEM
REPLACE_STORE_ITEM

.WMP

ADD_WORLDMAP_LINKS
DELETE_WORLDMAP_LINKS

Action functions

FIND_FREE_PRVZ_INDEX
GET_UNIQUE_FILE_NAME
HANDLE_AUDIO
HANDLE_CHARSETS
HANDLE_TILESETS
HANDLE_CHARSETS
INSTALL_PRVZ

Obsolete PATCH functions 

DELETE_CRE_EFFECT (use DELETE_EFFECT)
ALTER_ITEM_EFFECT (use ALTER_EFFECT)
ALTER_SPELL_EFFECT (use ALTER_EFFECT)
DELETE_ITEM_EFFECT (use DELETE_EFFECT)
DELETE_ITEM_EQEFFECT (use DELETE_EFFECT)
DELETE_SPELL_EFFECT (use DELETE_EFFECT)

 

Share this post


Link to post

Incidentally, the absence of anything like this five or six years ago was what drove me to write SFO, SCS's own function library. That library is still rather more powerful than WEIDU's native library, but it's slower, has a steeper learning curve (especially if you haven't done any functional programming) and is awkward to include piecemeal in other mods - which is why I'm trying to get my head around WEIDU's library.

Share this post


Link to post

I'd like to add the following (patch) functions about .STO files (WeiDU v245 or later required!):

  • ADD_STORE_ITEM_EX: Adds an item to the store.
  • ADD_STORE_DRINK: Adds a drink to the store.
  • ADD_STORE_CURE: Adds a cure to the store.
  • ADD_STORE_PURCHASE: Adds an item category to the store.
  • REMOVE_STORE_ITEM_EX: Removes an item from the store.
  • REMOVE_STORE_DRINK: Removes a drink from the store.
  • REMOVE_STORE_CURE: Removes a cure from the store.
  • REMOVE_STORE_PURCHASE: Removes an item category from the store.
Edited by Luke

Share this post


Link to post
1 hour ago, Luke said:

I'd like to add a couple of functions about .STO:

  • REMOVE_STORE_ITEM
  • REMOVE_STORE_PURCHASE (requires WeiDU v245 or later, documentation is still pending...)

REMOVE_STORE_ITEM isn't a function, it's a base-level WEIDU command. REMOVE_STORE_PURCHASE does seem to be a function, but I'm only listing documented functions.

Share this post


Link to post
12 hours ago, DavidW said:

REMOVE_STORE_ITEM isn't a function, it's a base-level WEIDU command.

Yep, you're right, I'll remove it.....

As far as REMOVE_STORE_PURCHASE is concerned, I managed to find the interim documentation. As you can see, @argent77 defined several functions for adding or removing STO structures....

Share this post


Link to post

Cool. But I'll wait to add them until they're in the official documentation. (Your own comment, immediately below, is clear enough in the meantime.)

Share this post


Link to post
Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...