-
Notifications
You must be signed in to change notification settings - Fork 134
Dynamic Map Tiles Extended Actions
Actions are (mostly) things that happen when a trigger is triggered.
When adding map properties directly (as opposed to adding a field to the DMT dictionary), the format of the map property key should be:
DMT/{ActionName}{_Once/Swap}{TriggerName}
Once and Swap are optional.
DMT currently recognizes the following action keys (triggers are listed here):
- DMT/action
- DMT/addLayer
- DMT/addTilesheet
- DMT/barrier
- DMT/changeIndex
- DMT/changeMultipleIndex
- DMT/changeMultipleProperties
- DMT/changeProperties
- DMT/push
- DMT/pushable
- DMT/pushAlso
- DMT/pushOthers
- DMT/addQuest
- DMT/appearance
- DMT/buff
- DMT/emote
- DMT/friends
- DMT/health
- DMT/healthPerSecond
- DMT/healthPerSecondContinuous
- DMT/give
- DMT/mailbox
- DMT/mail
- DMT/mailRemove
- DMT/makeover
- DMT/makeoverGendered
- DMT/move
- DMT/removeQuest
- DMT/slippery
- DMT/speed
- DMT/stamina
- DMT/staminaPerSecond
- DMT/staminaPerSecondContinuous
- DMT/teleport
- DMT/teleportTile
- DMT/take
- DMT/transmog
- DMT/transmogGendered
- DMT/warp
- DMT/wardrobe
- DMT/wardrobeGendered
Trigger an existing tile action.
The x,y coordinates of the tile to trigger, separated by a comma (',').
"DMT/action_On": "69,20"
Add a layer to the current map.
The id of the layer as a string, must be unique.
"DMT/addLayer_Enter": "DMT/TestLayer"
Give a player a quest.
The quest ID you wish to add.
"DMT/addQuest_Once_MonsterSlain(GoopAlienBrood)": "MindMeltMax.WeirdEvents/FriendOfTheGoop"
Add a tilesheet to the current map.
A comma (',') delimited string of the id of the tilesheet (must be unique), and the path to the tilesheet image (tilesheet image can be loaded).
{
"LogName": "My Custom Tilesheet Load",
"Action": "Load",
"Target": "Maps/z_MyUniqueTilesheet",
"FromFile": "assets/z_MyUniqueTilesheet.png"
},
"DMT/addTilesheet_Enter": "{{ModId}}_MyTilesheetId1,TileSheets/furniture",
"DMT/addTilesheet_Load": "{{ModId}}_MyTilesheetId2,Maps/z_MyUniqueTilesheet",
"DMT/changeMultipleIndex_Item((O)390)": "Front 59 24={{ModId}}_MyTilesheetId2/0"
Prevent certain character types from entering this tile.
A list of character types separated by pipes ('|'). Possibe character types include:
- Character
- FarmAnimal
- NPC
- Pet
- Child
- Horse
- Junimo
- JunimoHarvester
- TrashBear
- Raccoon
- Farmer
- Monster
and all specific monster types. Note that character types will also check subtypes, so Character will check every character type, NPC will check NPCs and any NPC subtypes (like Pet, Monster, etc).
Note that this doesn't work on flying monsters.
"DMT/barrier": "GreenSlime|Farmer|Pet"
Animations are such complex objects (even with the new format), that they deserve their own file, which you can find here.
Animations are such complex objects (even with the new format), that they deserve their own file, which you can find here.
Changes various aspects of the triggering farmer's appearance.
Changes take a comma-separated pair: {type},{value}. Types can include:
- hairstyle (number value - each hairstyle has an associated number (see
Data/HairDatafor vanilla hairstyles) - haircolor (#FFFFFF color value)
- eyecolor (#FFFFFF color value)
- accessory (number value -1 to 29)
- skincolor (number value 0 to 23)
- gender ("female" or "male" value)
Multiple changes can be triggered using pipes to separate ('|').
"DMT/appearance_On": "hairstyle,1"
"DMT/appearance_Off": "hairstyle,2|haircolor,#000000"
Add a buff or debuff to the player.
A string with multiple id's of items in Data\\Buffs separated by bars ('|'). Each id can also have a custom display source specified when followed by a comma (',').
"DMT/buff_Once_On": "22|27"
"DMT/buff_On": "MindMeltMax.WeirdEvents/Gooped,Sludge Tile"
Change the index of the tile currently under the player.
- An empty string, this will remove the tile from the layer.
- A number representing a different index in the same tilesheet as the current tile.
- A combination of an existing tilesheet id (string) and an index in said tilesheet (number) split by a forward slash ('/').
- A collection of option 2 or 3 to create an animated tile split by a space (' ') followed by comma (',') and the interval between frames in milliseconds
- "DMT/changeIndex_On": ""
- "DMT/changeIndex_On": "137"
- "DMT/changeIndex_On": "indoors/57"
- "DMT/changeIndex_On": "indoors/1741 indoors/1773 indoors/1805 indoors/1773 indoors/1741,250"
Change multiple tile indexes on the current map.
Every accepted value for this works the same as Change Index, however they should be prefixed with the layer and tile coordinates.
This example mixes some available values from Change Index, you can mix and match the variants from there as you need them here, as long as they are prefixed by '{layer id} {x position of tile} {y position of tile}=...', each one must bu split by a pipe ('|').
"DMT/changeMultipleIndex_Enter": "Buildings 12 27=indoors/472|Buildings 12 28=indoors/473|Buildings 12 29=indoors/474|Buildings 13 27=indoors/504|Buildings 13 28=indoors/505|Buildings 13 29=indoors/506|Buildings 14 27=indoors/536|Buildings 14 28=indoors/537|Buildings 14 29=indoors/538"
Change the properties of multiple tiles.
"DMT/changeMultipleProperties"
A pipe ('|') delimited string of key=value pairs.
Unlike with Change Properties, here the key is split up into multiple parts separated by comma's (',').
These parts are formatted like:
- (optional) The tile layer id to select the tile from
- The tile x position
- The tile y position
- The actual tile property
Note if the "=value" is ommited, the property will be removed instead.
"DMT/changeMultipleProperties_Once_On": "Buildings,17,8,Action=MindMeltMax.YouWishThisExisted/CouponMachine|Buildings,17,8,Passable|17,8,NoFurniture=T"
"DMT/changeMultipleProperties_Enter": "NoFurniture=T|TouchAction=MindMeltMax.WeirdEvents/BossFight7"
Change the properties of a tile.
A pipe ('|') delimited string of key=value pairs.
Note if the "=value" is ommited, the property will be removed instead.
"DMT/changeProperties_On": "TouchAction|Action=kitchen"
Spawn a chest with item's (and/or money).
A string with multiple parts, defined as follows:
- The tile position as a space (' ') delimited string, followed by an equals sign ('=').
- (optional) The non-qualified item id of the chest followed by a pipe ('|').
- A space (' ') delimited string of either items or money as defined in the formats for give and take.
Note that since the 1.6 update, a chest can not directly contain money. The workaround for this is that DMT will add the new Gold coin object with the stack size being the amount of money, each gold coin is worth 250 money.
"DMT/chest_Once_MonsterSlain": "7 12=BigChest|Money/10 (O)336,5 (O)384,17 (O)125"
"DMT/chest_Once_On": "15 15=(O)349,3 (O)773,3 (O)772"
Make the player perform an emote.
The numerical id of the emote in string form. This can be found by opening Tilesheets\\emotes and picking the emote you want. The id will be: (4 x The row of the emote) + 4; the + 4 is added because the first row in the texture is skipped.
"DMT/emote_Talk(Abigail)": "52"
Start an event.
This action accepts a single string with the entire event script to be played.
However this can now also be loaded directly from the asset.
The format for this is as follows, each part must be split by a pipe ('|'):
- The event script, in case you just want to include the assetName / event id for the event.
- The name of the asset, if loading from this, also include the asset key in this format: "AssetName#AssetKey"
- The event id to add it to the players seen events.
"DMT/event_Once_Enter": "|MindMeltMax.WeirdEvents#GoopAliens|goopAlienLanding"
"DMT/event_Once_On": "I need to write an event script here..."
Makes a tile vulnerable to explosions.
An optional mail flag to set when the tile explodes.
Note Tiles with this property will be removed when an explosion hits them. The key should simply be "DMT/explode" with no modifiers.
"DMT/explode": ""
"DMT/explode": "myTileExplodedMailFlag"
Triggers an explosion.
A comma (',') delimited string with multiple options to use when triggering the explosion. These options are as follows in order:
- The tile x position (must set y too) - defaults to this tile
- The tile y position (must set x too) - defaults to this tile
- The radius of the explosion
- Whether to damage the farmer
- A custom amount of damage
- Whether to destroy objects
- The sound of the explosion - defaults to "explosion"
Note all values are technically optional, and any one can be ommited by just leaving the value blank (see examples below).
"DMT/explosion_MonsterSlain(Mummy)": "7,15,3,,,,thunder"
"DMT/explosion_On": ",,5,120,false,true"
Fertilize one or more tiles with a given fertilizer.
A string of the format x,y=fertilizerName. If fertilizerName is omitted, the fertilizer will be removed from that tile. To fertilize multiple tiles at once repeat this pattern separated by bars ('|').
"DMT/fertilize": "64,19,368" "DMT/fertilize": "64,19,"
Increase or decrease friendship with an npc or animal type
A string with pairs of the NPC's internal name or the animal type, and the amount by which to change friendship, separated by a comma (','). To change multiple values at once repeat this pattern separated by bars ('|')
"DMT/friends": "Marnie,50|Cow,15|Chicken,15"
Give the player a specified item (or money)
- A string beginning with "Money/" followed by the amount of money to be added.
- A single qualified item id.
- A comma (',') delimited string with: the qualified item id, the stack size, (optional) the quality; In that order.
"DMT/give_Once_On": "(O)76"
"DMT/give_Once_MonsterSlain": "Money/2500"
"DMT/give_Talk(Abigail)": "(O)66"
"DMT/give_Talk(Willy)": "(O)131,1,4"
Grow one or more crops completely when triggered.
A string a pair of x and y tile coordinates separated by a comma (','). To change multiple values at once repeat this pattern separated by bars ('|')
"DMT/growCrop_On": "64,19|64,20"
Add or remove health from the player.
A number value in string form. Can be either positive to add health, or negative to remove health.
"DMT/health_On" "-12"
"DMT/health_MonsterSlain": "2"
Add or remove health from the player every second for a duration.
2 number values in string form split by a comma (','). The first value specifies the number of seconds to update health for, the second the amount of health restored/taken.
"DMT/healthPerSecond_On": "10,2"
"DMT/healthPerSecond_Off": "15,-1"
Add or remove health from the player every second until they move from the tile they were on when this was triggered.
a number value in string form specifying the amount of health restored/taken.
"DMT/healthPerSecondContinuous_On": "2"
"DMT/healthPerSecondContinuous_On": "-1"
Invalidate an asset from the game's asset cache, forcing it to be reloaded when next requested.
The name of the asset you want to invalidate, may be split by bars ('|') to invalidate multiple assets
"DMT/invalidate_Enter": "Data/Locations"
"DMT/invalidate_On": "Data/Objects|Strings/Objects|Strings/BigCraftables|Data/BigCraftables"
Kill one or more crops when triggered.
A string a pair of x and y tile coordinates separated by a comma (','). To change multiple values at once repeat this pattern separated by bars ('|')
"DMT/killCrop_On": "64,19|64,20"
Add a mail flag from the player if they don't have it yet.
The mail flag you wish to set, if not added already.
"DMT/mail_Once_Talk(Haley)": "MindMeltMax.BestGirl/MetTheQueen"
Add mail for tomorrow to the players mailbox.
The id of the item in Data\\Mail you wish to add to the mailbox, if it's not already added.
"DMT/mailbox_Once_MonsterSlain(GoopAlienBrood)": "MindMeltMax.WeirdEvents/MYSONHOWCOULDYOU"
Remove a mail flag from the player if they have it.
The mail flag you wish to remove, if it's known by the player.
"DMT/mailRemove_Once_MonsterSlain(GoopAlienBrood)": "MindMeltMax.WeirdEvents/FriendOfTheGoop"
Give a farmer a makeover outfit from "Data/MakeoverOutfits". Currently worn clothing will be returned to the player inventory or lost & found.
The id of the makeover outfit. Multiple ids can be separated with a pipe '|' to choose one randomly.
"DMT/makeover_Once_On": "JojaCap_Shirt105_FarmerPants"
Give a farmer a makeover outfit from "Data/MakeoverOutfits" based on their gender. Currently worn clothing will be returned to the player inventory or lost & found.
Two ids of makeover outfits for each gender, separated with a pipe '|'.
"DMT/makeoverGendered_Once_On": "Beanie_SkullShirt_FarmerPants|Beanie_ClassyTop_Dress"
Show a message box.
This action accepts a plain string (which can be split by a hashtag ('#') to separate into multiple consecutive dialogues).
However another accepted value starts with a boolean value ("True" or "False") followed by a pipe ('|') and then either a regular dialogue string (if false) or a string with mail formatting (if true).
Note that regular dialogue works also when true, however mail formatting won't be applied when false.
Note also that some triggers which make menus appear (like Talk), will not work well with this action, use of it is not advised.
"DMT/message_Item((O)289)": "T-This is huge!#What kind of chickens do you have on that farm!"
"DMT/message_MonsterSlain": "True|It is done...^The ritual is complete...^Now all that rests you is to claim the loot in the last dungeon.^I promise it's the last this time...^I think... %item quest MindMeltMax.EndlessDungeon/TotallyTheLastOne true %% [textcolor red][#]Found Letter #237"
Spawn one or more monsters.
Each monster to spawn should be a comma-separated list of values. Multiple mosters can be spawned using a pipe ('|'). The list of values will depend on the specific C# constructor being called, but the first three values should be the C# monster class name, the x coordinate, and the y coordinate in that order. Subsequent values should correspond to constructor parameters besides the spawn position. Possible parameters include:
- integer, e.g. for mineLevel
- boolean, e.g. for hardMode
- color, e.g. for GreenSlimes
Note To use this key you will need to know the constructor you want to call. There is a list here.
Note Color parameters should be in the format #FFFFFF.
Note This action supports the Custom Monsters mod, in which case you should only pass the first three values.
"DMT/monster_On": "GreenSlime,640,1280,#00FF00|GreenSlime,704,1280,#0000FF"
"DMT/monster_Enter": "MyCustomMonster,640,1280"
Change mod data for object or furniture at given tiles.
Each mod data to set should be a comma-separated list of fields. Multiple mod data keys can be set using a pipe ('|').
Fields are:
- X coordinate of the tile to set mod data on
- Y coordinate of the tile to set mod data on
- key to set
- value to set the key to
"DMT/modData_Load": "5,6,AlternativeTexture,MyTextureName"
Spawn objects or furniture at given tiles.
Each object to be spawned should be a comma-separated list of fields. Multiple objects can be spawn using a pipe ('|').
Fields are:
- X coordinate of the tile to spawn the object on
- Y coordinate of the tile to spawn the object on
- Qualified item id of the object to spawn (e.g. "(BC)55" or "(F)UprightPiano")
- (optional) true or false value of whether the object or furniture can be moved by players
- (optional) integer 0-4 for furniture rotation, only applicable if spawning furniture
"DMT/object_Load": "5,6,(F)UprightPiano,false,1|10,6,(BC)55,false"
Move the player in a direction.
2 decimal number values in string form split by a comma (','). These numbers represent the direction the player should move in, where 1 is 1 pixel moved.
The first number is the x position, setting this to negative makes the player move left, while a positive value makes the player move right.
The second number is the y position, same logic applies here: negative = down, positive = up.
Note that the general rule is 64 pixels = 1 tile, so to make the player move one tile right, the first number needs to be 64.
"DMT/move_On": "256,77"
"DMT/move_Off": "-122,320"
Play an existing music track.
The name of a known music track. This does accept mod added songs in the same way. Multiple tracks can be separated with a pipe ('|') to choose one at random.
"DMT/music_Enter": "winter1"
Push a tile when triggered.
A string of tile positions in the form of '{x} {y}' representing the allowed destination tiles, separated by commas (',').
Note this property is only applicable to the "Buildings" layer.
"DMT/push_On": "7 15, 7 17"
Allow a tile to be pushed by farmers.
A string of tile positions in the form of '{x} {y}' representing the allowed destination tiles, separated by commas (',').
Note this key should not take any modifers.
Note this property is only applicable to the "Buildings" layer.
"DMT/pushable": "3 3, 3 5, 2 4, 4 4"
Allow a tile to be pushed when a neighbor tile is pushed.
A string of tile offsets with the layer id to push the tile from in the form of '{layer Id} {x offset} {y offset}' representing the tile offset on the specified layer, relative to the original pushed tile. Each part must be separated by comma's (',').
Note this property can push tiles on layers other than "Buildings".
Note also, this property does not accept triggers and can only be actived when a neighboring tile is pushed.
"DMT/pushAlso": "Front 0 -1, Front 0 -2, Buildings 0 -3"
Specify other tiles to be pushed.
A string of tile positions with the layer id to push the tile from in the form of '{layer Id} {x} {y}' representing the tile position on the specified layer. Each part must be separated by comma's (',').
Note this property can push tiles on layers other than "Buildings". Note also, tiles pushed by this property will activate tiles with the Push Also property.
"DMT/pushOthers_On": "Buildings 5 15, Front 4 16, Front 5 16, Front 6 16"
Remove a quest from a player.
The quest ID you wish to remove.
"DMT/removeQuest_Once_MonsterSlain(GoopAlienBrood)": "MindMeltMax.WeirdEvents/FriendOfTheGoop"
Set crop for one or more hoe dirt when triggered.
A string in the format x,y,SeedId,GrowthPhase. To change multiple values at once repeat this pattern separated by bars ('|')
Note If a hoe dirt is not found at the coordinates,
Note GrowthPhase can be omitted to just plant a seed, or set to -1 to fully grow the crop.
Note Existing crops will be replaced.
"DMT/setCrop_On": "64,19,433,1"
Play one or more sounds.
A pipe ('|') delimited string of sound names with optional delays (split by commas (',')).
"DMT/sound_Item((O)335)": "hammer"
"DMT/sound_Item((O)335)": "hammer,150"
"DMT/sound_Item((O)335)": "pickupItem|money,300|money,450"
Make the player slide across tiles.
A decimal number in string form representing the speed at which to slide the player.
Note this value stacks when surrounding tiles also have this property. Note also, this property does not accept triggers and will only activate when stepped on.
"DMT/slippery": "1.2"
Set a speed multiplier for the player.
A decimal number value in string form.
"DMT/speed_Enter": "1.2"
Add or remove stamina from the player.
A number value in string form. Can be either positive to add health, or negative to remove health.
Note that the value accepts whole and decimal values.
"DMT/stamina_Item((O)306)": "25"
"DMT/stamina_Talk(Piere)": "-5"
Add or remove stamina from the player every second for a duration.
2 number values in string form split by a comma (','). The first value specifies the number of seconds to update stamina for, the second the amount of stamina restored/taken.
Note that the second number (the actual stamina value) accepts whole and decimal values.
"DMT/staminaPerSecond_Once_Enter": "60,1.5"
"DMT/staminaPerSecond_Explode": "5,-2"
Add or remove stamina from the player every second until they move from the tile they were on when this was triggered.
a number value in string form specifying the amount of stamina restored/taken.
"DMT/staminaPerSecondContinuous": "2"
"DMT/staminaPerSecondContinuous": "-1"
Take a specified item (or money) from the player.
- A string beginning with "Money/" followed by the amount of money to be added.
- A single qualified item id.
- A comma (',') delimited string with: the qualified item id, the stack size, (optional) the quality; In that order.
"DMT/take_Once_Enter": "Money/500"
"DMT/take_Talk(Piere)": "(O)MindMeltMax.YouWishThisExisted/DiscountCoupon"
"DMT/take_Talk(Abigail)": "(O)66,5"
Teleport the player to a specified pixel coordinate.
A comma (',') delimited string with the X and Y pixel coordinates.
"DMT/teleport_On": "516,1272"
Teleport the player to a specified tile coordinate.
A comma (',') delimited string with the X and Y tile coordinates.
"DMT/teleportTile_Off": "6,13"
Spawn terrain features at given tiles.
Each terrain feature to be spawned should be a comma-separated list of fields. Multiple terrain features can be spawn using a pipe ('|').
Fields are:
- X coordinate of the tile to spawn the terrain feature on
- Y coordinate of the tile to spawn the terrain feature on
- type of terrain feature to spawn (one of Tree, FruitTree, Grass, HoeDirt)
- (optional) type of Grass, Tree, or Fruit Tree
- (optional) number of grass weeds, Tree or Fruit Tree growth stage
"DMT/terrainFeature_Load": "5,6,HoeDirt|10,6,Tree,1,5"
Give a farmer a makeover outfit from "Data/MakeoverOutfits". Currently worn clothing will be irrevocably replaced.
The id of the makeover outfit. Multiple ids can be separated with a pipe '|' to choose one randomly.
"DMT/transmog_On": "JojaCap_Shirt105_FarmerPants"
Give a farmer a makeover outfit from "Data/MakeoverOutfits" based on their gender. Currently worn clothing will be irrevocably replaced.
Two ids of makeover outfits for each gender, separated with a pipe '|'.
"DMT/transmogGendered_Once_On": "Beanie_SkullShirt_FarmerPants|Beanie_ClassyTop_Dress"
Give a farmer a makeover outfit from "Data/MakeoverOutfits" if they have the required items in their inventory. Currently worn clothing will be returned to the player inventory or lost & found.
The id of the makeover outfit. Multiple ids can be separated with a pipe '|' to choose one randomly.
"DMT/wardrobe_On": "JojaCap_Shirt105_FarmerPants"
Give a farmer a makeover outfit from "Data/MakeoverOutfits" based on their gender if they have the required items in their inventory. Currently worn clothing will be returned to the player inventory or lost & found.
Two ids of makeover outfits for each gender, separated with a pipe '|'.
"DMT/wardrobeGendered_Swap_On": "Beanie_SkullShirt_FarmerPants|Beanie_ClassyTop_Dress" "SwapDMT/wardrobeGendered_Swap_On": "None_GraySuit_FarmerPants|LogoCap_SugarShirt_Skirt"
Warp a farmer to a given location and coordinates.
A string of the format LocationName,x,y.
"DMT/teleport": "Farm,69,20"