ptifab Posted February 11, 2020 Author Share Posted February 11, 2020 (edited) Does anyone knows how to code the special parameter in a saving throw effect ? I tried to set the "save for half" (bit8) parameter but with no results whatsoever... Edited February 12, 2020 by ptifab Quote Link to comment
Gwendolyne Posted February 12, 2020 Share Posted February 12, 2020 (edited) Here is a piece of code I use to make an op#12 (half damage) written for classic game compatible with EE: COPY ~%MOD_FOLDER%/kits/Objets/GWFlePu.itm~ ~override/GWFlePu.itm~ SAY NAME1 @7729309 SAY NAME2 @7729309 LPF ALTER_ITEM_HEADER INT_VAR projectile = (IDS_OF_SYMBOL (projectl GWFlePu) + 1) END // 3-Arrow Exploding (ARROWEX) : Only Enemy PATCH_IF (GW_EE) BEGIN LPF DELETE_EFFECT INT_VAR multi_match = 1 match_opcode = 12 match_savingthrow = 0 END LPF ALTER_EFFECT INT_VAR match_opcode = 12 dicenumber = 4 special = 256 END END BUT_ONLY In classic games, you have 2 op#12 effects (one for each half damage). LPF DELETE_EFFECT deletes op#12 dealing with save for half and LPF ALTER_EFFECT modifies the remaining op#12 to suit EE save for half coding: it doubles dicenumber parameter and adds BIT8 value at special offset (256). Edited February 12, 2020 by Gwendolyne Quote Link to comment
ptifab Posted February 13, 2020 Author Share Posted February 13, 2020 (edited) Thanks @Gwendolyne ! i've already tried this parameter (special = 256) but it's for a cast spell opcode (146), and weidu juste write a 256 number instead of checking the flag at bit8.. i don't understand why. Is that a bug ? here's my code LPF ALTER_EFFECT INT_VAR match_opcode = 215 opcode = 146 target = 2 power = 3 timing = 1 duration = 0 savingthrow = 2 special = 256 STR_VAR resource = ~IUBURN2~ END Edited February 13, 2020 by ptifab Quote Link to comment
Gwendolyne Posted February 13, 2020 Share Posted February 13, 2020 afaik, BIT8 save for half does not work for op#146. Use it with all IUBURN2 effects. Quote Link to comment
ptifab Posted February 13, 2020 Author Share Posted February 13, 2020 hey, i have just tried as you said, and tested some other opcodes to same conclusion, i cannot add the flag in opcode #146 as you said, for #12 it works... it's logical after some thinking though, you can't half the damage of a cast spell thanks again @Gwendolyne Quote Link to comment
ptifab Posted March 8, 2020 Author Share Posted March 8, 2020 (edited) Hi again. I'm actually trying to replace some text into a dialogue. In 1 state (109), i want to change both the trigger and the action, but only some of the text not everything. (here it is the dagg03 that i want to replace for a dagg15) While this code works (in a .d file) ALTER_TRANS ~THALAN~ BEGIN 109 END BEGIN 1 END BEGIN "ACTION" ~TakePartyGold(4000) DestroyGold(4000) TakePartyItemNum("MISC75",1) // Dagger of Venom +2 DestroyItem("MISC75") // Dagger of Venom +2 TakePartyItemNum("dagg15",1) // Heart of the Golem +2 DestroyItem("dagg15") // Heart of the Golem +2 TakePartyItemNum("potn14",1) // Potion of Speed DestroyItem("potn14") // Potion of Speed TakePartyItemNum("potn32",1) // Strange Potion of Antidote DestroyItem("potn32") // Strange Potion of Antidote GiveItemCreate("thdagg01",Player1,1,1,1) // Dagger of Venom +3 CreateVisualEffect("spcrtwpn",[330.230])~ END ALTER_TRANS ~THALAN~ BEGIN 109 END BEGIN 1 END BEGIN "TRIGGER" ~PartyHasItem("MISC75") // Dagger of Venom +2 PartyHasItem("dagg15") // Heart of the Golem +2 PartyHasItem("potn14") // Potion of Speed PartyHasItem("potn32") // Strange Potion of Antidote PartyGoldGT(3999)~ END but it changes everything, while i just want to edit the item (here it is the dagg03 for a dagg15) But that code (in my .tpa) doesn't work at all ACTION_IF (FILE_EXISTS_IN_GAME ~THALAN.DLG~) THEN BEGIN <<<<<<<< items_rev_ultimate/inlined/thalan_ir_compatibility.d REPLACE_TRANS_ACTION ~THALAN~ BEGIN 109 END BEGIN 1 END ~TakePartyItemNum("dagg03",1) // Heart of the Golem +2 DestroyItem("dagg03") // Heart of the Golem +2~ ~TakePartyItemNum("dagg15",1) // Dagger +2 DestroyItem("dagg15") // Dagger +2~ REPLACE_TRANS_TRIGGER ~THALAN~ BEGIN 109 END BEGIN 1 END ~PartyHasItem("dagg03") // Heart of the Golem +2~ ~PartyHasItem("dagg15") // Dagger +2)~ >>>>>>>> COMPILE ~items_rev_ultimate/inlined/thalan_ir_compatibility.d~ END // END ACTION_IF There is no error during the weidu installation. Did i missed something ? Edited March 8, 2020 by ptifab Quote Link to comment
CamDawg Posted March 8, 2020 Share Posted March 8, 2020 One of the things to be careful of in these situations is that editors like NI will show helpful comments which actually are not in the code, e.g. TakePartyItemNum("dagg15",1) // Dagger +2 likely isn't matching because it's actually just TakePartyItemNum("dagg15",1) in the code. If you find yourself struggling with text replacements in scripts or dialogues, it can sometimes be very useful to decompile the bcs/dlg at the command-line with WeiDU and check the output. Quote Link to comment
ptifab Posted March 9, 2020 Author Share Posted March 9, 2020 @CamDawg You saved my night ! Thanks a lot Quote Link to comment
ptifab Posted March 10, 2020 Author Share Posted March 10, 2020 I'm trying to patch items by looking at a specific effect here it's opcode #101 with parameter 78 (disease) i've tried this code : COPY_EXISTING_REGEXP GLOB ~^.+\.itm$~ override PATCH_IF SOURCE_SIZE>0x71 BEGIN READ_LONG 0x6a ef_off READ_SHORT 0x70 ef_num FOR (i=0;i<ef_num;++i) BEGIN READ_SHORT ef_off+i*0x30 opcode PATCH_IF opcode = 101 BEGIN // immunity to effect READ_LONG ef_off+i*0x30+8 effect PATCH_IF effect = 78 BEGIN // disease LPF ADD_ITEM_EQEFFECT INT_VAR opcode = 142 target = 1 parameter2 = (icon_index - 3) timing = 2 END // add portrait icon END END END END // END REGEXP It adds correctly the #opcode 142 but it's duplicated multiple times. i must have forget to limit the array but i don't know where to put that. If someone can help me on this one ? Quote Link to comment
CamDawg Posted March 10, 2020 Share Posted March 10, 2020 Imagine this: You look at effect 0. It's not a match, so the loop goes to the next effect. You look at effect 1. It's a match, so you insert your new effect which, by default, gets added as effect 0. The loop moves on. You look at effect 2, which thanks to the effect you just added, is actually effect 1 again. Since it's still a match, another effect gets added as effect 0. You look at effect 3, which was previously effect 2, which was previously effect 1... So, two suggestions: either add insert_point = 999 as an option, or simply use: COPY_EXISTING_REGEXP GLOB ~^.+\.itm$~ override CLONE_EFFECT INT_VAR silent = 1 match_opcode = 101 match_parameter2 = 108 opcode = 142 parameter2 = (icon_index - 3) END // add whatever else you need BUT_ONLY Quote Link to comment
ptifab Posted March 10, 2020 Author Share Posted March 10, 2020 i understand now, i had found another solution by putting a safecheck, (if it found once it stop the loop), but thanks a lot for your advice, i understand my mistake ! @CamDawg Quote Link to comment
ptifab Posted March 24, 2020 Author Share Posted March 24, 2020 Hi everyone, i'd like to know the importance of the "Power" parameter in the EE engine ? i see that spells do have actually this parameter set (the level of the spell in general), but on some items some have and others don't, especially in mods. Is it important to set a level on this, and if yes how the game process it . Is it for resistances ? Quote Link to comment
CamDawg Posted March 24, 2020 Share Posted March 24, 2020 When you see a spell say it makes you immune/blocks/absorbs spells of level X, what the engine is actually checking is the power field on an effect. A power level of 0 will bypass any such spell protections. Generally, effects from weapons should use 0 and spells should use their level as their power level. Anti-magic spells will sometimes use 0 if they're supposed to bypass spell protections (e.g. Dispel Magic) and summoning spells generally use 0 so they don't fail if you target someone with the spell. Quote Link to comment
ptifab Posted March 24, 2020 Author Share Posted March 24, 2020 @CamDawg ok i understand now, thanks for the explanation ! Quote Link to comment
Luke Posted March 26, 2020 Share Posted March 26, 2020 On 3/24/2020 at 2:20 PM, CamDawg said: Generally, effects from weapons should use 0 What about Magic Resistance and Primary / Secondary Type? Is there a general template? Quote Link to comment
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.