Portal
Associated namespace: sm.portal
A userdata object representing an portal in the game.
Values:
Functions:
- getContentsA
- getContentsB
- getId
- getPositionA
- getPositionB
- getRotationA
- getRotationB
- getWorldA
- getWorldB
- hasOpeningA
- hasOpeningB
- setOpeningA
- setOpeningB
- transferAToB
- transferBToA
Operations:
Operation | Description |
---|---|
Portal == Portal | Checks if two instances of Portal refer to the same Portal. |
id integer
Get:
Server only
Returns the id of a portal.
getContentsA(portal)
Server only
Gets the contents of opening A
Parameters:
Type | Name | Description |
---|---|---|
Portal | portal | The portal. |
Returns:
Type | Description |
---|---|
table | A table of contents of type Character and Body. |
getContentsB(portal)
Server only
Gets the contents of opening B
Parameters:
Type | Name | Description |
---|---|---|
Portal | portal | The portal. |
Returns:
Type | Description |
---|---|
table | A table of contents of type Character and Body. |
getId(portal)
Server only
Returns the id of a portal.
Parameters:
Type | Name | Description |
---|---|---|
Portal | portal | The portal. |
Returns:
Type | Description |
---|---|
integer | The portal's id. |
getPositionA(portal)
Server only
Returns the position of portal opening A.
Parameters:
Type | Name | Description |
---|---|---|
Portal | portal | The portal. |
Returns:
Type | Description |
---|---|
Vec3 | The portal opening A position. |
getPositionB(portal)
Server only
Returns the position of portal opening B.
Parameters:
Type | Name | Description |
---|---|---|
Portal | portal | The portal. |
Returns:
Type | Description |
---|---|
Vec3 | The portal opening B position. |
getRotationA(portal)
Server only
Returns the rotation of portal opening A.
Parameters:
Type | Name | Description |
---|---|---|
Portal | portal | The portal. |
Returns:
Type | Description |
---|---|
Quat | The portal opening A rotation. |
getRotationB(portal)
Server only
Returns the rotation of portal opening B.
Parameters:
Type | Name | Description |
---|---|---|
Portal | portal | The portal. |
Returns:
Type | Description |
---|---|
Quat | The portal opening B rotation. |
getWorldA(portal)
Server only
Returns the world of a portal opening A.
Parameters:
Type | Name | Description |
---|---|---|
Portal | portal | The portal. |
Returns:
Type | Description |
---|---|
World | The portal opening A world. |
getWorldB(portal)
Server only
Returns the world of a portal opening B.
Parameters:
Type | Name | Description |
---|---|---|
Portal | portal | The portal. |
Returns:
Type | Description |
---|---|
World | The portal opening B world. |
hasOpeningA(portal)
Server only
Checks if the portal has opening A.
Parameters:
Type | Name | Description |
---|---|---|
Portal | portal | The portal. |
Returns:
Type | Description |
---|---|
boolean | True if opening A exists, false if not. |
hasOpeningB(portal)
Server only
Checks if the portal has opening B.
Parameters:
Type | Name | Description |
---|---|---|
Portal | portal | The portal. |
Returns:
Type | Description |
---|---|
boolean | True if opening B exists, false if not. |
setOpeningA(portal, position, rotation)
Server only
Sets the position of portal opening A.
The world will be the same as the object that calls this function.
Parameters:
Type | Name | Description |
---|---|---|
Portal | portal | The portal. |
Vec3 | position | The portal opening A position. |
Quat | rotation | The portal opening A rotation. |
setOpeningB(portal, position, rotation)
Server only
Sets the position B of portal opening B.
The world will be the same as the object that calls this function.
Parameters:
Type | Name | Description |
---|---|---|
Portal | portal | The portal. |
Vec3 | position | The portal opening B position. |
Quat | rotation | The portal opening B rotation. |
transferAToB(portal)
Server only
Transfers objects inside A opening to B opening
Parameters:
Type | Name | Description |
---|---|---|
Portal | portal | The portal. |
Returns:
Type | Description |
---|---|
boolean | True if successful, false on failure. |
transferBToA(portal)
Server only
Transfers objects inside B opening to A opening
Parameters:
Type | Name | Description |
---|---|---|
Portal | portal | The portal. |
Returns:
Type | Description |
---|---|
boolean | true if successful, false on failure. |