Difference between revisions of "HPL3/Areas/Sticky Area"

From Frictional Wiki
Jump to navigation Jump to search
(broken link from sticky area)
Tag: Removed redirect
m (added img)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
= Soundscape Area =
+
= Sticky Area =
  
 
== Overview ==
 
== Overview ==
 +
[[File:Sticky area.png|thumb|A sticky area being used in 01_04_transport_station.hpm. Light blue = Sticky Area, Green = Interact Aux Area]]
 +
The Sticky Area is a area that can be used to allow entities to attach and detach to the area. This effect can simulate cables, computer chips, or any interactable physics entity that can be plugged in or unplugged.
  
The Soundscape Area is a volume entity that when entered by the player, can play ambient sounds and music, as well as set up and configure reverb and background sound data. Many soundscape areas can overlap, if the background sound is identical then the areas will act as if they are one entity.
+
== Properties ==
 +
=== Base ===
 +
* '''MoveBody''': If the body of the entity to attach should be moved into the position of the area when attached
 +
* '''RotateBody''': If the body of the entity to attach should be rotated to match the sticky area when attached
 +
* '''AttachableBodyName''': The name and body of the entity to attach. I.e. ''[entity_name]_Body_[#]''
 +
* '''PoseTime''':  The time in seconds it takes for the entity to move and rotate into place when attached
 +
* '''CheckCenterInArea''': Requires the center of the body of the entity to attach to be inside the sticky area
 +
* '''CanDetach''': If the body of the area of the entity to attach can be detached to the sticky area
 +
* '''RequiresInteraction''': If the entity requires player interaction to attach to the sticky area
  
== Features ==
+
=== Callbacks ===
 +
* '''AttachFunction''': Function to call when an entity attaches to the sticky area. Press copy to generate a callback function and copy to the clipboard
 +
* '''DetachFunction''': Function to call when an entity detaches from the sticky area. Press copy to generate a callback function and copy to the clipboard
  
=== Reverb ===
+
=== Effects ===
 +
* '''AttachSound''': The sound to be played when an entity attaches to the area
 +
* '''DetachSound''': The sound to be played when an entity detaches from the area
 +
* '''AttachPS''': The particle system to be created when an entity attaches to the area
 +
* '''DetachPS''': The particle system to be created when an entity detaches from the area
  
* '''UseReverb''': Enables reverb data
+
=== Attachment ===
* '''ReverbType''': Which reverb setting to use.
+
* '''ParentAttachEntity''': The name of an entity that this area is parented to.
* '''ReverbPrio''': Priority of the reverb effect, higher values override overlapping soundscapes.
+
* '''ParentAttachUseRotation''': If the rotation of the parent should affect the area.
* '''ReverbAmount''': The Amount of reverb to be used. Values can be greater than 1.
+
* '''ParentAttachBody''': The name of the body in the parent entity to attach to.
* '''ReverbFadeTime''': The amount of time to fade into this reverb effect in seconds.
 
 
 
{{tip|If '''UseReverb''' is not enabled for an area, then it will not be taken into account at all, regardless of prio. If you want an area to disable reverb, then it needs to have '''UseReverb''' active and type set to ''off''.}}
 
 
 
=== General Sound ===
 
The Soundscape area can start playing a 2d sound as the player's head enters the area. '''Prio''' is used to determine what soundscape area to use if many of the same '''Level''' overlap. However, if many areas of different '''Level''' overlap then the background sounds from smaller '''Level''' values will get lowered according to the '''ParentVolMul''' setting in the higher '''Level''' areas. This is meant to simulate the background noise getting lowered as you step inside a house or similar. For instance, if the player is inside one ''Global (0)'' area and one ''Room (2)'' area, then the background sound from the ''Global (0)'' area will be lowered according to '''ParentVolMul''' in the ''Room (2)'' area. This multiplying is applied all through the hierarchy, so if the player is inside areas from levels 0 -> 3, then any sound in level 0 will be multiplied by the setting in 1, 2, and 3 together.
 
  
* '''Prio''': Priority of the soundscape, higher values override overlapping soundscapes.
+
=== Springy ===
* '''Level''': The hierarchy of what each soundscape in a level is meant for. Lower level soundscapes are activated instead of higher levels when soundscapes overlap.  
+
Springy behavior is best described as a tendency for the entity to attach to be attracted to the sticky area and for the entity to slightly resist being detached.
  
=== BackgroundSound ===
+
* '''Springy_Active''': If springy behavior is enabled
* '''BG_Sound''': the sound file to play when entering a soundscape. Looping sounds are recommended.
+
* '''Springy_DetachDistanceMul''': Distance multiplier for the entity to be from the center of the area to detach.  
* '''BG_Volume''': The volume of the sound.
+
* '''Springy_ForceMul''': Force multiplier to be applied to the entity when detached
* '''BG_FadeInTime''': Time in seconds it takes to fade in the sound.
+
* '''Springy_ReleaseTime''': Time in seconds to delay detaching the entity once the entity meets the detach criteria
* '''BG_FadeOutTime''': Time in seconds it takes to fade out the sound.
+
* '''Springy_DetachLoopSound''': A looping sound to play when in the process of detaching an entity from a sticky area
* '''BG_FadeTransitionSpeed''': The speed at which a sound fades in or out when a parent volume is changed.
 
* '''BG_ParentVolMul''': A multiplier for any parent background sounds that are active.
 
 
 
=== Connected Sound Entities ===
 
Soundscape Areas can play two distinct types of sounds, sound files designated in Sound Entities and 2D background sounds.
 
Sound entities that are placed in the level can be either started or stopped when the player is inside or outside of the area. If two areas overlap and are of the same '''Level''' then the area with the highest '''prio''' will be used. Note that if the areas have different '''Level''' values, then sound entities from many areas can be played (or not played) at the same time.
 
 
 
* '''SoundEnt_InNames''': Sound Entities to begin playing when entering the soundscape or stop playing when exiting the soundscape.
 
* '''SoundEnt_OutNames''': Sound Entities to begin playing when exiting the soundscape or stop playing when entering the soundscape.
 
* '''SoundEnt_FadeInTime''': Time in seconds to fade in attached sound entities.
 
* '''SoundEnt_FadeOutTime''': Time in seconds to fade out attached sound entities.
 
 
 
=== SoundPrefix ===
 
In Soma this setting is used to play different versions of footstep sounds however this can be used for other reasons. It does this by applying an extra parent folder to the sound file to be played if the variable is not ''[None]''. The script function Sound_CreateAtEntity_UsePrefix can be used to easily play different sounds depending on which soundscape area the player currently is in.
 
 
 
* '''SoundPrefixPrio''': The priority of the SoundPrefix, higher values override overlapping soundscapes.
 
* '''SoundPrefix''': The prefix to be added to the sound effect path. ''[None]'' will not add a prefix.
 
 
 
=== Attachment ===
 
* '''ParentAttachEntity''': The name of an entity that this soundscape is parented to.
 
* '''ParentAttachUseRotation''': If the rotation of the parent should affect the soundscape.
 
* '''ParentAttachBody''': The name of the body in the parent entity to attach to.
 

Latest revision as of 19:19, 8 February 2024

Sticky Area

Overview

A sticky area being used in 01_04_transport_station.hpm. Light blue = Sticky Area, Green = Interact Aux Area

The Sticky Area is a area that can be used to allow entities to attach and detach to the area. This effect can simulate cables, computer chips, or any interactable physics entity that can be plugged in or unplugged.

Properties

Base

  • MoveBody: If the body of the entity to attach should be moved into the position of the area when attached
  • RotateBody: If the body of the entity to attach should be rotated to match the sticky area when attached
  • AttachableBodyName: The name and body of the entity to attach. I.e. [entity_name]_Body_[#]
  • PoseTime: The time in seconds it takes for the entity to move and rotate into place when attached
  • CheckCenterInArea: Requires the center of the body of the entity to attach to be inside the sticky area
  • CanDetach: If the body of the area of the entity to attach can be detached to the sticky area
  • RequiresInteraction: If the entity requires player interaction to attach to the sticky area

Callbacks

  • AttachFunction: Function to call when an entity attaches to the sticky area. Press copy to generate a callback function and copy to the clipboard
  • DetachFunction: Function to call when an entity detaches from the sticky area. Press copy to generate a callback function and copy to the clipboard

Effects

  • AttachSound: The sound to be played when an entity attaches to the area
  • DetachSound: The sound to be played when an entity detaches from the area
  • AttachPS: The particle system to be created when an entity attaches to the area
  • DetachPS: The particle system to be created when an entity detaches from the area

Attachment

  • ParentAttachEntity: The name of an entity that this area is parented to.
  • ParentAttachUseRotation: If the rotation of the parent should affect the area.
  • ParentAttachBody: The name of the body in the parent entity to attach to.

Springy

Springy behavior is best described as a tendency for the entity to attach to be attracted to the sticky area and for the entity to slightly resist being detached.

  • Springy_Active: If springy behavior is enabled
  • Springy_DetachDistanceMul: Distance multiplier for the entity to be from the center of the area to detach.
  • Springy_ForceMul: Force multiplier to be applied to the entity when detached
  • Springy_ReleaseTime: Time in seconds to delay detaching the entity once the entity meets the detach criteria
  • Springy_DetachLoopSound: A looping sound to play when in the process of detaching an entity from a sticky area