/tg/ Station 13 - Modules - TypesVar Details - Proc Details

progress

A subtype of score linked to a schema table containing objects the player has caught, made, found or otherwise achieved. The value of the score should equal to the length of objects that have been achieved. It also has an unique tab in the UI that lets you review the progress.

Vars

changed_entriesWhen get_changed_rows is called, this list gets filled with the entries to be mass-inserted in the table associated with this progress score.

Procs

get_changed_rowsAlong with the changed rows for the main table, this also populates changed_entries with the entries list
get_progressReturns a list of data that we can use to make an index of contents that progress this award/score.
get_raw_valueWe don't care much about the default value, which is only used for high scores. Instead, we get the entries string from the db.
get_tableGetter proc for the table used to save the entries - ckey association. so we an be extra-safe that data won't be ever inserted in the wrong table. Remember to set this
insert_entriesCalled once the achievements are saved in the DB, since we also have to insert the entries in the associated table.
validate_entriesValidates the list of entries after it's parsed. If TRUE is returned (entries list is valid), 'entries' will be stored in both original_cached_data[type] and data[type] of the achievements holder. Otherwise data[type] will be the new validated_entries list, ensuring that the original data and the new data aren't the same, allowing the new data will be saved.

Var Details

changed_entries

When get_changed_rows is called, this list gets filled with the entries to be mass-inserted in the table associated with this progress score.

Proc Details

get_changed_rows

Along with the changed rows for the main table, this also populates changed_entries with the entries list

get_progress

Returns a list of data that we can use to make an index of contents that progress this award/score.

get_raw_value

We don't care much about the default value, which is only used for high scores. Instead, we get the entries string from the db.

get_table

Getter proc for the table used to save the entries - ckey association. so we an be extra-safe that data won't be ever inserted in the wrong table. Remember to set this

insert_entries

Called once the achievements are saved in the DB, since we also have to insert the entries in the associated table.

validate_entries

Validates the list of entries after it's parsed. If TRUE is returned (entries list is valid), 'entries' will be stored in both original_cached_data[type] and data[type] of the achievements holder. Otherwise data[type] will be the new validated_entries list, ensuring that the original data and the new data aren't the same, allowing the new data will be saved.