Add script to an item? Proficiencies and Polymorph.
Datura
Member Posts: 12
I need your help!
I've spent hours in Near Infinity, on https://gibberlings3.github.io/iesdp/main.htm and on the various guides listed on shsforums.net/topic/36781-comprehensive-ie-modding-tutorial-index/, but I can't seem to figure this out: is it possible to add a script I created to an item, as you would do with magic effects (e.g. AC bonus (0), Set color (7), Haste (16),...) ?
All I got for my troubles is a wicked headache and a lack of sleep
The only effect I found that seems to be somewhat related to scripts is Modify script state (282) but I have no idea what the hell it does, the description on IESDP doesn't explain what the "Scripting state" is and I have found nothing about it in the guides on SHS
Does this require some clever trick ? Is this even possible ?
Please, oh wise ones, release me from my torment!
I've spent hours in Near Infinity, on https://gibberlings3.github.io/iesdp/main.htm and on the various guides listed on shsforums.net/topic/36781-comprehensive-ie-modding-tutorial-index/, but I can't seem to figure this out: is it possible to add a script I created to an item, as you would do with magic effects (e.g. AC bonus (0), Set color (7), Haste (16),...) ?
All I got for my troubles is a wicked headache and a lack of sleep
The only effect I found that seems to be somewhat related to scripts is Modify script state (282) but I have no idea what the hell it does, the description on IESDP doesn't explain what the "Scripting state" is and I have found nothing about it in the guides on SHS
Does this require some clever trick ? Is this even possible ?
Please, oh wise ones, release me from my torment!
Post edited by Datura on
0
Comments
Indeed, that is more or less what I'm trying to do, let me explain:
I want to negate the bonus that the Single-Weapon Style proficiency gives to the "natural" weapons you get when polymorphed.
For example, when transformed into a black bear, you get a temporary weapon "PLYBEAR2.ITM" representing the bear's paws to which the aforementioned proficiency fully applies, which doesn't make a lot of sense to me...
I can see your proficiencies being applied to a Flind's halberd or an Ogre's morning star, but to a paw? That's just silly
Anyway, I tried changing the weapon's item category from Hand-to-hand weapons (28) to something else like Miscellaneous (0) or Teeth (76), but that doesn't prevent the proficiency bonus being applied.
I also tried adding a Modify proficiencies (233) effect to reduce PROFICIENCYSINGLEWEAPON - 113 when worn, but trying to Increment (1) by a negative number of stars isn't allowed by Near Infinity.
So... I wrote a script that checks whether or not you have one of these "natural" weapons equipped and, if so, sets your PROFICIENCYSINGLEWEAPON to 0 for the duration of the spell.
My hope was to be able to attach this script to the "natural" weapons in question so that it runs when you polymorph and equip these... that's the idea anyway !
Maybe I'm stupid though, and there's a much simpler way to achieve my goal?
Thanks for any help you can provide !
I guess my penultimate sentence turned out to be true: I was unnecessarily overcomplicating things
I'm pretty new to IE modding, so I don't (yet) have a good grasp of its capabilities, especially when it comes to Weidu... I'm used to the Elder Scrolls or KotOR (amongst others) way of doing things—i.e., overwriting a file instead of patching it, and lots of scripting.
Guess I'll go check those Weidu tutorials for a couple (dozen) hours
Anyway, I just tried all 31 flags (even the Unknown ones) and I couldn't find it, so I guess I'll have to do as @subtledoctor pointed out.
But if you eventually remember or manage to take a look, please keep me posted
@subtledoctor
I'm nearly there !
- The EFF files each correctly reduce the proficiency by the specified amount when added to the weapon.
I added each file as its own parent (see screenshot).
- I modified SPLPROT.2DA so that I now have two new entries (again, see screenshot).
However, I'm puzzled by opcode 318. The entry in IESDP states:
Parameter #1: Value
Parameter #2: Stat Type
Description:
The creature type specified by the 'Type' field becomes immune to the spell or item specified in the 'Resource' field.
So I figured out that Parameter #2: Stat Type must be set to my corresponding entries in SPLPROT.2DA (in my case 144 for -1 prof and 145 for -2 prof) and the "Resource" field must point to my .EFF files (DECSWS1.EFF for -1 & DECSWS2.EFF for -2).
(On a side note: does Parameter #1: Value do anything?)
BUT my .EFF files don't appear in the list of selectable resources for opcode 318 (see screenshot).
Even when I force the Resource via the correct offset, it defaults to DECSWS1.ITM, not .SPL (another screenshot).
I still tested it ingame, but the "finished" weapon sets my SWS proficiency to 7 with one pip and to 0 with two pips, so there's clearly something wrong with my opcode 318 implementation
Any suggestions?
I already have activated the option to show hex offsets don't worry
I use the raw view when checking IESDP for reference, I don't know why but it makes it easier for me to see that the offsets sizes are correct.
I have the opcodes 318 below the 177 ones... guess that explains it
I'll try again tomorrow, as it is currently 1 h 30 AM in Belgium and I must wake up pretty early.
A lot of thanks to you both for your help, it is greatly appreciated!
Following your advice, I changed the resource type of the two .EFF to "Spell", then placed the two 318 opcodes before the two 177 opcodes and... it kind of worked.
Meaning it worked when the character had 1 or 0 pips in SWS, but didn't when it had 2 pips, where it merely reduced it by 1.
Yeah, I don't get it either. The logic is sound, it should go like this:
SO I changed my entries in SPLPROT.2DA to check for PROFICIENCYSINGLEWEAPON < 2 and PROFICIENCYSINGLEWEAPON < 1 instead, meaning the following would occur:
IF PROFICIENCYSINGLEWEAPON < 2 (=>1 or 0)
->Protection from DECSWS2
IF PROFICIENCYSINGLEWEAPON < 1 (=>0)
->Protection from DECSWS1
At first glance, the problem here would be when your proficiency equals 2 you would get hit by both .EFF files, reducing your proficiency by 3... but it doesn't happen in-game as far as I can tell: when you have 2 pips in SWS, it gets reduced to 0 and no further
Huzzah ! It works now (kind of) !
Seriously though, it does what I wanted it to do, but I have no idea why your implementation doesn't work with 2 pips in SWS proficiency ?!
Logic dictates it should work just fine, but it doesn't... whereas my method shouldn't work with 2 pips in SWS, but it does ?!
I feel like crying
The "Set if Higher" mode of opcode 233 has the same priority as the splprot opcodes trigger, while the "Increment" mode has a lower priority.
If a character has 0 in SWS, within the same spell/item effect list: Any checks occurring in the next "tick" of game time would return true, just not those ocurring in the same tick in which it is applied.
Similar effects can be seen with opcodes that alter saving throws, for which a new parameter2 mode was added specifically to process before the effects following it, so the modifier could affect any saves following it in the spell.
Thank you for your explanation, but I'm not sure I understand.
I thought it worked like this:
2 pips:
!=2 ? => NO => no protection from DECSWS2
!=1 ? => YES => protection from DECSWS1
=> Apply DECSWS2 => resulting proficiency = 2-2 = 0
1 pip:
!=2 ? => YES => protection from DECSWS2
!=1 ? => NO => no protection from DECSWS1
=> Apply DECSWS1 => resulting proficiency = 1-1 = 0
0 pip:
!=2 ? => YES => protection from DECSWS2
!=1 ? => YES => protection from DECSWS1
=> Apply nothing => resulting proficiency = 0-0 = 0
You said that the "Increment" mode of opcode 233 has a lower priority than opcode 318, which would suggest that the game should check both opcodes 318 THEN lower the proficiency via opcode 233, shouldn't it?
However, "2 pips" seems to get affected by DECSWS1 regardless.
Does that mean the opcode 318 somehow "interrupts" the full application of opcode 233 ?
I probably don't understand it correctly
Sorry to be such a noob, but it bothers me to no end.
Anyways, since I seem to have found a working solution, I'll now try to understand how to patch all "paw weapons" using WeiDU.
I have the following documentation: WeiDU readme, SHS's IE modding tutorial index, and @subtledoctor's How to do stuff in WeiDU.
Anything else I should be aware of ?