Jump to content

Set armor pieces for additional bonuses


Recommended Posts

Guest morpheus562

I could see having item on-equip assign a script into an unused script slot and the script can run checks on all item set combos. This could account for item sets with more than three items. 

Any qualms if I run with this and add item pairing bonuses to "set" pieces within Forgotten Armament?

Edited by morpheus562
Link to comment
Guest morpheus562

Frustrating. I have it matching Balduran set (helm, cloak, and armor) and it applies a bonus when all are equipped. I have on equip assign a script into the race section for scripts (checking if the person equipping it is a PC). The script does the check, uses applyspellres("spl1",Myself) to cast a spell via opcode 177 to apply an effect. My issue arises in that the applied effect gives the bonus but doesn't show up as an active effect on the character. This becomes an issue when trying to remove the effect if any of the three items get unequipped. I'm playing around with it, so it's possible I don't have something setup perfectly correct for it. But getting bonuses for multi piece set items works!

Edited by morpheus562
Link to comment
Guest morpheus562

I'm using either 2 or 9. Wife took over the computer so I can't see anymore. Basically the on-equip is only for the item to apply the script to the character. I do need to check now because when one of the items is removed it could remove the script from the character so it won't remove the bonus...hmm...

The script itself will track all item sets and apply/remove bonuses accordingly. I could probably even attach the script to the clab files (to be added) or add it manually to the main char and every recruitable npc in the game.

Edited by morpheus562
Link to comment
13 hours ago, subtledoctor said:

Wait you’re doing it by script? What runs the script??

Sure. 

Each armor piece uses "Set AI script (82)" which runs the same .BCS script. I've noticed that scripts tied to armor is only triggered when that armor is interacted with (i.e. equipped/unequipped). This is why all armor pieces uses the same script for checking for all armor pieces as it doesn't matter which armor triggers the script.

Edited by pete_smith1229
Link to comment

I found an issue where if an armor has the same equipped effect as a set bonus effect, removing the bonus effect also removes the equipped effect from the armor.

For example, if the set bonus effect is an AC Bonus and an armor piece also has this effect seperately, SPL2 which uses "Remove effects by resource (321)" would remove both effects. So the armor would need to be re-equipped for it to gain back its AC Bonus.

So for now at least, the set bonus effect should be different from any armor effect.

Link to comment
6 hours ago, pete_smith1229 said:

Each armor piece uses "Set AI script (82)" which runs the same .BCS script.

Wow that is not what I would have tried. The big red warning

Quote

This effect can unset scripts from a creature, which can break the game.

would have scared me away. 

I would have just used a spellstate or a pair of proficiency values with some repeating spells, and just tolerate the trailing 1-3 second delay in effects disappearing after unequipping something. A bit unusual and annoying, but my guess it it would be a more robust solution. 

But so far I’ve only thought about it in my head, not actually tested anything. So what do I know. 

Edited by subtledoctor
Link to comment
Guest morpheus562

I'm still playing around with it, but I got some ideas and think it can be working by tonight.

Basically any item that is part of a set will update the creatures Race script with moset1.bcs. This script file is used universally across all item sets and will only be applied to the creature if they are a PC (to prevent overwriting a non-recruitable npc race script if applied). The script will then apply a spell if all items in a set are equipped and set the corresponding local variable to 1. The applied spell will then use opcode 326 to apply effect list which will then apply the set bonuses. The script will then continue running and if it identifies any of the set items are no longer equipped (any set item is not equipped with the local variable at 1 showing the set bonuses are applied) it will cast a spell using opcode 326 to remove the spell that applies the effects. This ensures it doesn't remove any effects on the creature that are applied via other means.

The benefit with this approach is I can use more than 2 items for a set, if desired. I can further play around and provide additional bonuses if 2/3 are equipped and even more if all are equipped. That will definitely require more work on my end via scripting to work out but may be a possibility.

Edited by morpheus562
Link to comment

When assigning scripts to party members specifically, the thing to watch for is that those scripts will be unset by the game fairly regularly.

The override slot belongs to creature-specific scripts, set in the original CRE and updated when you transition to new campaigns by area scripts.

The class slot belongs to the creature's combat script, which is reset whenever you load a save, choose a script in the in-game menu, or have that creature enter/leave the party.

The race and general scripts are empty, voided whenever you load a save or have that creature enter/leave the party.

The default script belongs to DPLAYER2/DPLAYER3, reset whenever you load a save or have that creature enter/leave the party.

So there are three slots you have to work with if you want to give a party member a temporary script: specifics, race, general. And for all of them, you have to watch out for the game voiding your script because you loaded a save or something. Loading a save also re-evaluates equip effects, so that's not bad when you're basing this on equipped items. Having a character leave the party and return with the items already equipped might break things, though. If that unsets the script ... equip the set on a character, get the bonus, remove them from the party and return them to remove the script while keeping the bonus, unequip the items while paused, retain the set bonus because the script isn't there to keep you honest.

