Jump to content

Setting flags for area items, redux


Recommended Posts

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:

Flags.jpg.1fea115f62ebe081b1db068025b40f81.jpg

MISC07 and most of the other items have been flagged as STOLEN by hand. The same view from Notepad++:

866511594_Flagsb.thumb.jpg.a4a3ccda49ac3ef27584240341416446.jpg 

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 by temnix
Link to comment

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

 

Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...