Portal

Values:

  • id [ integer ]
    • Get: Returns the id of a portal.

Operations:

Operation Returns Description
Portal == Portal boolean Checks if two instances of Portal refer to the same Portal.

Server + Client

getId

portal:getId(  )

Returns the id of a portal.

Parameters:

Name Type Description
portal Portal The portal.

Returns:

Type Description
integer The portal's id.

Server-only

getContentsA

portal:getContentsA(  )

Gets the contents of opening A

Parameters:

Name Type Description
portal Portal The portal.

Returns:

Type Description
table A table of contents of type Character and Body.

getContentsB

portal:getContentsB(  )

Gets the contents of opening B

Parameters:

Name Type Description
portal Portal The portal.

Returns:

Type Description
table A table of contents of type Character and Body.

getPositionA

portal:getPositionA(  )

Returns the position of portal opening A.

Parameters:

Name Type Description
portal Portal The portal.

Returns:

Type Description
Vec3 The portal opening A position.

getPositionB

portal:getPositionB(  )

Returns the position of portal opening B.

Parameters:

Name Type Description
portal Portal The portal.

Returns:

Type Description
Vec3 The portal opening B position.

getRotationA

portal:getRotationA(  )

Returns the rotation of portal opening A.

Parameters:

Name Type Description
portal Portal The portal.

Returns:

Type Description
Quat The portal opening A rotation.

getRotationB

portal:getRotationB(  )

Returns the rotation of portal opening B.

Parameters:

Name Type Description
portal Portal The portal.

Returns:

Type Description
Quat The portal opening B rotation.

getWorldA

portal:getWorldA(  )

Returns the world of a portal opening A.

Parameters:

Name Type Description
portal Portal The portal.

Returns:

Type Description
World The portal opening A world.

getWorldB

portal:getWorldB(  )

Returns the world of a portal opening B.

Parameters:

Name Type Description
portal Portal The portal.

Returns:

Type Description
World The portal opening B world.

hasOpeningA

portal:hasOpeningA(  )

Checks if the portal has opening A.

Parameters:

Name Type Description
portal Portal The portal.

Returns:

Type Description
boolean True if opening A exists, false if not.

hasOpeningB

portal:hasOpeningB(  )

Checks if the portal has opening B.

Parameters:

Name Type Description
portal Portal The portal.

Returns:

Type Description
boolean True if opening B exists, false if not.

setAMarkerOffset

portal:setAMarkerOffset( offset )

Sets the offset of the world marker of portal A

Parameters:

Name Type Description
portal Portal The portal.
offset Vec3 The offset of the world marker in world space.

setAToBMarkerAllowed

portal:setAToBMarkerAllowed( allowed )

Set if transfer from A to B is allowed, used for marker placements

Parameters:

Name Type Description
portal Portal The portal to edit
allowed boolean Whether the portal is allowed to show A to B connection

setBMarkerOffset

portal:setBMarkerOffset( offset )

Sets the offset of the world marker of portal B

Parameters:

Name Type Description
portal Portal The portal.
offset Vec3 The offset of the world marker in world space.

setBToAMarkerAllowed

portal:setBToAMarkerAllowed( allowed )

Set if transfer from B to A is allowed, used for marker placements

Parameters:

Name Type Description
portal Portal The portal to edit
allowed boolean Whether the portal is allowed to show A to B connection

setOpeningA

portal:setOpeningA( position, rotation, world )

Sets the position of portal opening A.

The world will be the same as the object that calls this function.

Parameters:

Name Type Description
portal Portal The portal.
position Vec3 The portal opening A position.
rotation Quat The portal opening A rotation.
world (optional) World The world to look in (Optional, defaults to world from script context)

setOpeningB

portal:setOpeningB( position, rotation, world )

Sets the position B of portal opening B.

The world will be the same as the object that calls this function.

Parameters:

Name Type Description
portal Portal The portal.
position Vec3 The portal opening B position.
rotation Quat The portal opening B rotation.
world (optional) World The world to look in (Optional, defaults to world from script context)

transferAToB

portal:transferAToB( filter )

Transfers objects inside A opening to B opening

Parameters:

Name Type Description
portal Portal The portal.
filter (optional) integer 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:transferBToA( filter )

Transfers objects inside B opening to A opening

Parameters:

Name Type Description
portal Portal The portal.
filter (optional) integer 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.