Translations of this page:

Sidebar

en:vci:script:reference:eventfunction:ownership

Relation between ownership and event functions

There are two types of ownership in VCI: ownership for entire VCI and ownership for individual SubItems. This page describes the following:

  • The timing and condition at which ownership is transferred
  • States of ownership and the effect it has to event functions
  • Flow chart for the process

Relation between ownership and event functions in VCI

There are two types of ownership: ownership for entire VCI and ownership for individual SubItems in VCI. The ownership used to judge the condition for event functions varies for each event function.

Event VCI ownership: Yes VCI ownership: No
update Yes No
updateAll Yes

*1
The ownership of a SubItem will not affect the script,
however, you need to have the ownership of the SubItem you want to move the transform of, using update function.
(This is because the client with the ownership of the SubItem will overwrite the transform of the SubItem)

Relation between ownership and event functions in SubItem

Event Ownership: Yes Ownership: No
onGrab Run when grabbed After being grabbed, run when the grabber acquired the ownership (*1)
onUngrab Run when ungrabbed Run when lost the ownership (even when grabbed)
onUse Run when the Use button is pressed Won't run
onUnuse Run when the Use button is released Run when lost the ownership (* 2)
onTriggerEnter/Exit Run Won't run (*3)
onCollisionEnter/Exit Run Won't run (*3)

*1
There is network delay.
Sensitive control such as “grabbing for a split second” might not be registered.

*2
onUnuse is triggered by loosing of the ownership. Which means onUnuse is run without the ownership.
Also, even if the Use button is pressed, onUnuse will be run if the user lost the ownership for the SubItem.

*3
* A SubItem without the ownership will have its Kinematic=true.

Synchronization of ownership and transform in SubItem

As for “transform”, the result in the client with the ownership of the SubItem will be synchronized to other clients.
Therefore, even if you changed the transform using Lua script or collision,
the transform will be overwritten by the client with the ownership of the SubItem. As a result, the transform will not change.

For details, refer to About VCI items and SubItems.

About the transfer of SubItem's ownership (Grab)

The ownership will be transferred to the person who grabbed the SubItem “when they grabbed the SubItem”

  • True: The person who grabbed the last have the ownership
  • False: The ownership will stay with you as long as you keep grabbing

Therefore,you could lose the ownership while you a grabbing the SubItem (by another person grabbing the same SubItem).

Flow chart of SubItem ownership transfer

Pattern list of ownership transfer

When to receive the ownership Who receives the ownership
User with the ownership leaves the studio The person who entered the current studio the earliest
At the time of VCI spawn The person who spawned the VCI (even before grabbing)
Entering an empty public studio The person who entered the studio receives ownerships for abandoned SubItems
When to lose the ownership Who loses the ownership
When leaving a studio (the same goes for public studios) The person who left the studio
When a person without the ownership of a SubItem grabs the SubItem The person who had the ownership of the SubItem being grabbed

*1
There should be no instance of SubItems that are not owned by anyone, in principle.
(except for empty public studio)

*2
If there is a way to make a SubItem orphaned, that is a bug.
If you find such behavior, please report the situation and the steps to reproduce such state.

GroupID of SubItems

SubItems have what's called GroupIDs, which allows a user to acquire ownerships of all SubItems with the same GroupID as the one they grabbed.
However, if the SubItems have their GroupIDs set to 0 (default), they are recognized as separate GroupIDs.
This feature is implemented as some VCI requires multiple ownerships at once.
For detailed information, refer to About GroupID.

OnTriggerEnter Flow

*1
For functions with _ALL_, refer to vci.assets(ExportAssets)

en/vci/script/reference/eventfunction/ownership.txt · Last modified: 2021/06/29 19:41 by t-daihisa

Page Tools