Sly 1:LOCKG
Data Structure | |
---|---|
Game | Sly Cooper and the Thievius Raccoonus |
Official Name | Yes |
LOCKG (likely short for "lock goal") is a data structure in Sly Cooper and the Thievius Raccoonus that handles interaction between Sly and treasure key locks.
Structure[edit | edit source]
The structure of a LOCKG is as follows:
To Do: Add struct fields table |
Implementation[edit | edit source]

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 apLock
array. Each key flies to its assigned lock and then despawns.
At some point a message with ID 0xXXX[check] is sent to the JT struct. This message is processed by HandleJtMessage
, which checks if the ckey
on the current world state is greater than the cpLock
[check] on the LOCKG (i.e. it checks if you have enough keys to open the lock).
If the check passes, it uses the LOCKG->FWS
as a bitmask to set the corresponding flag on the FWS of the current WS. It then unlocks the locks and sets the SmaGoal based on the LOCKG-> smaGoal
pointer. The SMA goal, is processed by Splice to trigger whatever scripted event happens as a result of the locks being unlocked.
Once all locks complete their unlock animation, the associated locks disappear from the world.
Example[edit | edit source]
In Prowling the Grounds, the LOCKG which handles unlocking the cannon is based at address 0xXXXXXX[check]. It’s cpLock
[check] value is 7, meaning there are 7 locks in the apLock
array, so when you approach the cannon it checks if you have 7 keys.
If the check fails, nothing happens. If the check passes, it sets the SMA goal to 0xXXXXXX[check], which seems to handle removing the lid from the cannon.
Notes[edit | edit source]
- The
apLock
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.