Jump to content

I am honestly confounded by this.


Icendoan

Recommended Posts

Ok, screw the :fish:, 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
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

Exactly the same error :fish:

 

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

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

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 :fish:.

Link to comment

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
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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...