Portal
Associated namespace: sm.portal
Values:
Functions:
- getContentsA
- getContentsB
- getId
- getPositionA
- getPositionB
- getRotationA
- getRotationB
- getWorldA
- getWorldB
- hasOpeningA
- hasOpeningB
- setAMarkerOffset
- setAToBMarkerAllowed
- setBMarkerOffset
- setBToAMarkerAllowed
- setOpeningA
- setOpeningB
- transferAToB
- transferBToA
Operations:
| Operation | Return type | Description |
|---|---|---|
| Portal == Portal | boolean | Checks if two instances of Portal refer to the same Portal. |
id integer
Get:
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)
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. |
setAMarkerOffset(portal, offset)
Server only
Sets the offset of the world marker of portal A
Parameters:
| Type | Name | Description |
|---|---|---|
| Portal | portal | The portal. |
| Vec3 | offset | The offset of the world marker in world space. |
setAToBMarkerAllowed(portal, allowed)
Server only
Set if transfer from A to B is allowed, used for marker placements
Parameters:
| Type | Name | Description |
|---|---|---|
| Portal | portal | The portal to edit |
| boolean | allowed | Whether the portal is allowed to show A to B connection |
setBMarkerOffset(portal, offset)
Server only
Sets the offset of the world marker of portal B
Parameters:
| Type | Name | Description |
|---|---|---|
| Portal | portal | The portal. |
| Vec3 | offset | The offset of the world marker in world space. |
setBToAMarkerAllowed(portal, allowed)
Server only
Set if transfer from B to A is allowed, used for marker placements
Parameters:
| Type | Name | Description |
|---|---|---|
| Portal | portal | The portal to edit |
| boolean | allowed | Whether the portal is allowed to show A to B connection |
setOpeningA(portal, position, rotation, world?)
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. |
| World | world? | The world to look in (Optional, defaults to world from script context) |
setOpeningB(portal, position, rotation, world?)
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. |
| World | world? | The world to look in (Optional, defaults to world from script context) |
transferAToB(portal, filter?)
Server only
Transfers objects inside A opening to B opening
Parameters:
| Type | Name | Description |
|---|---|---|
| Portal | portal | The portal. |
| integer | filter? | A sm.physics.filter mask selecting which contents to transfer. Only dynamicBody, staticBody and character are meaningful. Defaults to transferring bodies and characters. (Optional) |
Returns:
| Type | Description |
|---|---|
| boolean | True if successful, false on failure. |
transferBToA(portal, filter?)
Server only
Transfers objects inside B opening to A opening
Parameters:
| Type | Name | Description |
|---|---|---|
| Portal | portal | The portal. |
| integer | filter? | A sm.physics.filter mask selecting which contents to transfer. Only dynamicBody, staticBody and character are meaningful. Defaults to transferring bodies and characters. (Optional) |
Returns:
| Type | Description |
|---|---|
| boolean | true if successful, false on failure. |