Underwater Vision

From FleshWorks

Jump to: navigation, search

by ascottk

Intro

Well, we don't have swimmable water yet but here's a start.

Vision Distortion

  1. First go to the level properties (F6) then set bDistanceFog and bFogZone in ZoneInfo to True. You could change fog color to whatever you like and set DistanceFogEnd and DistanceFogStart to 0 under ZoneLight.
  2. If you have a dry canal or something of the sort and follow the directions for ShallowWater, you'll have your water.
  3. Make some scripts, one that changes vision when you go into the ShallowWaterVolume and one that changes back.

First script (I named WaterEnter)

Image:Condition_icon.png CONDITIONS

Image:Condition_icon.png When linked volume(s) [MYSELF] are breached by [Category Player]

Image:action_icon.png ACTIONS

Image:action_icon.png Send trigger message [WorldMode] (Not sure this is necessary)
Image:action_icon.png Activate screen tinting to RGBA [10] [150] [150] [25] (change if you like)
Image:action_icon.png Change level fog range settings to Start: [10.00], End: [1800.00], over [0.50] seconds.
Image:action_icon.png Set [BaseFOV] to [46.00] on linked objects of [PLAYER]
Image:action_icon.png Reset script conditions and actions


Second script (WaterExit)

Just like the first except:

Image:Condition_icon.png CONDITIONS

Image:Condition_icon.png When linked volume(s)[MYSELF] are exited by [Category Player]

Image:action_icon.png ACTIONS

Image:action_icon.png Deactivate screen tinting
Image:action_icon.png Change level fog range settings to Start: [0.00], End: [0.00], over [0.50] seconds.
Image:action_icon.png Set [BaseFOV] to [85.00] on linked objects of [PLAYER]
Image:action_icon.png Reset script conditions and actions

Attach those scripts to the ShallowWaterVolume and you could add the ForceFirstPerson and UnlockFirstPerson scripts too (Under cameraFunctions). WARNING: when the fog settings on your level is set to zero, all you see is the color of your fog when you Toggle Flesh Render Output. If you want to tweak your lights then disable fog in the level properties.

Adding Bubbles

WARNING: This includes modifying the gamesys!

  1. Follow UDN's Bubbles Emitter Tutorial. The bubbles here are too big. I made mine 2.0 MAX, 0.2 MIN on XYZ.
  2. Add a RigidAttachment link from the Bubble to the PlayerGarrett archetype in the Actor Class Browser.
    • Attachment -> m_attachmentBone:
    • Attachment -> m_parentBone: lip_t_center
    • Hidden -> bDontPropogateHiddenFlagToChild: False
    • Highlight -> bPropagatesHighlight: False
    • Lifetime -> bDeleteChildOnDeath: True
    • Link -> m_GroupName: None
    • Link -> m_name: Bubbles
    • Spawn -> bDontSpawn: True
  3. Add a flag called WaterEnterPlayer
  4. Add a couple of scripts for when the player enter a volume

Volume Script

Image:Condition_icon.png CONDITIONS

Image:Condition_icon.png When linked volumes(s) are breached by [Category_Player]

Image:action_icon.png ACTIONS

Image:action_icon.png Set flag [WaterEnterPlayer] to [TRUE] expires . . . (etc.)
Image:action_icon.png Reset script conditions and actions


PlayerGarrett Script (attach to PlayerGarrett Archetype)

Image:Condition_icon.png CONDITIONS

Image:Condition_icon.png When [WaterEnterPlayer is set to [TRUE]

Image:action_icon.png ACTIONS

Image:action_icon.png Spawn and attach object type of RigidAttachment Link(s) with name [Bubbles] to me
Image:action_icon.png Reset script conditions and actions

Do the opposite for exiting the water:

Image:Condition_icon.png CONDITIONS

Image:Condition_icon.png When WaterEnterPlayer=FALSE

Image:action_icon.png ACTIONS

Image:action_icon.png Delete linked object(s) [RigidAttachment:Bubbles]
Image:action_icon.png Reset script conditions and actions


TTLG Forum Discussion


Back to Mission Design: Environmental

Personal tools