Placeholders
Updated 2 weeks ago1 - How to use?
The mod uses Scriban for placeholders. This library allows for simple and if you want complex placeholders, for example displaying a piece of text depending on whether u have more than 60 FPS or less.
It's better to show it off on an example:
{{ player.avatar?.title | utils.clean_string }}
Now this is more of a complex one, but here's how it works:
- The text is enclosed in {{ }}. This indicates to the parser that everything inside should be replaced.
- We want for it to display the avatar title, to do that we wrote:
player.avatar?.title. This accesses the Crate of the Avatar and gets it's title. The question mark indicates that the avatar might benull(non-existent). - Some avatars use Unity Rich Text, therefore we need to get rid of it as Discord cannot display it. To do that we use a utility provided by the mod:
utils.clean_string. This basically just removes all of the rich text
This should display the name of the avatar currently being used. This explanation might not be the best so I recommend looking at Scriban's documentation instead
2 - Properties
By default, the mod provides a few properties, while also allowing for easier addition of new ones by other mods
2.1 - Player
This is accessible under the name player.
avatar (type: Crate)
This property provides the avatar that the player is currently using. This value might be null
left_hand (type: Crate)
This property provides the spawnable that the player is holding in their left hand. This value might be null
right_hand (type: Crate)
This property provides the spawnable that the player is holding in their right hand. This value might be null
health (type: float)
This property provides the current amount of health that the player has. Example: 93.75
max_health (type: float)
This property provides the maximum amount of health that the player can have.
health_percentange (type: float)
This property provides the percentage of health that the player has. (This DOES NOT add the percent symbol, it simply provides the numer).
2.2 - Ammo
This is accessible under the name ammo.
get_ammo (Method) (returns int)
Parameters
- [type: string] type - the type of ammo
This method gets the amount of ammo that the player has of the provided type
light (type: int)
This property provides the amount of light ammo that the player has
medium (type: int)
This property provides the amount of medium ammo that the player has
heavy (type: int)
This property provides the amount of heavy ammo that the player has
2.3 - Game
This is accessible under the name game.
level (type: Crate)
This property provides the level that the player is currently in. This value might be null
level_name (type: string)
This property provides the name of the level that the player is currently in. This property respects the RemoveLevelNumbers setting. It is recommended to use this instead of level.title
ml_version (type: string)
This property provides the version of MelonLoader being used as a string
fps (type: int)
This property provides the current amount of frames per second
operating_system (type: string)
This property provides the name of the Operating System being used
mods_count (type: int)
This property provides the amount of Mod.io mods installed
code_mods_count (type: int)
This property provides the amount of Code mods (MelonLoader mods) installed
2.4 - Utils
This is accessible under the name utils.
get_pallet (Method) (returns Pallet)
Parameters
- [type: string] barcode - the barcode of the pallet you want to get
This method returns the pallet with the provided barcode. Might be null
clean_string (Method) (returns string)
Parameters
- [type: string] str - the text you want to clean
This method returns a cleaned version of the provided text. By cleaned that means without any Unity Rich Text
2.5 - Fusion
This is accessible under the name fusion and is only available when LabFusion is installed. Please note that each property will return null if not connected to a lobby.
username (type: string)
This property provides the username that you are using
display_name (type: string)
This property provides the display name that you are using
lobby_name (type: string)
This property provides the name of the lobby you are currently in
lobby_id (type: long/number)
This property provides the ID of the lobby you are currently in
lobby_host (type: string)
This property provides the name of the host of the lobby you are currently in
permission_level (type: string)
This property provides the level of permissions that you have. Possible values: GUEST, DEFAULT, OPERATOR, OWNER
current_players (type: int)
This property provides the amount of players in the lobby you are in
max_players (type: int)
This property provides the max amount of players that can be in the lobby you are in
network_layer (type: string)
This property provides the name of the Network Layer you are using. For example: Steam
privacy_level (type: string)
This property provides the visibility of the lobby you are in. Possible values: Unknown, Public, Private, Friends Only, Locked
3 - Types
3.1 - Crate
Crates hold the actual spawnable/avatar.
type (type: CrateType)
This property provides what kind of Crate is it. Available values: Spawnable, Avatar, Level, VFX
barcode (type: string)
This is a unique identifier for the Crate, no other Crate can have the same one
title (type: string)
This is the title of the Crate. This is intended to be shown in for example the Spawn Gun
description (type: string)
This is the description of the Crate. This is intended to be shown in for example the Spawn Gun
redacted (type: boolean)
Whether or not the Crate should be accessible to the player.
unlockable (type: boolean)
Whether or not the Crate can be unlocked by the player. (using the Gacha Machine)
tags (type: array<string>)
This is a list of tags (strings/text). Tags are usually intended to mark their core functionality. For example NPCs usually have the tag NPC.
bone_tags (type: array<BoneTag>)
This is a list of Bone Tags. BoneTags provide references to things like the Player.
pallet (type: Pallet)
This is the Pallet that contains the crate.
3.2 - Pallet
Pallets contain the information about the mod, they also hold all of the crates
barcode (type: string)
This is a unique identifier for the Pallet, no other Pallet can have the same one
title (type: string)
This is the title of the Pallet. This is intended to be shown in for example the Spawn Gun
description (type: string)
This is the description of the Pallet. This is intended to be shown in for example the Spawn Gun
author (type: string)
This property has the author of the Pallet. This can be used to filter pallets by author in the Spawn Gun
redacted (type: boolean)
Whether or not the Pallet should be accessible to the player.
unlockable (type: boolean)
Whether or not the Pallet can be unlocked by the player.
tags (type: array<string>)
This is a list of tags (strings/text). Tags are usually intended to mark their core functionality. For example NPCs usually have the tag NPC.
version (type: string)
This is the version of the Pallet.
sdk_version (type: string)
This is the version of the MarrowSDK.
crates (type: array<Crate>)
This is a list of Crates that the Pallet contains.
change_logs (type: array<ChangeLog>)
This is a list of ChangeLogs. The array contains a ChangeLog for each version, if provided by the mod creator.
data_cards (type: array<DataCard>)
This is a list of DataCards. DataCards contain music and ambience tracks and/or BoneTags (BoneTag = DataCard)
dependencies (type: array<string>)
This is a list of dependencies.
3.3 - ChangeLog
A ChangeLog provides details about what was changed in a provided version
title (type: string)
This is the title of the ChangeLog.
version (type: string)
This is the version that the ChangeLog is for
text (type: string)
This is the text. It contains the actual list of changes in the version, if provided by the mod creator
3.4 - DataCard/BoneTag
DataCard and BoneTag are basically the same. DataCards contain music and ambience tracks and/or BoneTags
barcode (type: string)
This is a unique identifier for the DataCard, no other DataCard can have the same one
title (type: string)
This is the title of the DataCard.
description (type: string)
This is the description of the DataCard.
redacted (type: boolean)
Whether or not the DataCard should be accessible to the player.
unlockable (type: boolean)
Whether or not the DataCard can be unlocked by the player.