-
Notifications
You must be signed in to change notification settings - Fork 80
SMODS.Tag
Casimir Eisenach edited this page Jan 22, 2025
·
3 revisions
Class prefix: tag
-
Required parameters:
key
-
loc_txt
or localization entry (reference)
-
Optional parameters (defaults):
-
atlas = 'tags', pos = { x = 0, y = 0 }
(reference) -
config = {}, discovered = false, no_collection, prefix_config, dependencies
(reference) -
min_ante
: Minimum ante needed for this tag to appear. Use in_pool for more advanced spawn restrictions instead.
-
-
loc_vars, generate_ui
(reference) -
in_pool(self, args) -> bool, { allow_duplicates = bool }
- Define custom logic for when a tag is allowed to spawn. A tag can spawn if
in_pool
returns true and all other checks are met. - When called from
generate_card_ui
, the_append
key is passed asargs.source
.
- Define custom logic for when a tag is allowed to spawn. A tag can spawn if
-
apply(self, tag, context)
- This function defines the tag's behavior when triggering. Unlike vanilla tags, this function is not restricted by
self.config.type
matchingcontext.type
, meaning you have to check context manually.- To trigger the tag, you should call
tag:yep(message, colour, func)
and settag.triggered = true
. -
message
is the string to display upon trigger, -
colour
is the colour of the message box, -
func
is a function that gets executed as an event before the used tag gets removed. This function should always returntrue
.
- To trigger the tag, you should call
- This function defines the tag's behavior when triggering. Unlike vanilla tags, this function is not restricted by
-
set_ability(self, tag)
- This function allows you to store any additional information your tag may need when it is created. Values should be stored within
tag.ability
.
- This function allows you to store any additional information your tag may need when it is created. Values should be stored within
Game Objects
- API Documentation
- SMODS.Achievement
- SMODS.Atlas
- SMODS.Blind
- SMODS.Center
- SMODS.Challenge
- SMODS.DeckSkin
- SMODS.Keybind
- SMODS.Language
- SMODS.ObjectType
- SMODS.PokerHand
- SMODS.Rarity
- SMODS.Seal
- SMODS.Sound
- SMODS.Stake
- SMODS.Sticker
- SMODS.Suit and SMODS.Rank
- SMODS.Tag
Guides
- Your First Mod
- Mod Metadata
- Joker Calculation
- Calculate Functions
- Logging
- Event Manager
- Localization
- Mod functions
- UI Structure
- Utility Functions
Found an issue, or want to add something? Submit a PR to the Wiki repo.