Backported "set_scr_name" script function from 4.x

Updated documents for the function.
Changed some make_pair to bare pair for map insertion.
This commit is contained in:
NovaRain
2021-10-05 22:04:12 +08:00
parent e3cb0bbaf5
commit 5c1cccae8f
13 changed files with 162 additions and 9 deletions
+2
View File
@@ -350,6 +350,7 @@
#define set_object_data(obj, offset, value) sfall_func3("set_object_data", obj, offset, value)
#define set_outline(obj, color) sfall_func2("set_outline", obj, color)
#define set_quest_failure_value(gvar, threshold) sfall_func2("set_quest_failure_value", gvar, threshold)
#define set_scr_name(name) sfall_func1("set_scr_name", name)
#define set_terrain_name(x, y, name) sfall_func3("set_terrain_name", x, y, name)
#define set_town_title(areaID, title) sfall_func2("set_town_title", areaID, title)
#define set_unique_id(obj) sfall_func1("set_unique_id", obj)
@@ -366,6 +367,7 @@
#define tile_by_position(x, y) sfall_func2("tile_by_position", x, y)
#define tile_refresh_display sfall_func0("tile_refresh_display")
#define unjam_lock(obj) sfall_func1("unjam_lock", obj)
#define unset_scr_name sfall_func0("set_scr_name") /* sets the name of the script object from pro_*.msg instead of scrname.msg */
#define unset_unique_id(obj) sfall_func2("set_unique_id", obj, -1)
#define unwield_slot(critter, slot) sfall_func2("unwield_slot", critter, slot)
#define win_fill_color(x, y, width, height, color) sfall_func5("win_fill_color", x, y, width, height, color)
@@ -963,6 +963,15 @@ sfall_funcX metarule functions
- `gvarNumber`: the number of the global variable controlling the quest
- `thresholdValue`: the value of the global variable at which the quest is counted as a failure
----
#### set_scr_name
`void sfall_func1("set_scr_name", string name)`
- Overrides the name of the script object that was set from **scrname.msg**
- The changed name will be reset each time the player leaves the map or reloads the game
- Passing an empty string ("") to the `name` argument or omitting it will allow the game to get the name for the object from pro_*.msg files
- The function can override the name only once for the same object until reset
- __NOTE:__ this function is intended for use in normal game scripts
****
_See other documentation files (arrays.md, hookscripts.md) for related functions reference._