Link to comment
Guest morpheus562

Fair enough if players want to bend the rules. Equipping any item that belongs to a set will reassign the script, so any attempts to skirt around it may not be the most effective.

Link to comment
2 hours ago, subtledoctor said:

Wow that is not what I would have tried. The big red warning

would have scared me away. 

I would have just used a spellstate or a pair of proficiency values with some repeating spells, and just tolerate the trailing 1-3 second delay in effects disappearing after unequipping something. A bit unusual and annoying, but my guess it it would be a more robust solution. 

But so far I’ve only thought about it in my head, not actually tested anything. So what do I know. 

I'm sure your suggestion is a more robust solution. My original intention for the set armor was designed for PCs and not NPCs so I assumed putting the BCS script in the SPECIFICS slot would be fine. But still early days!

2 hours ago, morpheus562 said:

I'm still playing around with it, but I got some ideas and think it can be working by tonight.

Basically any item that is part of a set will update the creatures Race script with moset1.bcs. This script file is used universally across all item sets and will only be applied to the creature if they are a PC (to prevent overwriting a non-recruitable npc race script if applied). The script will then apply a spell if all items in a set are equipped and set the corresponding local variable to 1. The applied spell will then use opcode 326 to apply effect list which will then apply the set bonuses. The script will then continue running and if it identifies any of the set items are no longer equipped (any set item is not equipped with the local variable at 1 showing the set bonuses are applied) it will cast a spell using opcode 326 to remove the spell that applies the effects. This ensures it doesn't remove any effects on the creature that are applied via other means.

The benefit with this approach is I can use more than 2 items for a set, if desired. I can further play around and provide additional bonuses if 2/3 are equipped and even more if all are equipped. That will definitely require more work on my end via scripting to work out but may be a possibility.

Very interested to see how you tackled this and the script you are using! Certainly would be interesting to see additional bonuses being applied depending on how many pieces of armor is equipped.

16 minutes ago, jmerry said:

When assigning scripts to party members specifically, the thing to watch for is that those scripts will be unset by the game fairly regularly.

The override slot belongs to creature-specific scripts, set in the original CRE and updated when you transition to new campaigns by area scripts.

The class slot belongs to the creature's combat script, which is reset whenever you load a save, choose a script in the in-game menu, or have that creature enter/leave the party.

The race and general scripts are empty, voided whenever you load a save or have that creature enter/leave the party.

The default script belongs to DPLAYER2/DPLAYER3, reset whenever you load a save or have that creature enter/leave the party.

So there are three slots you have to work with if you want to give a party member a temporary script: specifics, race, general. And for all of them, you have to watch out for the game voiding your script because you loaded a save or something. Loading a save also re-evaluates equip effects, so that's not bad when you're basing this on equipped items. Having a character leave the party and return with the items already equipped might break things, though. If that unsets the script ... equip the set on a character, get the bonus, remove them from the party and return them to remove the script while keeping the bonus, unequip the items while paused, retain the set bonus because the script isn't there to keep you honest.

Thanks, I've used the SPECIFICS slot for the script. You're right about reloading the save. The bonus effects disappear and requires any armor piece to be unequipped, resume the game, then re-equip the armor for the bonus to be applied. Hmm........

Link to comment
Guest morpheus562
7 minutes ago, pete_smith1229 said:

I'm sure your suggestion is a more robust solution. My original intention for the set armor was designed for PCs and not NPCs so I assumed putting the BCS script in the SPECIFICS slot would be fine. But still early days!

Very interested to see how you tackled this and the script you are using! Certainly would be interesting to see additional bonuses being applied depending on how many pieces of armor is equipped.

Thanks, I've used the SPECIFICS slot for the script. You're right about reloading the save. The bonus effects disappear and requires any armor piece to be unequipped, resume the game, then re-equip the armor for the bonus to be applied. Hmm........

Any concern if I use this work I did to make a component in Forgotten Armament for item sets?

Link to comment
5 minutes ago, morpheus562 said:

Any concern if I use this work I did to make a component in Forgotten Armament for item sets?

Absolutely zero concern! I'm an advocate for open solutions and knowledge sharing. This community has certainly helped me numerous times. I would love to see the various methods used to create set bonuses!

Link to comment
7 hours ago, pete_smith1229 said:

I found an issue where if an armor has the same equipped effect as a set bonus effect, removing the bonus effect also removes the equipped effect from the armor.

For example, if the set bonus effect is an AC Bonus and an armor piece also has this effect seperately, SPL2 which uses "Remove effects by resource (321)" would remove both effects. So the armor would need to be re-equipped for it to gain back its AC Bonus.

So for now at least, the set bonus effect should be different from any armor effect.

Thanks to @morpheus562, this issue is resolved when using "ApplySpellRES()" in the BCS script.

Link to comment

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.

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...