Sly 1:LOCKG: Difference between revisions
Jump to navigation
Jump to search
Content added Content deleted
TheOnlyZac (talk | contribs) m (→Implementation: Fixed image) |
TheOnlyZac (talk | contribs) (Cleanup, formatting) |
||
Line 3: | Line 3: | ||
| official= y |
| official= y |
||
}} |
}} |
||
⚫ | |||
{{todo|Cleanup, add memory addresses, fix formatting}} |
|||
⚫ | |||
== Structure == |
== Structure == |
||
Line 12: | Line 11: | ||
== Implementation == |
== Implementation == |
||
[[File:Sly 1 SDC 3key unlocking.png|thumb|The cutscene after triggering a LOCKG in {{Sly 1|The Swamp's Dark Center}}]] |
[[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 [[KEY]] for each [[LOCK]] in the <code>apLock</code> array. Each key flies to its assigned lock and then despawns. |
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. |
||
At some point a message with ID 0xXXX{{check}} is sent to the [[ |
At some point a message with ID 0xXXX{{check}} is sent to the [[Sly 1:JT|JT]] struct. This message is processed by <code>HandleJtMessage</code>, which checks if the <code>ckey</code> on the current {{Sly 1|WS|world state}} is greater than the <code>cpLock</code>{{check}} on the LOCKG (i.e. it checks if you have enough keys to open the lock). |
||
If the check passes, it uses the |
If the check passes, it uses the <code>LOCKG->FWS</code> as a bitmask to set the corresponding flag on the FWS of the current WS. It then unlocks the locks and sets the [[Sly 1:SMA|SmaGoal]] based on the <code>LOCKG-> smaGoal</code> pointer. The SMA goal, is processed by {{Sly 1|Splice}} to trigger whatever scripted event happens as a result of the locks being unlocked. |
||
Once all locks complete their unlock [[ASEG|animation]], |
Once all locks complete their unlock [[Sly 1:ASEG|animation]], the associated locks disappear from the world. |
||
== 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. |
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. |
||