ptifab Posted October 1, 2019 Share Posted October 1, 2019 (edited) Hi, i'm editing the properties of some items, using WEIDU, but when i look at the documentation, there's no parameters to the damage type in the opcode (12). for example : with a bow, the first ability effect is ranged opcode 2, then inside it there's some damage effect opcode 12 (like adding 1D2 magic damage). When i try to edit this effect, there's no parameter to alter the type of damage (acid, magic, etc.) My code : Quote LPF ADD_ITEM_EFFECT INT_VAR header = 1 type = 2 opcode = 12 target = 2 timing = 1 parameter1 = 0 parameter2 = 0 power = 6 resist_dispel = 1 dicenumber = 1 dicesize = 2 END //add 1D2 magic damage inside ranged Item ability 0 Do i have to modify it using another method ? or is there a special parameter i cannot see ? Edited October 3, 2019 by ptifab Quote Link to comment
lynx Posted October 1, 2019 Share Posted October 1, 2019 parameter2? https://gibberlings3.github.io/iesdp/opcodes/bg2tob.htm#op12 Quote Link to comment
ptifab Posted October 1, 2019 Author Share Posted October 1, 2019 It worked, thank you very much ! Quote Link to comment
ptifab Posted October 3, 2019 Author Share Posted October 3, 2019 Hi again, instead of creating a new topic i'm editing this one. so, when i am trying to clone an effect and get a match by resource to select wich header to clone, i have no results so far, so i must missing something. Here's my code Quote LPF CLONE_EFFECT INT_VAR header = 0 header_type = 1 match_opcode = 206 STR_VAR match_resource = ~DVWEB2~ resource = ~SPID134~ insert = ~BELOW~ END i have checked in NI everything is spelled ok, but i have the impression that the code doesn't read the resource, so it can't clone and replace the resource with the new one. Am i doing something wrong ? Quote Link to comment
Jarno Mikkola Posted October 3, 2019 Share Posted October 3, 2019 There's no ~'s in the resources. The numbers don't come with it, so why do the strings come with them. This is true for LPF's... not your own functions. Quote Link to comment
ptifab Posted October 4, 2019 Author Share Posted October 4, 2019 (edited) Thank you for your answer but this has not changed anything. Maybe i've not explained it correctly. I am looking to clone a specific effect with opcode 206 in a list of 5+ of them, so to isolate the one i want to clone, i try to specify the resource to get a match, but so far with my code i have no results. Changing the syntax as you recommended Jarno didn't changed anything. Maybe my code has an error ? Do i have to specify something for the resource (like extension .itm, .wav, etc.) ? Edit : my bad i'm blind, i was not on the correct header level, so that could'nt work, sometime you need to go to sleep before looking correctly on things. Thanks for your time Edited October 4, 2019 by ptifab Quote Link to comment
Mike1072 Posted October 5, 2019 Share Posted October 5, 2019 On 10/3/2019 at 2:02 AM, Jarno Mikkola said: There's no ~'s in the resources. The numbers don't come with it, so why do the strings come with them. This is true for LPF's... not your own functions. This is bad advice. There's nothing wrong with using tildes as string delimiters when supplying STR_VAR parameters. They work the same way there as they do in other places. Quote Link to comment
ptifab Posted October 6, 2019 Author Share Posted October 6, 2019 Thank you Mike, for this confirmation. Quote Link to comment
ptifab Posted October 10, 2019 Author Share Posted October 10, 2019 I'm having difficulties to find the right code to disable the flag for Critical hit aversion. I've found how to enable it Quote WRITE_BYTE 0x1b (THIS BOR 0b00000010) but what is the reverse of that code ? If i want to unset the flag ? Quote Link to comment
Jarno Mikkola Posted October 10, 2019 Share Posted October 10, 2019 WRITE_BYTE 0x1b (THIS BAND 0b11111101) Quote Link to comment
ptifab Posted October 10, 2019 Author Share Posted October 10, 2019 Thanks a lot ! Is there a tuto that explains me this kind of coding because i'm kind of realising i'm a big newbie in that weidu coding world... The WEIDU readme is really entertaining and i've red other's tp2 to learn more, but i feel sometime that i lack some basics in hex coding and read/write stuff. Quote Link to comment
lynx Posted October 10, 2019 Share Posted October 10, 2019 These are basic bitwise operations, nothing specific to weidu, so look that up. Quote Link to comment
Mike1072 Posted October 10, 2019 Share Posted October 10, 2019 We do have a tutorial that includes a discussion on bitwise operations. I've just updated some of the language in it. Changing Class/Race/Kit Restrictions with WeiDU If you have any questions about the tutorial, it has a discussion thread here. Quote Link to comment
ptifab Posted October 11, 2019 Author Share Posted October 11, 2019 Thank you lynx and Mike. I am struggling with bitwise operations for now so i'll have to take my time to understand the logic there (i am clearly not a math or code addict) Quote Link to comment
ptifab Posted November 2, 2019 Author Share Posted November 2, 2019 I would like to copy the strref from an item to apply it to a newly created spell. I've read a lot about strref, but i'm struggling at how keeping it into a variable to copy from a file to one another. Do i have to copy the strref from the first file into a global ? or an exterior file (like ini) ? 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.