Guest User

Untitled

a guest
Sep 10th, 2025
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.53 KB | None | 0 0
  1. // Helper to build flags: [2:0]=preset, [5:3]=category, [6]=extra
  2. inline int MAKE_OBJ_INTERACT_FLAGS(int preset/*0..7*/, int category/*0..7*/, bool extra) {
  3. return (preset & 7) | ((category & 7) << 3) | (extra ? 0x40 : 0);
  4. }
  5.  
  6. // Native
  7. // SET_OBJECT_INTERACTION_PRESET (0xCAAF2BCCFEF37F77)
  8. // Writes obj+0x6E9 (flags) and obj+0x6F8 (expiry). No-op without local data slot 0xF.
  9. NATIVE_DECL void SET_OBJECT_INTERACTION_PRESET(Object object, int flags) {
  10. invoke<void>(0xCAAF2BCCFEF37F77, object, flags);
  11. }
  12.  
  13. // --- Examples ---
  14.  
  15. // 1) Bait: long-lived attractor (~120s), category 0, no extra → 0x04
  16. {
  17. Object bait = /* your bait entity */;
  18. SET_OBJECT_INTERACTION_PRESET(bait, MAKE_OBJ_INTERACT_FLAGS(4, 0, false)); // 0x04
  19. }
  20.  
  21. // 2) Stew (filled): stays interactable ~120s, category 2, no extra → 0x14
  22. {
  23. Object stew = /* created stew bowl */;
  24. // Optional: set visual fill level (your wrapper for 0x669655FFB29EF1A9)
  25. _SET_FILL_IN_STATE_FOR_ENTITY(stew, /*p1=*/0, /*name=*/"Stew_Fill", /*fill=*/1.0f);
  26. SET_OBJECT_INTERACTION_PRESET(stew, MAKE_OBJ_INTERACT_FLAGS(4, 2, false)); // 0x14
  27. }
  28.  
  29. // 3) Stew (alt): shorter (~30s) + extra behavior flag → 0x52
  30. {
  31. Object stew = /* created stew bowl */;
  32. SET_OBJECT_INTERACTION_PRESET(stew, MAKE_OBJ_INTERACT_FLAGS(2, 2, true)); // 0x52
  33. }
  34.  
  35. // 4) Coffee mug release: flags only, no timeout (preset=0), cat=2, extra=1 → 0x50
  36. {
  37. Object mug = /* your mug entity */;
  38. SET_OBJECT_INTERACTION_PRESET(mug, MAKE_OBJ_INTERACT_FLAGS(0, 2, true)); // 0x50
  39. }
  40.  
Advertisement
Add Comment
Please, Sign In to add comment