Icendoan Posted July 21, 2008 Author Share Posted July 21, 2008 Ok, screw the , unless you want to. I have a trouble, which is odd, because it installed fine on my demo, just didn't install when I duplicated it to patch different things. Can you see the issue? COPY_EXISTING_REGEXP GLOB ~zyqi.*s.itm~ ~override~ LAUNCH_PATCH_MACRO ~ADD_ITEM_EFFECT~ SET %opcode% = 12 SET %target% = 2 SET %Parameter2% = 131072 SET %dicenumber% = 1 SET %dicesize% = 3 LAUNCH_PATCH_MACRO ~ADD_ITEM_EFFECT~ SET %opcode% = 60 SET %target% = 2 SET %timing% = 0 SET %duration% = 10 SET %probability1% = 10 It complains that ADD_ITEM_EFFECT is an unknown macro, but it is in the Macros Listing section of the WeiDU readme. Icen Link to comment
Miloch Posted July 21, 2008 Share Posted July 21, 2008 Pretty much figured it out. I would, say, to add a damage header to anything, it would be SET %opcode% 12 Note that would be adding a damage effect to a header (like I said elsewhere) and not, say, a melee header to an item that didn't have one (which would take some code since there isn't a built-in macro for it). Also, you don't need the %% unless you want it to be evaluated within a string or STRING_COMPARE or the like. Oh, and you need to set the variables (or initialise them at least) *before* you launch the macro - above, you're doing it after. Link to comment
Icendoan Posted July 21, 2008 Author Share Posted July 21, 2008 Ah, OK. I will simply set them all to 0 then. Icen Link to comment
Icendoan Posted July 21, 2008 Author Share Posted July 21, 2008 Exactly the same error Here is my updated code; SET opcode = 0 SET target = 0 SET timing = 0 SET parameter1 = 0 SET paraemter2 = 0 SET power = 0 SET mr_ds = 0 SET duration = 0 SET probability1 = 100 SET probability2 = 0 SPRINT resouce "00000000" SET dicenumber = 0 SET dicesize = 0 SET savingthrow = 0 SET savebonus = 0 SET heaer = 0 COPY_EXISTING_REGEXP GLOB ~zyqi.*s.itm~ ~override~ LAUNCH_PATCH_MACRO ADD_ITEM_EFFECT SET %opcode% = 12 SET %target% = 2 SET %Parameter2% = 131072 SET %dicenumber% = 1 SET %dicesize% = 3 LAUNCH_PATCH_MACRO ADD_ITEM_EFFECT SET %opcode% = 60 SET %target% = 2 SET %timing% = 0 SET %duration% = 10 SET %probability1% = 10 Icen Link to comment
Taimon Posted July 21, 2008 Share Posted July 21, 2008 The macros were introduced in WeiDU v208, so check that you are using the newest version. (And post the complete error message, if you are sure you already use v208.) /Edit: And it looks like the vars are reset to default after one run through the macro. Link to comment
Icendoan Posted July 21, 2008 Author Share Posted July 21, 2008 That thought had just occurred to me as well, I am waiting for WeiDU.org page to load Icen Link to comment
Icendoan Posted July 21, 2008 Author Share Posted July 21, 2008 Huh, how odd. I just downloaded v207 from weidu.org. I'll try again Icen Link to comment
Icendoan Posted July 21, 2008 Author Share Posted July 21, 2008 Ah. it installs fine now. I was unpacking to my old WeiDU folder, so it wasn't getting replaced >_< Thanks. Icen Link to comment
Miloch Posted July 21, 2008 Share Posted July 21, 2008 That code is going to add a blank effect for the first one (and possibly bomb unless you've corrected the 'paraemter2' typo) and take the first set of parameters for the second one. The third set isn't going to be used unless you do another LAUNCH_PATCH_MACRO after it. To simplify: you need to set your variables before you launch the macro . Link to comment
Icendoan Posted July 21, 2008 Author Share Posted July 21, 2008 Ah, so I got it in the wrong order, it should be like this; SET Vars = Values LAUNCH_PATCH_MACRO and repeat. Ah well, that is alright. I will rectify that later. Icen Link to comment
Miloch Posted July 21, 2008 Share Posted July 21, 2008 Another thing... since you seem to be working with your own files (or even if you're not), you might consider passing them to an ACTION_FOR_EACH rather than a COPY_EXISTING_REGEXP. I like to avoid the boggy regexp when possible. Link to comment
Guest Guest Posted July 23, 2008 Share Posted July 23, 2008 SPRINT resouce "00000000"... SET heaer = 0 you really have to type carefully. And documentation says header numbering starts with 1. And I think "00000000" isn't exactly null, what you seem to want. Link to comment
Icendoan Posted July 23, 2008 Author Share Posted July 23, 2008 It has been redone for my actual tp2 and it works. Icen Link to comment
Miloch Posted July 23, 2008 Share Posted July 23, 2008 Of course it will work - setting even a bogus variable rarely causes an error. But what the guest means is you want SPRINT resource ~~ unless you're passing an actual resource to be set. And header should be zero if you want to deal with all headers (the default). Link to comment
Icendoan Posted July 23, 2008 Author Share Posted July 23, 2008 Yeah, I do, except for one (throwing axes) and then it will be simple enough. Icen Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.