MapControl update process¶
The Update process consists of 2 parts:
- LateUpdate (excluding the first call so only when
latestart
is strue) - FixedUpdate
LateUpdate¶
Nothing happens if the player doesn't exist.
- If not in a
minipause
,pause
,inevent
ormessage
:- If
autoevent
exists, they are processed. Check theautoevent
documentation to learn more - If
hiddenitem
isn't null, the detector emote is set with player.entity.emoticonid
set to 4 with anemoticoncooldown
of 100.0.hiddenitem
is set to null after. This sets up theDetector
medal emoticon. The sound will be played a bit later
- If
- CheckStencilSwitch called which finds the first StencilSwitch that's not
iskill
and ishit
:- If one is found:
GlobalIceRadius
shader global property gets set to the StencilSwitch'sinternaltransform[0]
scale magnitude / 2.0CentralIcePoint
shader global property gets set to the StencilSwitch's positionstencilid
gets set to the map entity id of the StencilSwitch
- Otherwise (none is found):
GlobalIceRadius
shader global property gets set to a lerp from it to 1/20 of the game's frametime ???stencilid
gets set to -1
- If one is found:
- If the detector sound isn't playing, but if the detector emote is playing still (player.entity.
emoticonid
is 4 andemoticoncooldown
hasn't expired yet),Select1
sound is played onsounds[11]
with 1.1 pitch and 0.25 volume - All
digwall
's enablement gets updated. See the digwall documentation to learn more
What happens next depends on alivetime
since it can prevent some logic to be done.
alivetime
is higher than 0¶
It is decreased by 1.0 and no further logic happens from here. Essentially, it blocks all the logic that would have happened below for a certain amount of frames including the first one.
alivetime
is 0¶
- Every 2 frames, NPCControl updates happen for any that have their
requires
,limit
andregionalflag
condition fufilled to exist:- DoorOtherMap: The enablement is updated to be only enabled only if the player is less than 15.0 units away ignoring the y axis (disabled otherwise). If the enablement changes due to this, the
emoticon
of the entity is disabled - NPC (with an
originalid
defined and only if the map'skeepobjectsactive
is false): The enablement is updated to be only enabled only if the player is less than the NPC'sradius
* 2.0 units away ignoring the y axis (disabled otherwise). If the enablement changes due to this andinteracttype
isn'tTalk
, theemoticon
of the entity is disabled
- DoorOtherMap: The enablement is updated to be only enabled only if the player is less than 15.0 units away ignoring the y axis (disabled otherwise). If the enablement changes due to this, the
FixedUpdate¶
- If
tieYtoplayer
is true while instance.camtarget
isn't null (the camera is following a transform):actualcenter
is set tocentralpoint
, but the y is instance.camtarget
y position- If
tetherYLerp
.x is higher than 0.0,tetherdistance
is set to a lerp fromtetherYLerp
.x totetherYLerp
.y with a factor of instance.camtarget
y position /tetherYLerp
.z. NOTE: This feature is complicated, see the tetherYLerp details section in the camera system page for more details
- If
overrideskybox
is false and RenderSettings.skybox isn't null:- If
nocolorchange
is false, the UpdateInsideColor logic happens here with a targetalpha of 1.0 if not in an inside or 0.0 if in an inside. Check the documentation to learn more - The
_Rotation
material property of the skybox is set to 180.0 + MainCamera x position
- If
- If
rotatecam
is true, there areroundways
and we are not in an inside,roundways[0]
position is set to ((0.0 - MainCamera's forward x vector) * 3.0, 5.0, (0.0 - MainCamera's forward z vector) *lightoffset
). NOTE: This feature is very specific to a theAntTunnels
map, check theroundways[0]
documentation to learn more. Also, this math is incorrect