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
overrideshadow
is true,hasshadow
becomes true if the AnimIDs is not None (which is -1) originalid
is 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
,KeyR
orTablet
, then the following fields gets set and nothing else will get assigned fromendata
:nomodel
,overrideanim
,overrideanimfunc
,overridemovesmoke
andoverrridejump
are all trueminheight
is pulled fromendata
startbf
is set tobobrange
startbs
is set tobobspeed
- The appropriate sprite from
Sprites/Objects/artifacts
from the root of the asset tree is set as the entity's sprite
- If it's
Strider
,overridemovesmoke
is set to true, but the rest goes as it normally would with theendata
loading
- If it's
- If the AnimID is defined, the data from
endata
is assigned, otherwise onlyoverrridejump
is set to true - Special AnimID startup
- The object is setup whenever
endata
'sObject
is true or it's aCoilyVine
and we aren't dealing withKeyL
,KeyR
orTablet
. This is done by settingnotalk
to true,hasshadow
to false,startscale
toendata
'sstartscale
and adding the model of the corresponding AnimID via AddModel that's located inPrefabs/Objects/
with the offset beingendata
'smodeloffset
. Theanimid
is overridden to -1 (None) unless it's aSavePoint
or aFlyTrapPlatform
- If we aren't dealing with
KeyL
,KeyR
orTablet
and the original animid is not -1 (None), then further startup steps are performed:- If the
endata
'sismodel
is true and it's not an item- The model of the corresponding AnimID that's located in
Prefabs/Objects/
with the offset beingendata
'smodeloffset
is 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
'smodelscale
TODO: 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 opaquePitcher
orPictherSummon
: Setup 2extras
, one being the object with the tagPitcherEnd
and the other being the second child of themodel
. The firstextras
gets theUntagged
tag. For the second one all child's shadowCastingMode is set to TwoSided and the material set accordingly ifhologram
with half transparency. Finally,spinextra
is set to to one vector being (0.0, 0.0, -0.2)Submarine
: If there's annpcdata
and it's not the player's entity, theccol
is enabled and adjusted to have a radius of 2.5. Thenpcdata
'scolliderheight
is 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
endata
fields are loaded:emoticonoffset
tofreezeflipoffset
freezesize
(defaults to (2.0, 2.0, 1.0) if this andfreezeoffset
is 0)freezeoffset
(defaults to (0.0, 1.0, 0.0) if this andfreezesize
is 0)
initialfrezeoffset
is set tofreezeoffset
- If there's a
preloaddata
inendata
, they are all loaded intopreloadedobjects
andpreloadedsprites
by 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,
startscale
is multiplied by 0.35 and theemoticon
's localscale is set to (0.65, 0.65, 0.65) - If the current map's
waterfloat
is present and we are dealing with aStrider
,ignorewater
andalwaysactive
are set to true on top of the ignoring the collider of the map'swaterfloat
with 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
animid
isScorpion
and we are at Giant's Lair, thebasestate
is overridden to 150 andwalkstate
to 151 which makes them render differently.