Portal

Associated namespace: sm.portal

Values:

Functions:

Operations:

OperationReturn typeDescription
Portal == PortalbooleanChecks 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:

TypeNameDescription
PortalportalThe portal.

Returns:

TypeDescription
tableA table of contents of type Character and Body.

getContentsB(portal)

Server only

Gets the contents of opening B

Parameters:

TypeNameDescription
PortalportalThe portal.

Returns:

TypeDescription
tableA table of contents of type Character and Body.

getId(portal)

Returns the id of a portal.

Parameters:

TypeNameDescription
PortalportalThe portal.

Returns:

TypeDescription
integerThe portal's id.

getPositionA(portal)

Server only

Returns the position of portal opening A.

Parameters:

TypeNameDescription
PortalportalThe portal.

Returns:

TypeDescription
Vec3The portal opening A position.

getPositionB(portal)

Server only

Returns the position of portal opening B.

Parameters:

TypeNameDescription
PortalportalThe portal.

Returns:

TypeDescription
Vec3The portal opening B position.

getRotationA(portal)

Server only

Returns the rotation of portal opening A.

Parameters:

TypeNameDescription
PortalportalThe portal.

Returns:

TypeDescription
QuatThe portal opening A rotation.

getRotationB(portal)

Server only

Returns the rotation of portal opening B.

Parameters:

TypeNameDescription
PortalportalThe portal.

Returns:

TypeDescription
QuatThe portal opening B rotation.

getWorldA(portal)

Server only

Returns the world of a portal opening A.

Parameters:

TypeNameDescription
PortalportalThe portal.

Returns:

TypeDescription
WorldThe portal opening A world.

getWorldB(portal)

Server only

Returns the world of a portal opening B.

Parameters:

TypeNameDescription
PortalportalThe portal.

Returns:

TypeDescription
WorldThe portal opening B world.

hasOpeningA(portal)

Server only

Checks if the portal has opening A.

Parameters:

TypeNameDescription
PortalportalThe portal.

Returns:

TypeDescription
booleanTrue if opening A exists, false if not.

hasOpeningB(portal)

Server only

Checks if the portal has opening B.

Parameters:

TypeNameDescription
PortalportalThe portal.

Returns:

TypeDescription
booleanTrue if opening B exists, false if not.

setAMarkerOffset(portal, offset)

Server only

Sets the offset of the world marker of portal A

Parameters:

TypeNameDescription
PortalportalThe portal.
Vec3offsetThe 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:

TypeNameDescription
PortalportalThe portal to edit
booleanallowedWhether 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:

TypeNameDescription
PortalportalThe portal.
Vec3offsetThe 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:

TypeNameDescription
PortalportalThe portal to edit
booleanallowedWhether 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:

TypeNameDescription
PortalportalThe portal.
Vec3positionThe portal opening A position.
QuatrotationThe portal opening A rotation.
Worldworld?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:

TypeNameDescription
PortalportalThe portal.
Vec3positionThe portal opening B position.
QuatrotationThe portal opening B rotation.
Worldworld?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:

TypeNameDescription
PortalportalThe portal.
integerfilter?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:

TypeDescription
booleanTrue if successful, false on failure.

transferBToA(portal, filter?)

Server only

Transfers objects inside B opening to A opening

Parameters:

TypeNameDescription
PortalportalThe portal.
integerfilter?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:

TypeDescription
booleantrue if successful, false on failure.