temnix Posted May 20, 2021 Share Posted May 20, 2021 (edited) Previously on Apparently No One Knows... Kreggy: I want to set a flag for all items in an area, but the REPLACE_AREA_ITEM action needs a concrete item name in its new_item parameter. McBee: What do you need that for? Spike Budda, entering with cronies: He wants to want to make them all STOLEN. He should work for me. Flash, bang! Wrrr! And now the conclusion... Without a legitimate way to set a flag I took to applying REPLACE_TEXTUALLY to ARE files. While "/(/b.+/b/)" "/1" done to an ARE file replaces items with themselves, it can't set a flag. Expressions from REPLACE_TEXTUALLY are not variables that can be used elsewhere in code, which made my attempts to use INNER_ACTION and check for ~/1~.ITM fail. Otherwise I would know what to add to that textual replacement: the STOLEN flag for a container item replaces the tenth zero in the 14-zeroes white space after the resource name. The view from Notepad: MISC07 and most of the other items have been flagged as STOLEN by hand. The same view from Notepad++: I can replace the straight 14 zeroes with zeroes and the STOLEN mark, but I need to select items in this list of resources. An item's SOURCE_RES is going to be at least several characters long, but REPLACE_TEXTUALLY EXACT_MATCH "/(/b.+++/b/) " "/1 thatsymbol,itwon'tshowhere " ends up hanging up Weidu. Does anybody have a better suggestion? Edited May 20, 2021 by temnix Quote Link to comment
Luke Posted May 20, 2021 Share Posted May 20, 2021 Try this: COPY_EXISTING "your_area.are" "override" GET_OFFSET_ARRAY "containers" ARE_V10_CONTAINERS PHP_EACH "containers" AS "ind" => "cont_offset" BEGIN GET_OFFSET_ARRAY2 "items" "%cont_offset%" ARE_V10_ITEMS PHP_EACH "items" AS "ind2" => "item_offset" BEGIN WRITE_LONG ("%item_offset%" + 0x10) (THIS | BIT2) // Simply add the STOLEN flag, leave the other flags intact END END BUT_ONLY Quote Link to comment
temnix Posted May 20, 2021 Author Share Posted May 20, 2021 Spike Buddha sends his regards. 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.