CheckSpecialID¶
This is a void returning parameterless method on EntityControl that is ran during Start. It can be considered as part of the Entity startup process because its name is underselling what the method does as its job is to initialise the fields and structure of any entity based on the AnimIDs. Because of this, it is the method that will assign most fields from EntityValues among other things.
Since this method implies extremely specific handling of specific AnimIDs, their handling will only be documented on a surface level, not in detail.
Here is what the method does:
- Unless
overrideshadowis true,hasshadowbecomes true if the AnimIDs is not None (which is -1) originalidis set to the current animid- From here, there are 2 special cases that can change what data is used depending on the animid:
- If it's
KeyL,KeyRorTablet, then the following fields gets set and nothing else will get assigned fromendata:nomodel,overrideanim,overrideanimfunc,overridemovesmokeandoverrridejumpare all trueminheightis pulled fromendatastartbfis set tobobrangestartbsis set tobobspeed- The appropriate sprite from
Sprites/Objects/artifactsfrom the root of the asset tree is set as the entity's sprite
- If it's
Strider,overridemovesmokeis set to true, but the rest goes as it normally would with theendataloading
- If it's
- If the AnimID is defined, the data from
endatais assigned, otherwise onlyoverrridejumpis set to true - Special AnimID startup
- The object is setup whenever
endata'sObjectis true or it's aCoilyVineand we aren't dealing withKeyL,KeyRorTablet. This is done by settingnotalkto true,hasshadowto false,startscaletoendata'sstartscaleand adding the model of the corresponding AnimID via AddModel that's located inPrefabs/Objects/with the offset beingendata'smodeloffset. Theanimidis overridden to -1 (None) unless it's aSavePointor aFlyTrapPlatform - If we aren't dealing with
KeyL,KeyRorTabletand the original animid is not -1 (None), then further startup steps are performed:- If the
endata'sismodelis true and it's not an item- The model of the corresponding AnimID that's located in
Prefabs/Objects/with the offset beingendata'smodeloffsetis added via AddModel. The offset is overriden to (0.0, 0.0 -height, 0.0) if it's aTrappedMoth. Themodel's angles are set to theendata'smodelscaleTODO: why? - From there, there are 3 special cases:
JumpingSpider: Set all child of the model to be rendered with the 3F3F3F color (light gray) fully opaquePitcherorPictherSummon: Setup 2extras, one being the object with the tagPitcherEndand the other being the second child of themodel. The firstextrasgets theUntaggedtag. For the second one all child's shadowCastingMode is set to TwoSided and the material set accordingly ifhologramwith half transparency. Finally,spinextrais set to to one vector being (0.0, 0.0, -0.2)Submarine: If there's annpcdataand it's not the player's entity, theccolis enabled and adjusted to have a radius of 2.5. Thenpcdata'scolliderheightis set to 20.0. NOTE: the enabling happens in 0.2 seconds in the future
- UpdateAnimSpecific is called
- The model of the corresponding AnimID that's located in
- More
endatafields are loaded:emoticonoffsettofreezeflipoffsetfreezesize(defaults to (2.0, 2.0, 1.0) if this andfreezeoffsetis 0)freezeoffset(defaults to (0.0, 1.0, 0.0) if this andfreezesizeis 0)
initialfrezeoffsetis set tofreezeoffset- If there's a
preloaddatainendata, they are all loaded intopreloadedobjectsandpreloadedspritesby loading the actual prefabs/sprites. They remain null otherwise - If the current map is laoded and we aren't in a battle
- if the current map is MetalLake,
startscaleis multiplied by 0.35 and theemoticon's localscale is set to (0.65, 0.65, 0.65) - If the current map's
waterfloatis present and we are dealing with aStrider,ignorewaterandalwaysactiveare set to true on top of the ignoring the collider of the map'swaterfloatwith this entity. Finally, the y position of the entity is set to the one of thewaterfloat
- if the current map is MetalLake,
- If the
- If the
animidisScorpionand we are at Giant's Lair, thebasestateis overridden to 150 andwalkstateto 151 which makes them render differently.