The "ds_struct_equals" Function
Syntax#
| Argument | Type | Description |
|---|---|---|
var1 | struct | The source struct to be compared |
var2 | struct | The target struct to compare with |
Description#
Compares the contents of two structs and returns true or false depending on whether the contents and their values are equal. This script will function recursively, also comparing any structs and arrays within the root struct.
Note that volatile data structure and method contents cannot be compared due to GameMaker's handling of references for these types, and as such may behave differently than expected:
- Data structures will be compared by reference only and thus will only return
trueif the exact same structure is referenced. Identical copies will returnfalsebecause each copy has a unique (non-matching) index. - Methods cannot be compared by contents or reference and therefore will always return
trueprovided a method exists at the same location in each struct.

X1