Jump to content

SparrowJacek

Members
  • Posts

    51
  • Joined

  • Last visited

Everything posted by SparrowJacek

  1. Wow! It's THAT simple now. And it works properly with opcode 193, which is even cooler. Thank you very much
  2. Hi, My question is exactly, as in the topic title. It would be perfect, if I could make a modification so that using a wand/scroll would trigger "normal" casting, that breaks, when targetting an invisible creature, without opcode 193 applied. Is something like that possible? Or are there any other ways to prevent such behavior? Thanks!
  3. I don't think there's an elegant way to do what you want to do. At least I am not aware of any, but there are ways to achieve something similar, depending on your tolerance for delays in checking the conditions. To ensure that you backstab only once, you can simply use #340 (0x154) Spell Effect: Change Backstab Effect to cast a spell that will dispel your original spell/effect, when the backstab is performed. To check if your character is invisible, you could probably use #272 (0x110) Spell: Apply Repeating EFF coupled with opcode 326. But that would work only once per second (and might be affected by slow). The second option, that I personally don't like, but deem necessary in some situations, is to add some checks to your baldur.bcs and baldur25.bcs script files. This script is fired more often than once per second (once per game tick?), so the delay will be much shorter.
  4. Sorry to post another message here, but thanks to Pecca, the author of Infinite UI++, I now have a working solution, so maybe it will help someone else. The main function for extracting current character id: function getCurrentCharPortraitId() local idMapping = {} Infinity_UpdateLuaStats() local curCharId = id local i = 0 while ( i < Infinity_GetNumCharacters()) do Infinity_OnPortraitLClick(i) Infinity_UpdateLuaStats() idMapping[id] = i i = i + 1 end Infinity_OnPortraitLClick(idMapping[curCharId]) return idMapping[curCharId] end It works properly, but has an unwanted subeffect of really clicking on all characters, which triggers selection sounds and subtitles to these sounds. To fix that, I implemented some functions to temporarily turn off both: sounds and feedback. function getSelectionSoundsValues() panelID = 7 soundOptions = {} soundOptions[5] = Infinity_GetOption(5, panelID) -- Character Subtitles option i = 58 while (i < 61) do -- options 58, 59 and 60 control frequency of Selection Sounds, 60 = Never optionVal = Infinity_GetOption(i, panelID) if optionVal == 1 then soundOptions[i] = optionVal end i = i + 1 end return soundOptions end function setOptionsValues(valuesTable, panel) for k, v in pairs(valuesTable) do Infinity_ChangeOption(k, v, panel) end end function silentlyGetCurrentCharPortraitId() initialSoundOptions = getSelectionSoundsValues() noSoundOptions = {[5]=0, [60]=1} setOptionsValues(noSoundOptions, 7) currentCharPortraitId = getCurrentCharPortraitId() setOptionsValues(initialSoundOptions, 7) return currentCharPortraitId end And finally my implementation for Stealth Button: button { area 353 1 52 52 actionBar 5 enabled "buttonArray:GetButtonEnabled(5)" tooltip lua "actionBarTooltip[5]" action "if buttonArray:GetButtonType(5) == 11 then -- type 11 means Stealth charPortraitId = silentlyGetCurrentCharPortraitId() command = 'ReallyForceSpell(' .. 'STEALTH' .. ', Myself)' C:Eval(command, charPortraitId) else buttonArray:OnLButtonPressed(5) end" actionAlt "buttonArray:OnRButtonPressed(5)" } This still has 2 problems: 1. Using Stealth through keyboard button triggers the original Stealth 2. I am not sure how to block the spell from being cast once again, as disabling the button via Opcode doesn't really block it from triggering action function, however Stealth can just protect from itself for its duration, so it's not really important.
  5. It turns out that characters[currentID] or characters[id] doesn't work as I hoped it would... So right now I can only compare names from Infinity_GetPortraitTooltip and Infinity_GetSelectedCharacterName. This works properly, but can still behave strangely if a player decides to create 2 characters with the same name. Is there really no way to get a better solution without EEEx?
  6. Well, i think I have a solution, though it's not working in all cases. I have access to stuff like current character's name and HP, I also have a function Infinity_GetPortraitTooltip. So I can iterate over all portraits and compare the results (name, current and max HP) to determine CHARACTER_ID. Ofc if someone has 2 characters with the same name and HP, then it won't work properly, but I have no idea how to prevent that...
  7. I assumed that it's doable in EEEx, thank you for giving me the exact solution I still hope that it's possible to get proper ID value without EEEx, as it is unfortunately not compatible with MacOS and I'd really like to have a general implementation, not based on player's operating system.
  8. Hello, I'd been working on my modified Stealth ability, but was never satisfied with the fact, that it was a Special Ability, and not something you could trigger via Stealth button from the main Actionbar. Today I've found a potential solution to my problem, that doesn't even require EEEx, however due to my lack of experience with UI modding, I am not sure how to finalize my implementation. I can overwrite the original action from action "buttonArray:OnLButtonPressed(X)" to action "C:Eval('ReallyForceSpell(Myself,MY_STEALTH)', CHARACTER_ID)" and it works well, but I need a way to dynamically pass that "CHARACTER_ID" value, which IESDP describes as: Do you know if such index is possible to get instantly, or if it can be somehow mapped from some other data? PS. this CHARACTER_ID is an optional parameter, but its value is NOT current character ID if I don't provide it at all, so getting rid of it is not the solution. Thank you very much for your help!
  9. Yes, I wanted to take a look at that to learn what I've done wrong and how to avoid that in the future. @Graion Dilach if you decide to help, it will be very much appreciated! What is more, I will be able to study your changes to have a reference for any other animations we might add to the mod.
  10. I am not an experienced modder, so there might be better ways of doing this, but I'd go about it this way: Give the boots an item effect with Timing mode = 2, that uses this opcode #272 (0x110) Spell: Apply Repeating EFF. Set it to apply an effect once every X seconds and the effect should be to cast a spell (opcode 146) at the character. The spell then should have a chance (so that this tripping happens randomly) to apply all the effects you want it to have.
  11. Hi, I would like to create an ability that could be used once every X rounds, but you have an infinite number of uses. I know I can simply use Pocket Plane as a template, removing (opcode 172) and giving (opcode 171) the ability outside of Spell Ability and put an immunity (opcode 206) to that spell for those X rounds. But I'd have to create a portrait icon for that so players know when they can and when they can not use the ability. The problem becomes harder, if I want to introduce more such abilities, as tracking all those immunities becomes hard for players as they see more and more icons. That's why I would like to have an alternate solution. My idea was to delay opcode 171, so that players would see the ability only after specified time, this method removes the necessity of adding portrait icons, however it has a very serious problem - if a character dies before opcode 171 is fired, then I'd need to rest to be able to use the spells once again. Do you know if there's a solution to that problem? Or maybe there's another idea to achieve similar results? Thanks! EDIT: Hmm, the solution might be to also cast a spell giving that ability when our character dies. This however requires "Permanent after death" duration for all such spells, I wonder if applying hundreds of effects with such duration, each using opcode 171 or 172 on one ability won't become a problem? Won't they stack and overload the creature at some point? Or can I dispel all previous instances of those effects given by a specific spell, somehow?
  12. Hello InKal, I am one of the people working on Improved Anvil right now. It's good to see a thread about the mod on other forums than BWL. Maybe you could create a new account and write a PM to Baronius, asking if he could help? Unfortunately this isn't the case. From what I know, up till IAv6.0 almost all resources in the mod were created by directly editing needed files, without using Weidu, and we haven't had enough time to change that in newer versions. This means that IA directly copies and pastes its files into the override folder regardless of the fact that some other mod could have already made some changes to that file. As a result, you may experience issues during your playthrough, even if you didn't get any errors while installing your mods. Hmm, is something wrong with current Chaotic Commands spell? It's very useful protecting from most nasty effects and spells, like enemy sequencers with Greater Malison + Chaos. I've never played with SR mod installed, but from the description of the spell in Readme file, I see that it's extremely powerful and almost completely negates the possibility of being drained. It has long duration and cannot be dispelled by enemy attacks, so you just apply it to all characters and Vampires become just your standard melee fighters. PnP version of NPP works only for 1 hit, which is an overkill, so in IA enemies have a chance to dispel it.
  13. Hello, I am working on a spell that applies invisibility (EFF_1), adds some percentage bonuses to physical damage (EFF_2) and has a new spellstate (EFF_3) as an alternative to backstab. I want it to behave similarly to BS, so it should increase damage only for 1 action and only if the invisibility is present. I can dispel the spell right after my character performs a physical attack, but there are some other actions that can break Invisibility, like starting an offensive spell. Starting a spell is enough for that and there's always a chance to disrupt it or just start another action, so even patching all "hostile" spells to dispel my spell on cast is not enough. That's why I'd like to ask is there a way to dispel a whole spell right after invisibility (which is a part of this spell) is broken? Or will I need to check for invisibility each second?
  14. It is not exactly "aura cleansed", as you can try to go invisible at any moment, even right after casting a spell/using an ability, but yeah - you can click the button only once per 6 seconds. I also want to mimic that, although the more points you put in Hide in Shadows, the shorter the time needed to reuse the ability will be. I might even consider doing some simple GUI changes to remove any usability from Stealth button and make my Hide in Shadows ability block the button (make it gray) for specified period of time, indicating that you can't use the ability yet (ofc disabling the button will only be a visual representation, but underneath I will apply an opcode protecting from my HiS ability). It should be doable without EEEx, from what I remember and I don't need old Stealth behavior. Ahhh, I remember now why I decided to involve enemies in my HiS ability. In general I wanted to preserve the original Stealth behavior, so that it's not hard to go invisible if there are no enemies around, so that monks/rangers can benefit from that, but to reliably hide during combat you'd need high HiS skill and/or additional items. I couldn't figure out a way to enforce that any other way (as described above). Sorry for not mentioning it before, I just came back to modding after a while and I don't remember all the details of my previous ideas.
  15. Thank you for answering! The reason I want to implement it that way is that... I couldn't figure out any other way, that would work instantaneously. I could probably add some checks to global script or even to enemy scripts, but I don't really like that. Firing the checks determining if I manage to go invisible or not only at the moment I use my ability makes the most sense to me. Well, I had another idea, trying to put that % chance to dispel my invisibility into different spell abilities, but sadly opcode 326 does not allow to specify spell level at which the inner spell should be applied. Your idea looks good, it should work, although I still need to create 20 or 50 additional spells, which I really wanted to avoid. I will most probably use your way, if no other solution is mentioned in this thread. That's actually not a problem. It was always weird to me that there are 2 abilities doing the same thing, so you could spend 500 points into something that can't even be used during combat if you're not a Shadowdancer and there were many more reliable ways to go invisible and backstab. That's why I am planning to use only one of them for hiding in shadows and the other one will be used for something else. I have most of that in my head already, I will need to see if I will be able to implement it though I'm planning to reuse most of the behaviors of original Stealth button, so it will be usable at will, not needing aura to be cleansed, it will be usable only once per 6 seconds etc.
  16. Hello, I want to introduce a specific behavior to a special version of Hide in Shadows I'm working on. This version is an innate spell, so I have full control of it. I want the spell to somehow mimic the original Hide in Shadows, but also allow to hide when the enemies are nearby with some % chance and that's the main problem I'm facing now. I want to apply a spell (spell_1) to all enemies in sight when using my HiS ability (ability_1), this spell_1 is supposed to mimic a chance of that enemy to notice my Thief and dispel my original ability_1. I also want spell_1 to have smaller chance of dispelling ability_1 when my Stealth ability is higher, eg. the Thief should have 2% greater chance of successfully going invisible for every 5 points in Stealth, so 20% at 50 Stealth and 80% at 200 Stealth. Is there an easy way to introduce such mechanics without the need of making 50 different spells (which is the easiest way)? I tried to use 50 effects using opcode 326 within spell_1, each casting a spell_2 that has 100% chance to dispel ability_1, but each having only 2% chance to succeed (0-1, 2-3, 4-5 etc) but it seems that for each effect I get a separate roll, so I could have my spell_1 dispelled 5 times by a single spell_1, which is not what I'm looking for.
  17. I need Thieves to become more powerful for our mod (Improved Anvil) and hiding in shadows is their primary class ability, so I'd like to focus on that. Sadly there is no way to rework the original Stealth, which is triggered by a button, so what I am planning to do is to introduce an innate ability, that has unlimited number of uses (like Pocket Plane) and encapsulates Stealth logic with all my improvements. The most important thing I want to achieve is make Hide in Shadows thieving skill more important, so that players really want to put points in it up till 250. For that I want to make very skilled Thieves be able to Hide in Plain Sight (whatever the rationale, enemies can be distracted and Thieves can use that single moment of distraction to vanish, it's a magical world, where monks can kill a dragon with 1 hit, so it's not too far fetched). But hiding in front of enemies should be obviously harder and should require higher Hide in Shadows skill. That's what I want to simulate, by somehow checking if enemies are nearby. So my current plan is that when you use that new Stealth, you cast a spell with AoE and range equal to visual sight range, that works instantaneously and works only on enemies, then through opcode 326 the value of Hide in Shadows is checked and based on that each enemy has some chance to "see" the Thief, which dispels the invisibility and all its benefits. That's probably the easiest way to achieve that, though this thread was created to check if you have any other ideas of how to achieve that, as I'm really a beginner in terms of modding, so any help or constructive critique of my ideas would be very appreciated Regarding thousands of potions that could do the same - I want the Thief to be able to use the ability more often than once per round if he has high enough HiS or proper items, so he can backstab more often even without "Assassinate" HLA. I also want this new Stealth to add some bonuses, that aren't available if you disappear by drinking an Invisibility Potion or get Invisibility cast on you.
  18. Actually, now I thought of another interesting idea. As you can see, I want to enable some form of Hide in Plain Sight for Thieves, so that they still have some chance of hiding if enemies are nearby (and I plan to add other stuff based on how much Hide in Shadows skills you have). Maybe I could make this version of Hide in Shadows also cast a spell which works as an AoE spell targetting only enemies and having extremely fast projectile or "hit immediately" flag is on (so it's almost instantaneous) and if it hits some enemies, then each of them has a chance to dispel it (again, based on player's Hide in Shadows skill, the more you have, the less likely the enemy is to dispel it). I think this should work fine without introducing additional Spell States and using scripts to apply them, what is your opinion on that?
  19. Hello, Let's assume I want to make my version of Hide in Shadows. I want it to have lower chance of success if my Thief sees enemies (or they see him). Sadly the only official check in opcodes works per round, not per spell cast (cast spell on condition). How would you achieve such behavior? Since that's not possible, then some spellstate and opcode 326 would be probably the best solution, but I still have some problems with that... The easiest way would be to fire a script every time the spell is cast, however it looks like #298 (0x12A) Spell Effect: Execute Script cut250a has some hardcoded cutscene start functionality, which makes the UI disappear for a split second and I found no way to go around that. I also thought of some subspell with "out of combat" flag set to true, but if it's a subspell, then this flag is skipped I think and the spell is cast anyway. So are there any better options than patching global script, or all AI scripts, or all location scripts to apply some spellstate ("Seen") to all of my characters? Such state also has to be active for some time and reapplied when its about to expire, if we're still visible, that's pretty messy.
  20. Thank you guys! Now I have a better understanding of what is required to achieve that. And sadly, I don't think it's worth it just for 1 kit.
  21. Thank you for the answer. Yeah, that might be the best option. Actually can I do that? I am trying to give Priest of Helm the ability to put points into Long Swords prof, but It is not visible even if I update Weapprof. It seems that I need to enable pure Cleric to do the same, in order for Long Swords to appear for Priest of Helm.
  22. Hello, I want to enable one Cleric kit to use long swords, but I don't want the base class, nor any other kit to wield them. Is there an easy and clean way to do this? My initial idea was to patch all such swords to enable clerics (flags "Unusable by"), but disable all kits apart from the one I need in "Unusable by (1/4)". This however has 2 problems 1. Base Cleric class can use the weapon 2. EE kits can use the weapon So I thought of patching all Cleric CLAB files to add opcode 181 (Can't Use Itemtype) but I see that these types aren't BG2 specific and instead of "Long swords" I get "Large swords" category. I can't also seem to be able to use 319 (0x13F) Usability: Item Usability to restrict only the base class either. Does anyone have a better solution for such problem? Thanks!
  23. Hey, just like the topic says, I want to introduce a powerful weapon, but I don't want it to be usable as an offhand weapon. I want it to be 1-handed, since it should be a sword usable with shields. Is that possible without some tricky modifications? If it helps, then the weapon should be usable only by a single kit, so maybe there's something that can be done to the kit instead, if changing the weapon does not help?
  24. Sure, I'll be waiting for your PM This is probably the safest way, although both this and static charge (opcode 333) won't be affected by opcode 99 "Spell Effect: Duration Modifier". I wanted to introduce longer spell duration as a bonus for some priests, but I see that it won't affect True Sight, so I might as well code Defensive Harmony, to be similar.
  25. Hey, thank you for your answer! At first I thought of using opcode 333 - static charge, since it's not affected by slow/haste, but I have no experience with it. Your suggestion sounds far better, it didn't occur to me, that I can just delay the effect! I know that I can target only Party members, that was actually the thing that sparked my idea for this spell, otherwise players could just summon as many creatures as they want and get a MASSIVE boost, which shouldn't be gained from a 4th level spell I will test your ideas and take a look at True Sight spell soon. Now the only thing left is that nasty combat log flooding. Yes, I'm working on some ways of bringing more variety to party composition in Improved Anvil.
×
×
  • Create New...