HIST TAGE

HIST TAGE is a CAOS function that returns a given creature's age in ticks when a given life event happened to it.

Usage
Syntax: HIST TAGE moniker(string) event_number(integer)

Returns the creature's age in ticks when the given life event happened to it. If the creature was not in the world, was not born yet, or was fully dead (body disappeared), -1 is returned instead. If the creature was dead, but the body had not yet disappeared, the creature's age in ticks at time of death is returned instead.

Example
As used in Fast Ager Trap to test a creature's age in ticks at the time it aged into an adult: setv va02 hist cage va00 va01 **find 'aged into adult' event doif va02 eq 3 setv va03 hist tage va00 va01 doif va03 le 5000 **code to export creature, etc, continues here
 * va00 is the moniker of the creature the code is looking at
 * va01 is the current aging event in that creature's history that the code is looking at

Used in the creatures history agent to obtain a creature's age at a given event and convert it to hours, minutes, and seconds: setv va11 hist tage ov01 va00 doif va11 < 0 sets va10 read "creature_history" 13 else divv va11 20 setv va13 va11 modv va13 60 divv va11 60 setv va12 va11 modv va12 60 divv va11 60
 * va11 - hours
 * va12 - minutes
 * va13 - seconds