temnix Posted August 18, 2020 Share Posted August 18, 2020 This piece of code is from CamDawg. I asked him for clarification about it, but I'm getting impatient with completing my mod. I hope he won't mind that I'm casting about here without waiting longer. The code is for adding cures to a temple. I need to add three. This does the job for the first cure, but something needs to be adjusted, offsets rewritten, for the second and so on. I just don't know what, and I really don't care to delve into the great science of hexadecimal numbers and coding to get this feature done. I'll acknowledge your contribution in the module, of course. READ_LONG 0x70 cure_off ELSE 0 READ_LONG 0x74 cure_num ELSE 0 SET insert = cure_num INSERT_BYTES (cure_off + (insert * 0x0c)) 0x0c WRITE_ASCII (cure_off + (insert * 0x0c)) ~SPELL~ // resref WRITE_LONG (cure_off + 0x08 + (insert * 0x0c)) 100 // price WRITE_LONG 0x74 (cure_num + 1) PATCH_FOR_EACH offset IN 0x2c 0x34 0x4c BEGIN PATCH_IF offset > cure_off BEGIN WRITE_LONG offset (THIS + 0x0c) END END So, this business needs to be repeated just below for the next cure. How exactly? Quote Link to comment
argent77 Posted August 18, 2020 Share Posted August 18, 2020 You might want to take a look at this WeiDU function: ADD_STORE_CURE It's one of several store-related (still) undocumented functions that are part of the base WeiDU interpreter (so no external library needed). The general syntax is not unlike other WeiDU functions: COPY_EXISTING ~mystore.sto~ ~override~ LPF ADD_STORE_CURE INT_VAR price = 100 STR_VAR spell_name = ~MYCURE~ position = ~LAST~ END BUT_ONLY Quote Link to comment
temnix Posted August 18, 2020 Author Share Posted August 18, 2020 (edited) Well, that certainly makes it easier. And just as I pulled through with Camdawg's code thanks to luck and brains. Edited August 20, 2020 by temnix 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.