Advertisement
dannyb21892

Actor Parameter Unpacking Example

Nov 12th, 2019
276
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.09 KB | None | 0 0
  1. En_Door
  2. Door
  3. Id: 0009
  4. Object: 0001
  5. //Model dependent on current scene
  6.  
  7. v &>> 0xFC00 = Transition Actor List Identifier //Reserved for use by the game engine
  8. v &>> 0x0380 = Type
  9. 0000 [0000] Loads Rooms
  10. 0001 [0080] Small Key Locked //Loads Rooms. If double doors, then the left door is locked on one side and the right door is locked on the other.
  11. 0002 [0100] Loads Rooms
  12. 0003 [0180] Doesn't Load Rooms //Used for scene transitions
  13. 0004 [0200] Ajar //Slams shut on approach, then says "It won't open!" if you try to interact with it.
  14. 0005 [0280] Talking Door
  15. 0006 [0300] Time Locked Wooden Door //Dampe's Shack, unlocked between 18:00 to 21:00, else displays message
  16. 0007 [0380] Loads Rooms
  17. v &>> 0x0040 = Double Door
  18. v &>> 0x003F = Switch Flag //Used by locked doors only
  19. v &>> 0x003F = Message ID (+0200)
  20. _______________________________________________________________________________________________________________________________________
  21. You find a door with Params = 01BF
  22.  
  23. 01BF = 0000 0001 1011 1111 (01bf is door params)
  24. 0380 = 0000 0011 1000 0000 (0380 is door type mask operand)
  25. &_________________________
  26. type = 0000 0001 1000 0000
  27.  
  28. 0380 ends with 7 zeros, so shift right by 7 to get door type = 0b11 = 3 (or just dont shift and see that the result of the & operation is 0180 which is the bracketed value in the actor info)
  29.  
  30. 01BF = 0000 0001 1011 1111 (01bf is door params)
  31. 0040 = 0000 0000 0100 0000 (0040 is double door mask operand)
  32. &_________________________
  33. type = 0000 0000 0000 0000
  34.  
  35. 0040 ends with 6 zeros, so shift right by 6 to get double door = 0b0 = 0
  36.  
  37. 01BF = 0000 0001 1011 1111 (01bf is door params)
  38. FC00 = 1111 1100 0000 0000 (FC00 is Transition Actor List Identifier mask operand)
  39. &_________________________
  40. type = 0000 0000 0000 0000
  41.  
  42. FC00 ends with 10 zeros, so shift right by 10 to get Transition Actor List Identifier = 0b0
  43.  
  44. 01BF = 0000 0001 1011 1111 (01bf is door params)
  45. 003F = 0000 0000 0011 1111 (003F is Message ID mask operand)
  46. &_________________________
  47. type = 0000 0000 0011 1111
  48.  
  49. 003F ends with 0 zeros, so shift right by 0 to get Message ID = 0b3F
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement