MindTyrant Posted October 5 Posted October 5 I apologize if I do not know the proper terms for everything, I am learning coding still. But I am inquiring about Opcode 190, modifying Attack Speed. I am debugging timings of kit related powers and the Timing mode for Instant/Permanent says, "If the opcode doesn’t directly modify a STAT/STATE in the target’s CRE file, then it will last until removed (or it self-terminates)." My kit uses three stances that the player can swap between, and one of them increases attack speed. After reading this, however, I am very much concerned. If Opcode 190 directly modifies STATE, removing the power that granted it does nothing. This would mean if a player uses Power C, which grants attack speed modifier of 2 and removes powers A and B, then uses power A which gives To Hit bonus of 2 and removes power B and C, and finally uses Power B, which gives Aromr Class bonus of 2 and removes power A and C, they will have BOTH attack speed modifier of 2 and Armor Class bonus of 2, but no To hit bonus. Is this right? I am having a tough time tracking this because it will not display speed modifiers on the default UI, or at least the dragonspear UI that comes with EET. I tested it by having it display the enchanted weapon icon as well, and it does display. So, I am fairly sure I am adding effects correctly. But since these icons do not modify state, the fact they properly disappear means nothing. Any advice is appreciated. Quote
lynx Posted October 5 Posted October 5 Err, what do you want to achieve? The opcode modifies a stat (sometimes called PHYSICALSPEED), but unless you use some permanent timing, the modification will go away as soon as you stop applying it (eg. the duration expires). If you use permanent timing and handle the removal manually, all should be fine. Quote
MindTyrant Posted October 5 Author Posted October 5 1 hour ago, lynx said: Err, what do you want to achieve? The opcode modifies a stat (sometimes called PHYSICALSPEED), but unless you use some permanent timing, the modification will go away as soon as you stop applying it (eg. the duration expires). If you use permanent timing and handle the removal manually, all should be fine. So then Opcode 190 doesn’t directly modify a STAT/STATE in the target’s CRE file? Quote
jmerry Posted October 5 Posted October 5 So, as an instructive example, let's look at SPCL143, the spell that grant's the kensai's bonus to weapon speed. The class's ability table applies the spell at levels 1, 4, 8, 12, 16, 20, 24, 28, 32, 36, and 40. The spell has ten abilities, each of which has a single opcode 190 effect with timing mode 9. The values for the speed change are 1 at level 1, 2 at level 4, 3 at level 8, 4 at level 12, and so on until 10 at level 36. Now, I looked up an old save, and that kensai 13 -> thief dual had four instances of opcode 190 effects on their creature file, all from that SPCL143 source. Conclusions: - Unlike some stat-modifying opcodes (e.g. #44), timing mode 9 on opcode 190 leaves effects in the CRE file. They can be removed. - New instances of opcode 190 with timing mode 9 override older ones. They don't stack with each other, and only the newest instance matters. - The kensai speed bonus is one point better than you might expect from the description. - Some very funky things can happen with dual-class kensais; a kensai->X character that leaves the party and then returns can have their weapon speed boost improved as class/kit abilities are stripped and then reapplied with the character's new innate caster level. Quote
subtledoctor Posted October 5 Posted October 5 If you want to be sure the effect can be removed, then don’t use timing mode 1; instead use timing mode 0 with a very long duration (I use 100,000,000). Quote
MindTyrant Posted October 6 Author Posted October 6 2 hours ago, subtledoctor said: If you want to be sure the effect can be removed, then don’t use timing mode 1; instead use timing mode 0 with a very long duration (I use 100,000,000). So what you are saying is that if I use a spell that includes Opcode 190 to increase attack speed with timing mode 0 and a 7,200 duration (one in game day I believe), then use another spell that includes Opcode 321 type 0 to remove the resource first spell, there will be as if there was no attack speed modifier in the first place? To complicate things further, what if, as a separate applied power, the character gets +1 to hit, damage, and attack Speed. To uses an innate spell granting +3 to attack speed for 7200 seconds. Then uses another one that removes the other innate spell, but gives +2 to hit (incremental). Would he have to hit/damage/speed of 1/1/1 at first, then 1/1/3, and finally 1/3/1? Or would the last one be 1/3/0 now? Quote
MindTyrant Posted October 6 Author Posted October 6 Alternatively, is there any way to see Speed modifiers in the UI? Quote
lynx Posted October 6 Posted October 6 Create a script and have it print something when you press a hotkey. You can cover all 10 cases by just having several blocks (like an unrolled loop) and checking the stat via CheckStat. Quote
MindTyrant Posted October 6 Author Posted October 6 2 hours ago, lynx said: Create a script and have it print something when you press a hotkey. You can cover all 10 cases by just having several blocks (like an unrolled loop) and checking the stat via CheckStat. But what I need to test is how the game engine works, not how Weidu installs it. I need to see attackspeed evolves when using these spells in the game. The problem is in the UI, it doesn't show attackspeed as far as I can tell. If you are talking about coding a new hotkey into the game, that is over my head for now... Quote
lynx Posted October 6 Posted October 6 It'd be in an ai script like any other (dplayer3 iirc), so you could inspect the value of the stat at runtime. Quote
Bubb Posted October 6 Posted October 6 (edited) op190 is really simple. It just sets the PHYSICALSPEED stat; that's it. None of the timing mode shenanigans of other opcodes. int CGameEffectPhysicalSpeed::ApplyEffect(CGameSprite* pSprite) { pSprite->m_derivedStats.m_nPhysicalSpeed = (short)*(char*)&this->m_effectAmount; return 1; } If you use EEex you can dump the current stat value to the combat log via the debug console. Hover your cursor over the target and run this command: Infinity_DisplayString(EEex_GameObject_GetUnderCursor():getStat(78)) To see the latest speed factor used by a creature you can use this command: Infinity_DisplayString(EEex_GameObject_GetUnderCursor().m_speedFactor) Note that this value is only valid after the creature has taken a swing, and that the value has a random component as well. Edited October 6 by Bubb Syntax Highlighting Quote
jmerry Posted October 6 Posted October 6 3 hours ago, Bubb said: None of the timing mode shenanigans of other opcodes. Just effect application order shenanigans. The last-applied op190 effect wins. Quote
MindTyrant Posted October 7 Author Posted October 7 On 10/5/2024 at 11:28 AM, jmerry said: The kensai speed bonus is one point better than you might expect from the description. What do you by this? In fact, rereading this; if I understand this correctly, this answers my questions. It sounds like what should happen if.. I use an applied power with Opcode 190 with a value 1 and a timing of 9, and then ten minutes later, granted ability 1 fires off, with Opcode 190 with a value of 3 and timing of 0 with a 7200 duration, and finally granted ability 2 fires off with Opcode 321 with it type being 2 and the key being ability 1 the second spell... This sounds like physical Speed should evolve with it being set at 1 when character loads with applied power. Then when granted ability 1 fires it should become 3 (because it doesn't stack). Finally, granted ability 2 fires off. Does this sound right to you? Quote
jmerry Posted October 7 Posted October 7 The description of the kensai speed bonus: "– -1 bonus to Speed Factor every 4 levels." The actual bonus: -1 at level 1, -2 at level 4, -3 at level 8, and so on. One for every four levels, and then one more. That's what I meant by "one point better". Quote
Recommended Posts
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.