Sly 1:LOCKG: Difference between revisions

Started struct fields table
(Added to do tag)
(Started struct fields table)
Line 3:
| official= y
}}
'''LOCKG''' (likelyinternal shortname for "'''lock gLOCK_GROUP'''oal") is a data structure in {{Sly 1}} that handles interaction between Sly and treasure key locks.
 
{{Todo|Replace all the XXX placeholders throughout the article with the actual values}}
 
== StructureFields ==
 
The structure of a LOCKG is as follows:
The LOCKG struct has the following fields:
{{todo|Add struct fields table}}
{{Struct top}}
{{Struct field|offset=|size=4|type=int|name=cpLock|description=Number of locks in the group}}
{{Struct field|offset=|size=32|type=LOCK*[8]|name=apLock|description=Array of lock pointers}}
{{Struct field|offset=|size=4|type=struct SMA*|name=smaGoal|description=The SMA goal to set upon opening the locks.}}
{{Struct bottom}}
 
{{Investigate}}
 
== Implementation ==
 
[[File:Sly 1 SDC 3key unlocking.png|thumb|The cutscene after triggering a LOCKG in {{Sly 1|The Swamp's Dark Center}}]]
When the trigger volume associated with a LOCKG is triggered it sets off a sequence of events. It starts with the animation that spawns a [[Sly 1:KEY]] for each [[Sly 1:LOCK]] in the <code>apLock</code> array. Each key flies to its assigned lock and then despawns.
Line 22 ⟶ 30:
 
== Example ==
 
In Prowling the Grounds, the LOCKG which handles unlocking the cannon is based at address 0xXXXXXX{{check}}. It’s <code>cpLock</code>{{check}} value is 7, meaning there are 7 locks in the <code>apLock</code> array, so when you approach the cannon it checks if you have 7 keys.
 
Line 27 ⟶ 36:
 
== Notes ==
 
* The <code>apLock</code> field is an array of 8 LOCK pointers. You can change these to point to any other entity in the level and they key will fly to and delete that entity instead. If you use this method to delete JT, the cutscene can’t complete and the game softlocks.