weak_ref_create

With this function you can create a weak reference to a struct which can then be used to check if the struct is still "alive" (referenced) or not in the game. You supply the reference to the struct you want to track, and the function will return another struct which is a weak reference to that struct.

Usage Notes

 

Syntax:

weak_ref_create(struct_to_track);

ArgumentTypeDescription
struct_to_trackStruct or MethodThe struct or method that you want to create a weak reference for

 

Returns:

Struct Weak Reference

 

Example:

inventory_ref = weak_ref_create(inventory);

The above code creates a weak reference to a struct and stores it in an instance variable for later use.