Overview:
This trigger is available for either a BasicTE or BasicFR. It is fired when the object's state is changed with the setstate() command.
If the function returns a 0, the object will proceed to change its state. If the function returns -1, the object will do nothing, leaving it in its previous state. If the function returns a positive number, the state will be changed to this new state number.
Access variables:
current: the current object
state: the state that the object is being set to
profile: the state profile that state is being set on. Usually this will be 0 unless the object has defined multiple state profiles.