Skip to content

Areas

Area altering functions.

ALTER_AREA_REGION_MATCH patch

Alters area regions which match all the match_* variables according to the non-match_ variables.

INT_VARDescriptionTypeDefault
flag_trap_detectablewhether trap is detectablebool
trap_detecttrap detection difficultyint
trap_removetrap removal difficultyint
trappedregion trapped flagbool
STR_VARDescriptionTypeDefault
match_scriptonly alter if script matchesresrefrequired

ALTER_AREA_STRUCTURE_SCRIPT patch

Writes new script to an area structure.

INT_VARDescriptionTypeDefault
indexstructure indexintrequired
STR_VARDescriptionTypeDefault
scriptnew scriptresrefrequired
typecontainer, door or regionstringrequired

GET_AREA_STRUCTURE_CENTER_POINT patch

Returns coordinates of an area structure center point by averaging coordinates of all of its vertices.

INT_VARDescriptionTypeDefault
indexstructure indexintrequired
STR_VARDescriptionTypeDefault
typecontainer, door or regionstringrequired
ReturnDescriptionType
xx coordinateint
yy coordinateint

IS_ITEM_IN_AREA action

Returns 1 if item is sold in the store, 0 otherwise.

STR_VARDescriptionTypeDefault
areaarea resourceresrefrequired
itemitem resourceresrefrequired
ReturnDescriptionType
presentis item somewhere in the area?bool

REPLACE_AREA_ITEM_MATCH patch

Replaces each occurrence of match_item with new_item. Doesn't change charges, flags, etc. Does nothing if match_item wasn't found.

STR_VARDescriptionTypeDefault
match_itemold itemresrefrequired
new_itemnew itemresrefrequired