Sync issues with custom grabbable behavior

wibblus

Member
Modder
Mar 24, 2024
21
28
430
has anyone created custom behaviours that use the grabbable interact type ? i've gotten everything to work, except the object drop and throw functions aren't being synced with other players (the object remains in the HELD_HELD state for all other players). from what i can tell reading through the game's interaction code, its some issue with network_send_object()

this function (mario_drop_held_object()) along with mario_throw_held_object() run for only the local player, and then use a network_send_object() call, which seems to be the culprit

Ha4MgKL.png


my behavior code is set up near-identically to other grabbable objects like bobombs; it simply won't change held state for other players due to this function not syncing the object. Other players are able to pick up the object just fine and it enters its HELD_HELD state (where rendering and tangibility are disabled), but they won't change held state after that.

for reference, here is the segment of my code that spawns the object (i am using spawn_sync_object() with a network_init_object() call):
rINHtQP.png

and here is the code that handles alternate held states, located within the behavior's loop function:
IjxpTUg.png


i'm pretty stumped on how to go about fixing this, so any insight would be appreciated. if any more information is needed, just let me knoww.
 
has anyone created custom behaviours that use the grabbable interact type ? i've gotten everything to work, except the object drop and throw functions aren't being synced with other players (the object remains in the HELD_HELD state for all other players). from what i can tell reading through the game's interaction code, its some issue with network_send_object()

this function (mario_drop_held_object()) along with mario_throw_held_object() run for only the local player, and then use a network_send_object() call, which seems to be the culprit

Ha4MgKL.png


my behavior code is set up near-identically to other grabbable objects like bobombs; it simply won't change held state for other players due to this function not syncing the object. Other players are able to pick up the object just fine and it enters its HELD_HELD state (where rendering and tangibility are disabled), but they won't change held state after that.

for reference, here is the segment of my code that spawns the object (i am using spawn_sync_object() with a network_init_object() call):
rINHtQP.png

and here is the code that handles alternate held states, located within the behavior's loop function:
IjxpTUg.png


i'm pretty stumped on how to go about fixing this, so any insight would be appreciated. if any more information is needed, just let me knoww.
This hack Sonic Adventure 64 DX has a custom behavior (Ukikaboom which are bombs thrown by ukiki) that uses the grabbable interact type in its !main_mops.lua. If you are looking for an example of a working grabbable custom object. Also In your object's init function, do you have OBJ_FLAG_HOLDABLE as one of your object's oFlags. If you don't that might be your problem.
 
Last edited:
thank you both for the help ! turns out the root issue is that object syncing does not seem to work properly if the network_init_object() call is done anywhere other than the behavior's init function (NOT the setup function like i had). and including oHeldState as well as oInteractStatus ensures that stuff stays synced so that's all good. this has solved a TON of issues with my mod,, the pet objects were never properly synced until noww
 

Users who are viewing this thread