Jump to content

The best way to apply an effect to a series of items


Rana

Recommended Posts

First, the backstory: I'm in the middle of developing a Fighter/Mage kit, and there are a couple of features of the kit that apply to armor types that the player can wear. The first feature allows spellcasting in light armor(anything studded leather and below) and elven chain mail. The second feature gives "protection" from some of the kit's more athletic abilities - this would apply to armor types above studded leather, excluding elven chain mail.

 

I've already created two effects that would grant the described features and have applied them to a couple of test items using Near Infinity to test if they already work - now I just need to find a good way to add this to my kit's setup.

 

I know that I could use scripting applied to the baldur.bcs to apply these effects to the items I want, but I'd rather not have to rely on scripting or touch that file unless absolutely necessary. Likely a patch included in the .tp2 would be the best solution, but I've never made one.

 

Is there any sort of template I can follow, or a file someone can recommend I could copy and alter? For example, I'm looking at the "spellcasting_armor_arcane_failure" file from the Item Revisions mod, but I don't understand everything about it and don't want to just go in hacking away at script I don't understand.

 

Edit: Actually, since the "Spellcasting in specific armor" effect is something that I want to only apply to this kit and not all fighter/mages in the game, wouldn't a script in the baldur.bcs be the only possible solution? I don't think there are any ways to use standard effect shells that are kit dependent.

 

I already have this script solution for the casting in armor feature applied to the baldur.bcs and it works - I was just hoping to find an alternative

Link to comment
Likely a patch included in the .tp2 would be the best solution, but I've never made one.
This is easy. Just get the list of items you want to patch or identify some common feature (preferably a foolproof one) you can use to patch them all, then it's either (for the list of items):

ACTION_FOR_EACH item IN "big" "list" "of" "items" BEGIN
 ACTION_IF FILE_EXISTS_IN_GAME "%item%.itm" BEGIN
COPY_EXISTING "%item%.itm" override
  LAUNCH_PATCH_FUNCTION ADD_ITEM_EFFECT
	opcode = ?
	//etc - see WeiDU documentation for syntax
  END
BUT_ONLY
 END
END

or COPY_EXISTING_REGEXP GLOB with similar arguments if you want to go through all items in the game and patch them based on some characteristic.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...