MapControl update process¶
The Update process consists of 2 parts:
- LateUpdate (excluding the first call so only when
latestartis strue) - FixedUpdate
LateUpdate¶
Nothing happens if the player doesn't exist.
- If not in a
minipause,pause,ineventormessage:- If
autoeventexists, they are processed. Check theautoeventdocumentation to learn more - If
hiddenitemisn't null, the detector emote is set with player.entity.emoticonidset to 4 with anemoticoncooldownof 100.0.hiddenitemis set to null after. This sets up theDetectormedal emoticon. The sound will be played a bit later
- If
- CheckStencilSwitch called which finds the first StencilSwitch that's not
iskilland ishit:- If one is found:
GlobalIceRadiusshader global property gets set to the StencilSwitch'sinternaltransform[0]scale magnitude / 2.0CentralIcePointshader global property gets set to the StencilSwitch's positionstencilidgets set to the map entity id of the StencilSwitch
- Otherwise (none is found):
GlobalIceRadiusshader global property gets set to a lerp from it to 1/20 of the game's frametime ???stencilidgets set to -1
- If one is found:
- If the detector sound isn't playing, but if the detector emote is playing still (player.entity.
emoticonidis 4 andemoticoncooldownhasn't expired yet),Select1sound 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,limitandregionalflagcondition 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
emoticonof the entity is disabled - NPC (with an
originaliddefined and only if the map'skeepobjectsactiveis 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 andinteracttypeisn'tTalk, theemoticonof 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
tieYtoplayeris true while instance.camtargetisn't null (the camera is following a transform):actualcenteris set tocentralpoint, but the y is instance.camtargety position- If
tetherYLerp.x is higher than 0.0,tetherdistanceis set to a lerp fromtetherYLerp.x totetherYLerp.y with a factor of instance.camtargety position /tetherYLerp.z. NOTE: This feature is complicated, see the tetherYLerp details section in the camera system page for more details
- If
overrideskyboxis false and RenderSettings.skybox isn't null:- If
nocolorchangeis 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
_Rotationmaterial property of the skybox is set to 180.0 + MainCamera x position
- If
- If
rotatecamis true, there areroundwaysand 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 theAntTunnelsmap, check theroundways[0]documentation to learn more. Also, this math is incorrect