Jump to content

pete_smith1229

Members
  • Posts

    135
  • Joined

  • Last visited

Posts posted by pete_smith1229

  1. I guess I could use something like:

    IF
    	OR(11)
    	CheckStatGT(Myself,5,LEVEL)
    	CheckStatGT(Myself,6,LEVEL)
    	CheckStatGT(Myself,7,LEVEL)
    	CheckStatGT(Myself,8,LEVEL)
    	CheckStatGT(Myself,9,LEVEL)
    	CheckStatGT(Myself,10,LEVEL)
    	CheckStatGT(Myself,11,LEVEL)
    	CheckStatGT(Myself,12,LEVEL)
    	CheckStatGT(Myself,13,LEVEL)
    	CheckStatGT(Myself,14,LEVEL)
    	CheckStatGT(Myself,15,LEVEL)
    THEN
    	RESPONSE #100
    		//Do something
    END

    But it's pretty damn ugly...

  2. 1 minute ago, morpheus562 said:

    I'm a proponent of the script method. It works and can handle multiple set pieces and combinations of set pieces without issue. I wouldn't attempt proficiency method as you'll most likely want to shuffle profs around similar to how Tweaks, Scales of Balance, and Skills and Abilities does it. With this method, you'll be limited to only a few different sets. Scripts are not limited by the number of sets.

    I agree with you, I am sticking with the script method. My idea of using the proficiency method is to use it to count the number of equipped armor. So each armor would use "Modify proficiencies (233)" and increment a new proficiency by 1, then the script will apply the relevant spell resource depending on the proficiency value (e.g. a proficiency of 3 would apply a 3-set bonus effect). If this works as intended, it can help avoid writing out all possible combinations of armor pieces for X amount of sets (although this may not be an issue if writing such a script is automated...).

  3.   

    23 hours ago, lynx said:

    Like IESDP states, the effects are only there as an interim and for saves, they're not being constantly applied. In other words it fires immediately and doesn't care whether the piece is equipped or not. So I don't think this approach is salvageable-

    I suggest you use a useless stat instead, for example NPC_BUMP (on by default for pcs). And then CheckStat in the script.

    https://gibberlings3.github.io/iesdp/opcodes/bgee.htm#op300

    That makes sense, thanks for the tip.

     

    7 hours ago, subtledoctor said:

    Yeah I don’t think local variables can be set with timing mode 2. What you could, maybe, is have a separate effect that uses op321 or op309 to reduce the variable value upon unequipping the item  But that might require the use of repeating effects… and then you’re back in the realm where you don’t need any of this and can do the whole thing with op206.

    If it’s something that needs to be checked by op318/324/326 (but not scripts), you can use a proficiency with op233 instead. 

    If it’s something that needs to be checked by scripts, you can use a spellstate. (But spellstates only have values of 0 or 1, and the game only has space for 255 spellstates.)

     

    You mentioned the use of proficiency before so I'll test set bonuses using this method. Thanks!

    7 hours ago, jmerry said:

    Indeed, local variables can't be set in any temporary way. The only meaningful timing modes are "permanent starting right now" or "permanent after a delay". Once set, local variables are tracked with effects on the CRE, but those effects don't have durations or sources or anything that lets you remove them; they can only be overridden by altering the variable again.

    Aren't proficiencies an even more limited resource than spellstates? The only thing that makes proficiencies detectable is that they're tied to creature stats, and only stats 89-134 are actually proficiencies. Plus they're basically all already used in the base game, either as "real" proficiencies or as pseudo-spellstates.

    Thanks for the info concerning variables, I did notice they can be overriden but not that they were constant.

    Although I would like to make an efficient method, I'm glad we at least have a couple of working methods to achieve set bonuses 😁

  4. So I'm toying with "Modify local variable (309)", Value=1, Modifier=1, timing mode = 2. This effect is added to each armor piece and when equipping the armor, the set bonus occurs once a certain value is reached.

    However, when un-equipping an armor piece, the variable value doesn't seem to decrease. The bonus remains....

    Is it possible for the variable to only take effect when the armor is equipped using opcode 309?

  5. 1 hour ago, lynx said:

    Stats are not variables and vice versa.

    Were you trying with something like this @pete_smith1229?

    IF
      Global("MO_BalduranSet","LOCALS",2)
    THEN
      RESPONSE #100
        ApplySpellRES("MOSET1A",Myself)  // Add Balduran 2 Piece Set Bonus
        ApplySpellRES("MOSET1A",Myself)  // remove Balduran 3 Piece Set Bonus
        ApplySpellRES("MOSET1A",Myself)  // remove Balduran 4 Piece Set Bonus
        ApplySpellRES("MOSET1A",Myself)  // remove Balduran 5 Piece Set Bonus
    END

     

    Thanks, that looks more like what I was trying to achieve late last night! I'll test this when I have time and let you know if it works!

  6. 25 minutes ago, morpheus562 said:

    You're welcome to do something like that if you desire. That may be an easier path but the way above does work. 

    Edit: isn't there also a cap to how many stats can be listed in stats.ids? Depending on the number of item sets one wishing to create, this could pose an issue.

    Don't know about the cap.

    I can get the buff to activate when equipping the armor but it doesn't get removed when unequipping. Thought this way would make life easier for everyone but will need to work on it to see if it's doable. Will test more tomorrow.

  7.   Just thinking out loud to avoid writing out all the possible armor combinations...could you add opcodes "Modify global variable (265)" or "Modify local variable (309)" to each of your armor pieces and have it increment the variable value. Then in the script, check for the variable value and apply the relevant number of spell resources. Something like:

    // 2-set
    IF
      Global("MO_BalduranSet","LOCALS",2)
    THEN
      RESPONSE #100
        ApplySpellRES("MOSET1A",Myself)  // Add Balduran 2 Piece Set Bonus
    END
    
    // 3-set
    IF
      Global("MO_BalduranSet","LOCALS",3)
    THEN
      RESPONSE #100
        ApplySpellRES("MOSET1A",Myself)  // Add Balduran 2 Piece Set Bonus
        ApplySpellRES("MOSET1E",Myself)  // Add Balduran 3 Piece Set Bonus
    END
    
    // etc
  8. 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.

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

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

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

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

  13. 2 hours ago, ptifab said:

    Thanks a lot for that, maybe i'll try to do the same for my personal modlist. 😉

    I'd certainly appreciate confirmation if this works for someone else!

    23 minutes ago, morpheus562 said:

    Does splprot.2da have a way to check if a spellstate is active or not? I'm not in front of a computer right now, but I think this could be doable without being a repeating effect.

     

    Can't you add to the stats.ids file and use splprot.2da to check against it? You can then use opcode 318 to block the eff file tied to the set bonus if the stat is 0. Then have the item for the set then set the stat to 1 on equip. Wouldn't it then register on equip as 0, block it, then set the stat to 1 for when the matching set item is attached? Does one have the ability to increment a stats.ids entry by 1 or is it only set?

    This sounds similar to what I've done previously with .EFF files except with spell states. The major issue was how to remove the bonus when one set item is removed. I got it to work but it required 2 EFF and 2 SPL files. And this was for a 2-set armor, adding more armor would require more EFF files for each item. I'm sure your way works better than what I did without scripting.

  14. I believe I've achieved what I wanted in the most efficient way (for me at least) which only involves:

    • 2 .SPL files
    • 1 new global variable
    • 1 .BCS file

    SPL1 file contains the bonus effects you want applied when all set armor pieces are equipped via various opcodes such as "AC bonus (0)", "Blur (65)" etc.; SPL2 file contains "Remove effects by resource (321)" to remove the bonus effects from SPL1. Because the script will be calling these spells, you will need to add these to "SPELL.IDS" using the ADD_SPELL_EX function by K4thos and define it with a name as this will be used to call the spell (e.g. SPL1 = "SET_ARMOR_BONUS_ON" and SPL2 = "SET_ARMOR_BONUS_OFF").

    A new global variable (e.g. "SET_ARMOR_BONUS") needs to be added to the "Baldur.GAM" file. This is used as a boolean check to ensure script blocks in the .BCS file doesn't get executed continuously.

    Finally, the .BCS file contains the logic to check if all set armor pieces are equipped and if so, apply the first .SPL file. If any armor is removed, apply the second .SPL file. The .BCS file is added to each armor using "Set AI script (82)". The following is the script used for a 2-set armor piece but can be easily customized to include additional armor pieces.
     

    // Generic .BCS script for 2-set armor piece
    // Add "HasItemEquipedReal()" for additional armor pieces
    
    // Apply bonus if all armor is equipped and global variable SET_ARMOR_BONUS=0
    IF
        HasItemEquipedReal("RB_ARM01",Myself)  // Custom armor
        HasItemEquipedReal("RB_HLM01",Myself)  // Custom helmet
        Global("SET_ARMOR_BONUS","GLOBAL",0)
    THEN
        RESPONSE #100
            ReallyForceSpell(Myself,SET_ARMOR_BONUS_ON)  // Custom bonus spell
            SetGlobal("SET_ARMOR_BONUS","GLOBAL",1) // Set global variable SET_ARMOR_BONUS=1 to ensure this code block is executed once
    END
    
    // Remove bonus if any armor is unequipped and global variable SET_ARMOR_BONUS=1
    // Set global variable SET_ARMOR_BONUS=0 to ensure these code blocks are executed once
    // Each armor needs to have their own removal code block
    // Add more code blocks for additional armor pieces
    IF
        !HasItemEquipedReal("RB_ARM01",Myself)  // Custom armor
        Global("SET_ARMOR_BONUS","GLOBAL",1)
    THEN
        RESPONSE #100
            SetGlobal("SET_ARMOR_BONUS","GLOBAL",0)
            ReallyForceSpell(Myself,SET_ARMOR_BONUS_OFF)  // Custom bonus removal spell
    END
    
    IF
        !HasItemEquipedReal("RB_HLM01",Myself)  // Custom helmet
        Global("SET_ARMOR_BONUS","GLOBAL",1)
    THEN
        RESPONSE #100
            SetGlobal("SET_ARMOR_BONUS","GLOBAL",0)
            ReallyForceSpell(Myself,SET_ARMOR_BONUS_OFF)  // Custom bonus removal spell
    END

    I'm sure there is a much cleaner method but this works perfectly for me. Thanks to all for your comments!

  15. I've tested the "Drop item (264)" effect by adding it to a helmet and everytime I equip it, it would drop an equipped item in the following order:

    1. Amulet
    2. Armor
    3. Belt
    4. Boots
    5. Cloak
    6. Bracers
    7. Ring1
    8. Ring2
    9. Shield

    Is there a way to use this opcode (or another) to drop a specific equipped item? Is there also a resource similar to this where it shows the ordering as I am not sure if what I found is accurate.

  16. On 4/19/2023 at 11:36 PM, lynx said:

    Thanks, unfortunately the .EFF file fires the STRREF_GUI_FEEDBACK_CONTINGENCY_TRIGGER held in the ENGINEST.2DA file. Changing the value of this to 0 or leaving blank still results in the PC name still written to the text window. The "Disable display string (267)" effect doesn't seem to affect this. But it's fine, just a minor thing.

    On 4/20/2023 at 7:34 AM, marchitek said:

    I think it could be possible to simplify like this:

    • to each set piece add dedicated spl state "while equipped" to equipment effects
    • to one set piece add cast spell on condition "while equipped" to equipment effects (each round for one round duration), this is were your SPL would be applied
    • to your SPL add:
      • protections agains this spell (op318) if set piece spl state not present (one protection for each set piece), this need go at the begging of SPL ability effect list
      • your set bonuses

    So one SPL in total, no EFFs.

    If you will want to make set bonuses more like "while equipped" then you need jump into this EFFs / SPLs maze (success is not guaranteed).

    Thanks, I tested this and it works when equipping the armor pieces. Unfortunately, taking a piece off doesn't remove the set bonus. I think it's because the "Cast spell on condition (232)" effect only fires once even if you set the condition "CheckSpellState(Myself,'Special') / per round (21)". However, I did simplify it slightly and reduced 3 .EFFs files to 2! This also works better as before, there would always be text triggered by the EFF every round. Now the text only appears once when the set bonus takes effect.

    Will continue to test.

  17. Right, I seem to have a working example now for a 2-set armor piece where when both items are equipped, a bonus is added; when either item is removed, the bonus is lost. The bonus also no longers stack when an armor is re-equipped. At the moment, it uses 3 EFF files and 3 SPL files with combinations of opcodes mentioned in earlier posts.

    I'll work on it some more to see if I can simplify the logic tree otherwise it's going to be a nightmare for a 3-set piece and more...

     

  18. 1 hour ago, skellytz said:

    Please follow the updates on Infinity Sounds v2

    We've spent dozens of hours restoring not only the BG1 spell casting voices/chants, but also all other spell sound effects. This wasn't as easy as simply replacing the audio files; all the individual spell files had to be compared and patched accordingly. Additionally, the affected audio files have been manually processed to remove the clipping and clicking noises that had been caused by lossy compression methods (Interplay ACM).

    Examples:

    Original (compression artifacts, heavy clipping) 

    Remastered (clean, no clipping)

    I've recently returned to this project and the new release is coming soon.

    Amazing! The original BG1 soundsets and music always sounded more authentic and "real" for a fantasy world. Thanks for the mod, really looking forward to it!

  19. 3 hours ago, subtledoctor said:

    So, doing this with two items would be fairly simple and there is a nice trick with proficiencies you could use in place of spellstates, taking advantage of the way bit-equality works. (In short, if both items increase a proficiency by 4 bits, then you can set a 326 check to look for anyone whose proficiency is being increased by 8 bits. My dual-wielding bonuses use this to good effect.)

    You can’t use that trick for a set of three items, though. 

    Further, consider the distinction among these three possible implementations:

    …vs.

    …vs.

    The first is fairly simple; the second is more complicated; the third is quite difficult. And of course this all gets more complex as you go from including two items to three to four etc. 

    Thanks! By proficiency, do you mean attribute (e.g. STR, DEX etc)? And how could "Apply effects list (326)" be used to check an increase in value as I thought you would need to set a base value first? Your first example is the simplest and now that I think about it, I think a 2-set piece is probably as far as I would go.

    2 hours ago, marchitek said:

    Just an idea.

    Here was discussed example of item that check condition every round and if met cast spell for one round. If you don't want this effect to be visible instantly in statistics, then maybe it would be simplest approach? It can be on one item and equipment order would not matter.

    Thanks, I think the item you're referring to (BLUN38, Night Club +1) uses an .EFF file with Type = "Cast spell on condition (232)"; Condition = "TimeOfDay('Special') / per round (13)". I've used the same file with another round-based condition and it works for 2-set armor. Removing the bonus when unequipping an armor is now the main issue.

    16 minutes ago, Endarire said:

    I know the Diablo comparisons to this mechanic are apparent.  shohy on SHS already converted many D2 kits and items to be BG2/EET compatible (GitHub).  This seems like a collaborative project.

    Enjoy, all!

    Interesting, I'll have to take a look at this. Thanks for sharing the links!

  20. Minor progress: if both items are equipped and you remove the cloak, the additional buff is removed. This requires using another .EFF file with similar settings and another .SPL file to remove the effects of the cloak. Both these files are tied to the helmet. Unfortunately, the additional buff stacks each time either armor is re-equipped. There's a lot of circular logic going round (hah!) but will see if there's a way to completely reset the buff.

  21. 16 hours ago, ptifab said:

    Very interesting project. I'm curious about how you will handle those sets effects and the possibilities you'll discover !

    Thanks, will take a lot of experimenting so will see how much of this can be achieved!

    16 hours ago, jmerry said:

    One caveat on the ordering; the fixed ordering only applies when you load a save. If you're taking items on and off during gameplay, their equip effects will be applied using timestamp order.

    Yeah I was hoping for a one-solution-fits-all but that probably won't be the case for this setup. I'm starting to think maybe a combination of a global script and opcodes may be ideal: have the armor pieces give a status effect then have the script check if the PC has these equipped and if so, provide a buff...

    16 hours ago, subtledoctor said:

    The more I think about it, the more this seems like it will be fairly difficult/complex. It will depend bvery much on the particulars of exactly what you are trying to implement. (Which of course nobody ever wants to spell out in posts like this... :rolleyes: )

    HA! I like to generalize posts to try and make solutions easier to be adaptable to other scenarios.

    One example of what I want to do is create an armor set which consists of the "Helm of Balduran" and the "Cloak of Balduran" (I brought these to Icewind). Each of these gives the user -1 AC bonus. So wearing both normally would give an overall -2 AC bonus. What I want to do is when someone equips both of these, he/she would receive an additional benefit. So for argument's sake, let's say the additional benefit is another -1 AC bonus. So now equipping these two armor pieces would give an overall -3 AC bonus instead of the original -2 AC bonus.

    What I have done so far to enable the additional benefit (without taking the ordering into consideration) is to:

    1. Create a new state id using Weidu and @subtledoctor's script (https://www.gibberlings3.net/forums/topic/36079-how-to-create-new-spell-states/)

    2. Add an Effect to the "Helm of Balduran" .ITM file using "Set spell state (328)" = new state; Timing mode = "Instant/While equipped - 2".

    3. Create a new .SPL file with a Spell Ability to give the Caster an AC bonus (this is the additional benefit).

    4. Add an Effect to the "Cloak of Balduran" .ITM file using either "Apply effects list (326)" or "Use EFF file (177)". The former works immediately; the latter requires creating a new .EFF file which uses Type = "Cast spell on condition (232)"; Condition = "CheckSpellState(Myself,'Special') / per round (21)"; Resource = the new .SPL file; Special = new state. So once both armors are equipped, the additional benefit will kick in after 6 seconds.

    So gaining the additional benefit works. At the moment, my issue is what happens taking one of the armors off because right now, the additional benefit remains active. I'm having to play around with various opcodes as mentioned by others earlier: "Use EFF file (177)", "Protection from spell (206)", and "Remove effects by resource (321)". I have added opcode 321 to the helmet so if you unequip the cloak and re-equip the helmet, the additional benefit is removed. Not ideal. I need to find the right combination of opcodes and timings.

    Once this is solved for 2-set armor piece, I would like to extend to a 3-set and potentially more if it's feasible. I'll continue playing around in my free time and see how far this can go using opcodes or if global scripts should also be used.

    Thanks for attending my TEDTalk 😁

×
×
  • Create New...