Safe Area
- com.yahaha.sdk.horrorgameassets
The Safe Area provides a system to protect players when they enter designated zones in your game. It uses trigger areas and associated actions to apply or remove a stealth buff, effectively enabling or disabling player protection within those zones.
How it works
Activating Player Protection
- Trigger:
- Object: TriggerArea — the target area that activates the protection.
- Event: OnTriggerZonePlayerEnter — this event fires when the player enters the trigger area.
- Condition:
- Object: Self — ensures the condition is checked on the player object.
- This condition confirms that the player has entered the area before proceeding.
- Action:
-
Object: Global — the scope where the action is executed.
-
Function: AddStealthBuffToLocalPlayer — applies a stealth/protection buff to the player.
-
Delay: Defines when the buff effect takes place after the event triggers.
Effect: When the player enters the safe zone, they receive a stealth buff that protects them.
-
Deactivating Player Protection
- Trigger:
- Object: TriggerArea — the same target area.
- Event: OnTriggerZonePlayerExit — this event fires when the player leaves the trigger area.
- Condition:
- Object: Self — ensures the condition is checked on the player object.
- This condition confirms that the player has indeed exited the area before proceeding.
- Action:
-
Object: Global
-
Function: RemoveStealthBuffToLocalPlayer — removes the protection buff from the player.
-
Delay: Defines when the buff removal takes effect.
Effect: When the player leaves the safe zone, their protection buff is removed, making them vulnerable again.
-
Summary
- Safe Area uses trigger zones to automatically grant or remove player protection.
- Entering the zone applies a stealth buff, protecting the player.
- Exiting the zone removes the buff, returning the player to a normal state.
- This system is flexible and can be integrated into various gameplay scenarios where safe zones or protected areas are needed.