h4e Packages API Build 2402202001 for Transport Fever 2.
The h4e Packages API is the basis of my mods. This mod provides my mods with various functions and information.
– Central provision of the variable game.h4e_api, with just one include in the API, all code is therefore usable for all other mods that follow.
– Debug functions like var_dump, error or message debug information in the stdout.txt.
– Central control of the debug status via game.h4e_api.debug.state.
– The debug status can also be activated with the Mod h4e Packages API Debug Mode Mod, here too the debug mode must be activated according to the Packages API in the loading order.
– delete, delete a table param.
– replace, replaces any text with a specified text.
– strlen, counts the length of a variable and returns the result.
– is_nil, checks whether a variable is nil.
– search, searches for a defined text e.g. “a” in a defined variable e.g. “abc”, the function is found true is reported.
– table_length, counts the length of a table and returns the result.
split, divides a variable at a certain point, e.g. at a “.”. Then returns the result in an array.
The functions were named for the purest of intentions because otherwise I work in the PHP area and the functions are more likely to be found under such a name.
It is allowed to create your own mods and to use the functions of the packages API. For further processing of other mods, I first ask for a message, without approval no publication or disclosure.
The mod must be in the loading order before all other mods that I have developed.
Credits: homieforever, Angry_CJ