Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Helper to build flags: [2:0]=preset, [5:3]=category, [6]=extra
- inline int MAKE_OBJ_INTERACT_FLAGS(int preset/*0..7*/, int category/*0..7*/, bool extra) {
- return (preset & 7) | ((category & 7) << 3) | (extra ? 0x40 : 0);
- }
- // Native
- // SET_OBJECT_INTERACTION_PRESET (0xCAAF2BCCFEF37F77)
- // Writes obj+0x6E9 (flags) and obj+0x6F8 (expiry). No-op without local data slot 0xF.
- NATIVE_DECL void SET_OBJECT_INTERACTION_PRESET(Object object, int flags) {
- invoke<void>(0xCAAF2BCCFEF37F77, object, flags);
- }
- // --- Examples ---
- // 1) Bait: long-lived attractor (~120s), category 0, no extra → 0x04
- {
- Object bait = /* your bait entity */;
- SET_OBJECT_INTERACTION_PRESET(bait, MAKE_OBJ_INTERACT_FLAGS(4, 0, false)); // 0x04
- }
- // 2) Stew (filled): stays interactable ~120s, category 2, no extra → 0x14
- {
- Object stew = /* created stew bowl */;
- // Optional: set visual fill level (your wrapper for 0x669655FFB29EF1A9)
- _SET_FILL_IN_STATE_FOR_ENTITY(stew, /*p1=*/0, /*name=*/"Stew_Fill", /*fill=*/1.0f);
- SET_OBJECT_INTERACTION_PRESET(stew, MAKE_OBJ_INTERACT_FLAGS(4, 2, false)); // 0x14
- }
- // 3) Stew (alt): shorter (~30s) + extra behavior flag → 0x52
- {
- Object stew = /* created stew bowl */;
- SET_OBJECT_INTERACTION_PRESET(stew, MAKE_OBJ_INTERACT_FLAGS(2, 2, true)); // 0x52
- }
- // 4) Coffee mug release: flags only, no timeout (preset=0), cat=2, extra=1 → 0x50
- {
- Object mug = /* your mug entity */;
- SET_OBJECT_INTERACTION_PRESET(mug, MAKE_OBJ_INTERACT_FLAGS(0, 2, true)); // 0x50
- }
Advertisement
Add Comment
Please, Sign In to add comment