ext_ files work exactly like diy_ files, except they're processed into a master diy_ModExtender.txt file whenever the user is about to use the crafting menu. When the crafting menu is accessed, a function is triggered that reads each ext_ file defined within UnReal World's folder, the recipes are organized into a dictionary of submenu's and their respective recipes. each submenu is iterated through and each recipe within that submenu is read line by line checking for extended functions. When a line contains one of these extended functions, that particular function is executed and returns a true or false value, depending on whether the conditions of that functions were met, or not, which in turn determines if the recipe has all the requirements needed to use it. Multiple functions can exist within a single recipe, creating a much richer crafting system with more complex concepts and ideas emerging with each new function I am able to add and implement.
Here is an example of what an ext_file.txt looks like:
(https://i.gyazo.com/a999ffc6ad01d1a597d787826e733c12.png)
Here is the resulting diy_ModExtender.txt file after the functions have been executed and handled:
(https://i.gyazo.com/de3185b48c10e3473b90e4b77e012012.png)
The current functions implemented consist of the following: (green fully working, yellow WIP)
- IsNearNPC(string Name); - returns true if an NPC within 1 square has the designated text within their name
- RecipeKnown(string Name); - returns true if an item with the designated name has been set as a 'recipe' via the [SKILL:recipe] tag (used to restrict an item if a recipe has not been learned yet)
- RecipeUnknown(string Name); - returns true if an item with the designated name is not found/has not been set to a 'recipe' using the [SKILL:recipe] tag (used to 'learn' a recipe)
- HideWhenFalse(); - removes the recipe from the crafting menu if any custom syntax is false, otherwise the recipe is shown.
- {[TILE:FunctionName]} +'Descriptor' - any [TILE:] placed right after a function with the function name as the tile will act as a placeholder for the crafting system to use. This line gets replaced by a passing or failing requirement depending on its relative functions success or failure. Additionally acts as a descriptor for the function
- [SKILL:recipe] - designates this item as a recipe, when a recipe is found in the players inventory or on the ground it is automatically removed from the game. Using RecipeUnknown(name) with the recipe's name as the parameter will hide the recipe once it has been crafted/learned for the first time when used in conjunction with HideWhenFalse(). Currently I have not implemented an 'unlearn' function yet, but it is a possibility if requested/needed.
- PlayerIs(string variable, string comparator, string value); - returns true if the variable compared using a specified comparator with the value is true. Example: PlayerIs(Fatigue,>=,20) (partial implementation/untested)
Unimplemented but planned functions include:
- WorldIs(string variable, string comparator, string value); - same as PlayerIs(), but for world data.
- LastInputIs(string variable, string comparator, string value); - same as PlayerIs(), but for custom player input.
Important Idiosyncrasies:All functions and data are case-sensitive, functions must end with );. Parameters are separated with a , with no spaces IE: (param1,param2,param3) spaces will be considered part of the parameter if you use them (which may be necessary, in some cases). Most functions require a [TILE:FunctionName] tag to be used on the next line as a placeholder ingredient, with the exception of a few special cases (so far, just HideWhenFalse()