TrineMoveBetweenPointsComponent

From Frozenbyte Wiki
Revision as of 09:26, 15 June 2018 by AnteroFB (talk | contribs) (Copied the article from the old wiki)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Use this component to replace all kinds of property connections regarding moving platforms, opening doors, hatches and such.

Quick guide

If you already know how to use TrineMoveBetweenPointsComponent's, you can use this as a checklist to make sure you add all the needed components and change the right settings. If you want a more comprehensive guide, read below: #How to start using.

Components to add

  • TrineMoveBetweenPointsComponent
  • ActivationAreaHolderComponent
  • PhysicsActivationSphereAreaComponent as a subcomponent of PhysicsComponent
  • BoxAreaComponent as a subcomponent of TrineMoveBetweenPointsComponent (NOTE: Only needed if you want to use area activation. For pressure plate activation, this component isn't needed.)

Settings to change

  • In PhysicsComponent:
    • Disable gravity
    • Change ActorType
    • Change CollisionGroup
  • In BoxAreaComponent:
    • Enable UseTransformComponentFromFinalOwner
    • Set Offset, Dimensions and ListenMask
  • Set other generic properties

How to start using

  1. Add TrineMoveBetweenPointsComponent to the object that should be moving (right click the object, select "Add component" and search for "TrineMoveBetweenPointsComponent").
  2. Add an ActivationAreaHolderComponent in the same way as above. Without this, the object won't move.
  3. Open PhysicsComponent and
    • Add subcomponent PhysicsActivationSphereAreaComponent (right click PhysicsComponent choose "Add subcomponent" and search for PhysicsActivationSphereAreaComponent). (NOTE: For some reason only Sphere seems to work here, Box and Cylinder still give the warning of "Dynamic physics object has no activation area".)
    • disable GravityEnabled
    • change ActorType to "ActorTypeDynamic" and
    • set CollisionGroup to "CollisionGroupDynamicNoStatic" (if you want the object to move unhindered by static collisions but still collide with other dynamic objects).
    • By using the PositionX/Y/ZEnabled and RotationX/Y/ZEnabled you can allow/disallow the object to/from moving in certain directions or rotating about certain axes. For example for a simple elevator, you could disable all the other properties except for PositionYEnabled. This prohibits the elevator-object from rotating and from moving in any other direction but the direction of the y-axis. By disabling/enabling these properties, a LockJointComponent is automatically created/deleted, which you don't need to worry about.
  4. If you want to use area activation for the moving object, you need to add a BoxAreaComponent as a subcomponent of the TrineMoveBetweenPointsComponent (right click TrineMoveBetweenPointsComponent in the properties of the object, choose "Add subcomponent" and search for BoxAreaComponent). If you want to use pressure plate activation, jump to step 5.
    • For the area activation you need to change the following settings in the properties of the BoxAreaComponent:
      1. Use the ListenMask array to choose which objects should be able to activate the moving object. If you want only the player character (PC) to be able to activate it, change ActorPlayerBox to "1" by double clicking it and let the others be "0".
      2. Enable UseTransformComponentFromFinalOwner to make the area use the position of the moving object (notice, that the green box depicting the activation area might not be in the right place or visible. The area appears in the correct place if you save and open the map again).
      3. Use Dimensions and Offset to change the size and place of the area as needed.
  5. If you want to use pressure plates as the activation method instead of the activation area, do the following:
    1. Add a pressure plate to the scene (there are several, you can use e.g. "SmallTempleTileT3PressurePlateEntity", which you can find under InstanceBase->Entity->GameplayEntity->PressurePlateEntity->T3PressurePlateEntity->TempleTileT3PressurePlateEntity->SmallTempleTileT3PressurePlateEntity)
    2. From the properties of the TrineMoveBetweenPointsComponent, go to "PressurePlateInstances" and choose the pressure plate(s) you want to use for activation.
  6. Depending on your activation method of choice, you can choose the functionality of the moving object in the following ways:
    1. for area, you can use the properties starting with AreaEnter and AreaExit in the properties of the TrineMoveBetweenPointsComponent to set the conditions. See #Area properties.
    2. for pressure plate, instead use the properties starting with PressurePlate and ReleasePlate. See #Pressure plate properties. (NOTE: If you have added multiple pressure plates for the object but you want any of them to activate the movement, you should disable the property AllPressurePlatesMustBeDown Also disable it if you use area activation.)
  7. Set the desired values for MoveToPosition or MoveDirection and change the other properties to needed values. See #Generic properties.

Generic properties

DirectionMovesWithEntity

Decides what happens when the object is moved around in the editor.

RestPosition

Essentially the same as the TransformComponent's position.

MoveToPosition

Where the object should move when certain criteria is met.

MoveDirection

The difference between RestPosition and MoveDirection. It's possible to edit this or the MoveToPosition (the other gets updated automatically).

Moving

Is the object moving? Can be set true to start the movement right away.

ChangeDirectionAfterReachingPoint

This determines if the direction of the movement should change towards the other direction when reaching the point of current direction. Used to make constantly moving platforms / lifts and such.

SpeedTowardsRestPosition

How fast the object moves, when going towards the RestPosition.

SpeedTowardsMoveToPosition

How fast the object moves, when going towards the MoveToPosition.

DelayBeforeMoving

When the object is set Moving there is a delay before the movement actually starts.

Blockable

Putting another object to block the movement direction stops the movement.

Audio properties

Finds the AudioComponent from Entity and posts events specified in the properties.

StartFromRestPositionAudioEvent

When object starts moving from RestPosition.

StartFromMoveToPositionAudioEvent

When object starts moving from MoveToPosition.

StopAtRestPositionAudioEvent

When object stops at the RestPosition.

StopAtMoveToPositionAudioEvent

When object stops at the MoveToPosition.

BlockedAudioEvent

When movement is stopped by another object on the way.

MovingAudioEvent

Whenever the object starts moving, both directions and from blocked.

Area properties

AreaEnterMovesToRest

When the sub component area is entered the object is set Moving towards the RestPosition.

AreaEnterMovesToPosition

When the sub component area is entered the object is set Moving towards the MoveToPosition.

AreaEnterContinueMoving

When the sub component area is entered the object is set Moving to whatever direction it was going.

AreaEnterStopMoving

When the sub component area is entered the object, Moving is set false.

AreaExitMovesToRest

When the sub component area gets empty object is set Moving the RestPosition.

AreaExitMovesToPosition

When the sub component area gets empty object is set Moving the MoveToPosition.

AreaExitContinueMoving

When the sub component area gets empty object is set Moving to whatever direction it was going.

AreaExitStopMoving

When the sub component area gets empty object, Moving is set false.

SingleAreaActivation

Used to make the areas single use. When the area has been triggered once it won't be enabled anymore.

InstancesMustBeInArea

Every instance in the list must be inside the configured sub component before the object is set Moving. Used to make specific cases where some object(s) must be moved or pulled to certain positions.

Pressure plate properties

PressurePlateInstances

Configure any related Entities that have TrinePressurePlateComponent here.

PressurePlateMovesToRest

When pressure plate(s) are pressed set Moving towards the RestPosition.

PressurePlateMovesToPosition

When pressure plate(s) are pressed set Moving towards the MoveToPosition.

PressurePlateContinueMoving

When pressure plate(s) are pressed set Moving to whatever direction it was going.

PressurePlateStopMoving

When pressure plate(s) are pressed, Moving is set false.

ReleasingPlateMovesToRest

When pressure plate(s) are released set Moving towards the RestPosition.

ReleasingPlateMovesToPosition

When pressure plate(s) are released set Moving towards the MoveToPosition.

ReleasingPlateContinueMoving

When pressure plate(s) are released set Moving to whatever direction it was going.

ReleasingPlateStopMoving

When pressure plate(s) are released, Moving is set false.

AllPressurePlatesMustBeDown

If true, all the listed instances in PressurePlateInstances must be pressed. Otherwise just pressing one is enough to move.

PressurePlatesMoveAlongsideObject

The pressure plate is moved based on the movement direction (MovingTowardsRestPosition).

Prerequisites for using (effectively, the button must not be activated or deactivated on its own):

  • Only set one pressure plate to PressurePlateInstances (multiple plates currently not tested / supported).

PressurePlatesActivatedOnRest

Determines if the button is pressed or released when moving towards the rest position.

SinglePressurePlateActivation

Once the pressure plates have set the object Moving they are no longer cared about.

Code properties

StopPosition

Used to keep the position if the object was stopped middle of the movement.

MovingTowardsRestPosition

Determine which way the movement is.

MovingToggleTime

Used to keep track when the Moving was toggled.

InstancesOccupyingArea

Keeps track of objects within the area.

PressedPressurePlates

Keeps track of any pressure plates that are considered pressed.