/tg/ Station 13 - Modules - TypesVar Details

dcs_check_list_arguments

list arguments for bespoke elements are treated as a text ref in the ID, like any other datum. Which means that, unless cached, using lists as arguments will lead to multiple instance of the same element being created over and over.

Because of how it works, this unit test checks that these list datum args do not share similar contents (when rearranged in descending alpha-numerical order), to ensure that the least necessary amount of elements is created. So, using static lists may not be enough, for example, in the case of two different critters using the death_drops element to drop ectoplasm on death, since, despite being static lists, the two are different instances assigned to different mob types.

Most of the time, you won't encounter two different static lists with similar contents used as element args, meaning using static lists is accepted. However, should that happen, it's advised to replace the instances with either string_list(), string_assoc_list(), string_assoc_nested_list() or string_numbers_list(), depending on the contents of the list.

In the case of an element where the position of the contents of each datum list argument is important, ELEMENT_DONT_SORT_LIST_ARGS should be added to its flags, to prevent such issues where the contents are similar when sorted, but the element instances are not.

In the off-chance the element is not compatible with this unit test (such as for connect_loc et simila), you can also use ELEMENT_NO_LIST_UNIT_TEST so that they won't be processed by this unit test at all.

Vars

priorityThis unit test requires every (unless ignored) atom to have been created at least once for a more accurate search, which is why it's run after create_and_destroy is done running.

Var Details

priority

This unit test requires every (unless ignored) atom to have been created at least once for a more accurate search, which is why it's run after create_and_destroy is done running.