branchrust_reboot/main/naval_update/deep_sea/portalscancel
11 Commits over 0 Days - ∞cph!
Rename IsInDeepSea(Vector3) -> IsInsideDeepSea(Vector3) to match the entity overload naming
Move portal teleport code into DeepSeaManager.Portals.cs
Fix OnEntityEnter being called on clientside entities from the serverside TriggerDeepSeaPortal
Get portals enter & exit at the "same position" instead of always spawning player in the center
- switch to creating portals with different rotations instead of different sizes so we can easily adjust the enter & exit position for portals via localPosition
- ensure entiites enter & exit portals at the same relative position (enter north side, exit north side)
- adjust the position of the portal when entering and exiting
Dump players going back to main island offset from the main island portal instead of on spawn beach
- keep failback to put onto spawn beach incase something happens to the portals
Place entrance & exit ports based on the loot direction of the map
- entrance to deep sea should be on the T2 side of the map
- exit out of deep sea is on the "opposide side" so you enter & exit into one continious ocean
- example: leave left side of map, enter on right side of ocean
Bunch of work to get the portals working
- entering the portal as a player or as a vehicle will instantly teleport the the opposite side
- portals are spawned at runtime and sized to the size of the island
- portals can be spawned at any of the 4 cardinal directions of the island
- for testing leave the island from the north side and enter the deep sea on the south
- will be spawned 200m from the edge of the deep sea (in the center of the ocean for testing)
- teleport the player the frame after they enter since making the player sleep deletes the rigidbody immediately and unity doesn't like deleting physics objects inside the callback they enter the trigger (later this will be hidden by effects)
- refactor the name of some code to make it nicer
- portals will show as big green boxes to make testing easier, can be toggled with `deepsea_portals_visible` convar
- fix PointEntity<T> not intializating the singleton instances as soon as possible
Change portal GUID since it somehow conflicts with the island prefab GUID
Create deep sea portal entity
- trigger size is networked so we have the option of doing the visual effects on client
- entrances & exits are a single entity, change the enum to switch the behavior