Class "GridEntity"⚓︎
Info
You can get this class by using the following function:
Example Code
Game():GetRoom():GetGridEntity(25)
Class Diagram⚓︎
Content Overview
Return value | Function |
---|---|
boolean | Destroy ( boolean Immediate )⚓︎ |
boolean | DestroyWithSource ( boolean Immediate, EntityRef Source )⚓︎ |
int | GetGridIndex ( )⚓︎ |
RNG | GetRNG ( )⚓︎ |
GridEntityDesc | GetSaveState ( )⚓︎ |
Sprite | GetSprite ( )⚓︎ |
GridEntityType | GetType ( )⚓︎ |
int | GetVariant ( )⚓︎ |
boolean | Hurt ( int Damage )⚓︎ |
boolean | HurtWithSource ( int Damage, EntityRef Source )⚓︎ |
void | Init ( int Seed )⚓︎ |
void | PostInit ( )⚓︎ |
void | Render ( Vector Offset )⚓︎ |
void | SetType ( GridEntityType Type )⚓︎ |
void | SetVariant ( int Variant )⚓︎ |
GridEntityDoor | ToDoor ( )⚓︎ |
GridEntityPit | ToPit ( )⚓︎ |
GridEntityPoop | ToPoop ( )⚓︎ |
GridEntityPressurePlate | ToPressurePlate ( )⚓︎ |
GridEntityRock | ToRock ( )⚓︎ |
GridEntitySpikes | ToSpikes ( )⚓︎ |
GridEntityTNT | ToTNT ( )⚓︎ |
void | Update ( )⚓︎ |
GridCollisionClass | CollisionClass⚓︎ |
GridEntityDesc | Desc⚓︎ |
const Vector | Position⚓︎ |
int | State⚓︎ |
int | VarData⚓︎ |
Functions⚓︎
Destroy ()⚓︎
boolean Destroy ( boolean Immediate )⚓︎
DestroyWithSource ()⚓︎
boolean DestroyWithSource ( boolean Immediate, EntityRef Source )⚓︎
GetGridIndex ()⚓︎
int GetGridIndex ( )⚓︎
GetRNG ()⚓︎
RNG GetRNG ( )⚓︎
Warning
This RNG is initialized with the same seed for all grid entities in the whole run. Instead, it's advised to create a custom data structure or use either the SpawnSeed or VariableSeed fields from the GridEntityDesc object.
GetSaveState ()⚓︎
GridEntityDesc GetSaveState ( )⚓︎
Info
Both the Desc property and the GetSaveState() method return the exact same GridEntityDesc object. The game devs advise to use GetSaveState() instead of Desc.
GetSprite ()⚓︎
Sprite GetSprite ( )⚓︎
GetType ()⚓︎
GridEntityType GetType ( )⚓︎
GetVariant ()⚓︎
int GetVariant ( )⚓︎
Hurt ()⚓︎
boolean Hurt ( int Damage )⚓︎
HurtWithSource ()⚓︎
boolean HurtWithSource ( int Damage, EntityRef Source )⚓︎
Init ()⚓︎
void Init ( int Seed )⚓︎
PostInit ()⚓︎
void PostInit ( )⚓︎
Render ()⚓︎
void Render ( Vector Offset )⚓︎
SetType ()⚓︎
void SetType ( GridEntityType Type )⚓︎
SetVariant ()⚓︎
void SetVariant ( int Variant )⚓︎
ToDoor ()⚓︎
GridEntityDoor ToDoor ( )⚓︎
Return behavior
If the conversion is not successful, this function returns nil
.
ToPit ()⚓︎
GridEntityPit ToPit ( )⚓︎
Return behavior
If the conversion is not successful, this function returns nil
.
ToPoop ()⚓︎
GridEntityPoop ToPoop ( )⚓︎
Return behavior
If the conversion is not successful, this function returns nil
.
ToPressurePlate ()⚓︎
GridEntityPressurePlate ToPressurePlate ( )⚓︎
Return behavior
If the conversion is not successful, this function returns nil
.
ToRock ()⚓︎
GridEntityRock ToRock ( )⚓︎
Return behavior
If the conversion is not successful, this function returns nil
.
ToSpikes ()⚓︎
GridEntitySpikes ToSpikes ( )⚓︎
Return behavior
If the conversion is not successful, this function returns nil
.
ToTNT ()⚓︎
GridEntityTNT ToTNT ( )⚓︎
Return behavior
If the conversion is not successful, this function returns nil
.
Update ()⚓︎
void Update ( )⚓︎
Variables⚓︎
CollisionClass⚓︎
GridCollisionClass CollisionClass⚓︎
Desc⚓︎
GridEntityDesc Desc⚓︎
Info
Both the Desc property and the GetSaveState() method return the exact same GridEntityDesc object. The game devs advise to use GetSaveState() instead of Desc.
Position⚓︎
const Vector Position⚓︎
Returns the position of the grid cell's center point
State⚓︎
int State⚓︎
Used for various different usecases.
Example States
1 |
|
VarData⚓︎
int VarData⚓︎
A Variable that stores some entity-specific data. The content can have completely different effects for different GridEntities.
Example Code
This code spawns a functioning Void Portal into the center of the room. This will teleport you to the floor "The Void" and will have the same appearance as the vanilla portal:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
|