DavidW Posted June 5, 2022 Share Posted June 5, 2022 I've written two functions for the FP, both in %MOD_FOLDER%/lib/dw_functions.tph. permute_effects is a patch function: here's its documentation. Quote For the current itm/spl file, take the effect stack for an ability and permute the order of the effects. The permutation is controlled by the string "permutation", which should be a comma-separated list of nonnegative integers. If the list has N elements it should contain 0... N-1, in some order. Assuming that the ability has at least that many effects, the first N will be permuted into the order given by the permutation. (If not, we give a warning.) 'ability' determines which ability is permuted. (If ability=-1, we permute all abilities.) extract_effects_as_subspell is an action function: Quote Take some subset of a spell or item's effects and extract them as a subspell. Inputs: 'resource' (e.g., AX1H10.itm) is the spell/item to be edited. 'subspell' is the name of the subspell to be created. 'extract' is a comma-separated list of nonnegative integers specifying which effects are to be extracted. Effects extracted should all have the same probability, the same saving throw (if any) and should not include damage with save-for-half. On an item, the integer 'ability' indicates which ability is patched (0 by default). On a spell the default assumption is that the effect block is the same at every level, but if you set keep_spell_levels=1, the effect blocks are extracted on a per-level basis. If the 'subspell' spell already exists, it is not recreated. (So be careful if reusing to make sure effects really are identical.) Please use freely (and let me know if you find bugs; one of the reasons I code this way is so that the nastier bugs stay in central places and can be fixed centrally). Quote Link to comment
Luke Posted June 6, 2022 Share Posted June 6, 2022 22 hours ago, DavidW said: (and let me know if you find bugs; one of the reasons I code this way is so that the nastier bugs stay in central places and can be fixed centrally). This should be WRITE_LONG This should be WRITE_BYTE Alternatively, leave it at zero/default (unlike ITM files, this field should be irrelevant for SPL files...) Quote Link to comment
DavidW Posted June 6, 2022 Author Share Posted June 6, 2022 3 hours ago, Luke said: This should be WRITE_LONG This should be WRITE_BYTE Alternatively, leave it at zero/default (unlike ITM files, this field should be irrelevant for SPL files...) Theoretically yes, though in both cases I think it's harmless. Quote Link to comment
Recommended Posts
Join the conversation
You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.