Skip to content

Modify various game elements in the Farm Merge Valley Discord game, including unlimited item acquisition, obstacle removal, and merge chance adjustments. Inspired by @wooslow's archive.

License

Notifications You must be signed in to change notification settings

AstraaDev/FarmMergeValley-Injector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 

Repository files navigation

[Discord] - FarmMergeValley Injector

FMV Injector lets you set up various methods for modifying content in the Farm Merge Valley Discord game. This project is based on @wooslow's repository on the same subject. For best results, perform these steps using Google Chrome. There is no guarantee that these methods will work on other browsers.

These methods violate the game developers' rules, and many bans have already occurred. I take no responsibility for your actions. Use this tool only if you fully understand the risks involved.


Features


Common Steps for Each Method

All methods rely on pausing the game at a precise moment to access normally restricted elements. The difference between methods lies in the specific data retrieved, the exact breakpoint timing, and the injection commands. The initial setup is the same for all methods.

  • Launch Farm Merge Valley on Discord and do not close it until you finish.
  • Open the browser DevTools (press CTRL + SHIFT + I on Windows/Linux or Cmd + Opt + I on Mac).
  • The game should now be paused. In the CONSOLE tab, enter:
Function.prototype.constructor = function() {};
  • Click the Resume script execution button (the blue ▶️ button) (see image below)

Make sure these steps are followed exactly before proceeding to any method-specific instruction


[METHOD 1] : giveInventoryItem

Items you can obtain with this method
Parameter Description
coins Yellow coins
gems Purple gems
exp Experience
level Level
crates Crates with items
energy Energy for activities
tickets Train tickets
wheat Wheat
egg Egg
sunflower Sunflower
milk Milk
sugarcane Sugarcane
bacon Bacon
carrot Carrot
goatmilk Goat milk
soybeans Soybeans
wool Wool
corn Corn
fur Fur
coffeebeans Coffee beans
tomato Tomato
avocado Avocado
truffle Truffle
Click to expand detailed instructions

Locating the File

  • Go to the SOURCE tab.
  • Open the file search panel (CTRL+P).
  • Search for the file AutoPlaceSystem.ts.

Note: Full path: /farm-merge-game/src/core/gameobjects/systems/AutoPlaceSystem.ts

Injection

  • Inside AutoPlaceSystem.ts, open the search panel (CTRL+F).
  • Search for:
const originCell
  • There will be only one result. Set a breakpoint on this line by clicking in the gray area to the left.

Full line: const originCell: GridCell | undefined = this.services.mapGrid.getCell(autoPlaceBehavior.rootPosition.column, autoPlaceBehavior.rootPosition.row);

  • Return to the game and move an object (or place it on another object). The game should pause again.
  • In the CONSOLE tab, enter:
worldServices = this.services
  • Go back to the AutoPlaceSystem.ts file in the SOURCE tab, remove the breakpoint (click it again), then click Resume script execution.

Setting up the function

  • In the CONSOLE, enter:
let giveInventoryItem = (target, amount) => {
    return worldServices.rewardService.giveInventoryReward({
        "reward": {"key": target, "amount": amount},
        "parent": worldServices.mapGridView._view.parent.parent.parent
    });
}

Using the Injection

  • Now, in the CONSOLE, run:
giveInventoryItem("item", amount);

Replace "item" with one of the parameters from the table above, and amount with your desired quantity.


[METHOD 2] : spawnUpgradeCard

Click to expand detailed instructions

Locating the File

  • Go to the SOURCE tab.
  • Open the file search panel (CTRL+P).
  • Search for the file AutoPlaceSystem.ts.

Note: Full path: /farm-merge-game/src/core/gameobjects/systems/AutoPlaceSystem.ts

Injection

  • Inside AutoPlaceSystem.ts, open the search panel (CTRL+F).
  • Search for:
['_forc' + 'edLoo' + 't'] = []

Set a breakpoint on this line by clicking in the gray area to the left.

  • Return to the game and merge three objects (e.g., eggs or wheat). The game will pause only if you merge tier 3 objects.
  • In the SOURCE tab, locate the loot array at Local/this/_data/loot.
  • Replace one element with "upgrade_card_1", "upgrade_card_2", or "upgrade_card_3" depending on your needs.
  • Go back to main.js in SOURCE, remove the breakpoint, then click Resume script execution.
  • Click the merged item in-game; the upgrade card will spawn.

[METHOD 3] : spawnBubbledObject

Items you can obtain with this method

Consumable

Parameter Description Image
ticket Ticket
coin_1 Coins (up to coin_8)
gem_1 Gems (up to gem_6)
crate_1 Crates (up to crate_2)
energy_1 Energy (up to energy_4)
wood_1 Wood (up to wood_8)
stone_1 Stone (up to stone_8)
tool_1 Tool (up to tool_10)
flower_1 Flower (up to flower_10)
sapling_1 Sapling (up to sapling_3)
greenhouse_1 Greenhouse (up to greenhouse_12)
toolbox_small Small toolbox
toolbox_medium Medium toolbox
toolbox_large Large toolbox
rock_small Small rock
rock_medium Medium rock
rock_large Large rock
tree_small Small tree
tree_medium Medium tree
tree_large Large tree
reward_crate_daily_bonus Daily bonus gift
reward_crate_key_bronze Bronze key
reward_crate_key_silver Silver key
reward_crate_key_gold Gold key
reward_crate_bronze Bronze chest
reward_crate_silver Silver chest
reward_crate_gold Gold chest
golden_carrot Golden carrot
reward_crate_key_golden_carrot Golden carrot key
reward_crate_golden_carrot Golden carrot chest
golden_pumpkin Golden pumpkin
reward_crate_key_golden_pumpkin Golden pumpkin key
reward_crate_golden_pumpkin Golden pumpkin chest
reward_crate_key_jingleballs Jingleballs key
reward_crate_jingleballs Jingleballs chest

Decoration

Farm

Parameter Description Image
decorative_barn Barn
decorative_birdshouse Birdshouse
decorative_chickencoop Chickencoop
decorative_doghouse Doghouse
decorative_farmhouse Farmhouse
decorative_feedingtrough Feeding Trough
decorative_flowerpots Flowerpots
decorative_fountain Fountain
decorative_haywagon Haywagon
decorative_lamppost Lamppost
decorative_milktank Milktank
decorative_picknicktable Picnic Table
decorative_shed Shed
decorative_silo Silo
decorative_stoneflowerpot Stone Flowerpot
decorative_toilet Toilet
decorative_watertower Water Tower
decorative_well Well
decorative_windmill Windmill

Halloween

Parameter Description Image
decorative_halloween_blackcat BlackCat
decorative_halloween_cauldron Cauldron
decorative_halloween_ghosts Ghosts
decorative_halloween_grandfatherclock Grandfather Clock
decorative_halloween_grave01 Grave 01
decorative_halloween_grave02 Grave 02
decorative_halloween_graveyard Graveyard
decorative_halloween_hauntedhouse Haunted House
decorative_halloween_pumpkinpatchbig Pumpkin Patch (Big)
decorative_halloween_pumpkins01 Pumpkins 01
decorative_halloween_pumpkins02 Pumpkins 02
decorative_halloween_pumpkins03 Pumpkins 03
decorative_halloween_pumpkins04 Pumpkins 04
decorative_halloween_skeletonbench Skeleton Bench
decorative_halloween_skeletoncarousel Skeleton Carousel
decorative_halloween_skeletonpicnic Skeleton Picnic
decorative_halloween_skullaltar Skull Altar
decorative_halloween_treeface Tree Face
decorative_halloween_well Well

Christmas

Parameter Description Image
decorative_christmas_candygate CandyGate
decorative_christmas_elfmail ElfMail
decorative_christmas_elfteddy ElfTeddy
decorative_christmas_elftrain ElfTrain
decorative_christmas_fireplace Fireplace
decorative_christmas_gift01 Gift 01
decorative_christmas_gift02 Gift 02
decorative_christmas_gift03 Gift 03
decorative_christmas_gingerbell Gingerbell
decorative_christmas_gingerbreadhouse GingerbreadHouse
decorative_christmas_gingerbreadhousesmall GingerbreadHouseSmall
decorative_christmas_gingerbreadsnow GingerbreadSnow
decorative_christmas_nutcracker Nutcracker
decorative_christmas_santagift SantaGift
decorative_christmas_santamail SantaMail
decorative_christmas_sleigh Sleigh
decorative_christmas_snowcaroling SnowCaroling
decorative_christmas_snowdinner SnowDinner
decorative_christmas_snowfight SnowFight
decorative_christmas_snowgifting SnowGifting
decorative_christmas_snowglobe SnowGlobe
decorative_christmas_snowjello SnowJello
decorative_christmas_snowlantern SnowLantern
decorative_christmas_snowreindeer SnowReindeer
decorative_christmas_snowtelescope SnowTelescope
decorative_christmas_treebig TreeBig
golden_christmas_tree_1 GoldenTree 1
golden_christmas_tree_2 GoldenTree 2
golden_christmas_tree_3 GoldenTree 3
golden_christmas_tree_4 GoldenTree 4
golden_jingleball_1 GoldenJingleBall 1
golden_jingleball_2 GoldenJingleBall 2
golden_jingleball_3 GoldenJingleBall 3
golden_jingleball_4 GoldenJingleBall 4
Click to expand detailed instructions

Locating the File

  • Go to the SOURCE tab.
  • Open the file search panel (CTRL+P).
  • Search for the file AutoPlaceSystem.ts.

Note: Full path: /farm-merge-game/src/core/gameobjects/systems/AutoPlaceSystem.ts

Injection

  • Inside AutoPlaceSystem.ts, open the search panel (CTRL+F).
  • Search for:
const originCell
  • There will be only one result. Set a breakpoint on this line by clicking in the gray area to the left.

Full line: const originCell: GridCell | undefined = this.services.mapGrid.getCell(autoPlaceBehavior.rootPosition.column, autoPlaceBehavior.rootPosition.row);

  • Return to the game and move an object (or place it on another object). The game should pause again.
  • In the CONSOLE tab, enter:
worldServices = this.services
  • Go back to the AutoPlaceSystem.ts file in the SOURCE tab, remove the breakpoint (click it again), then click Resume script execution.

Setting up the function

  • In the CONSOLE, enter:
let spawnBubbledObject = (target) => {
    return worldServices.rewardService.giveObjectReward({
      "rewards": [target],
      "container": worldServices.mapGridView._view.parent.parent.parent,
      "animationEndEvent": null,
      "bubblePosition": {"x": 0, "y": -200}
    });
}

Using the Injection

  • Now run in the CONSOLE:
spawnBubbledObject("item");

Replace "item" with the desired object key.


[METHOD 4] : removeAllObstacles

Click to expand detailed instructions

Locating the File

  • Go to the SOURCE tab.
  • Open the file search panel (CTRL+P).
  • Search for the file AutoPlaceSystem.ts.

Note: Full path: /farm-merge-game/src/core/gameobjects/systems/AutoPlaceSystem.ts

Injection

  • Inside AutoPlaceSystem.ts, open the search panel (CTRL+F).
  • Search for:
const originCell
  • There will be only one result. Set a breakpoint on this line by clicking in the gray area to the left.

Full line: const originCell: GridCell | undefined = this.services.mapGrid.getCell(autoPlaceBehavior.rootPosition.column, autoPlaceBehavior.rootPosition.row);

  • Return to the game and move an object (or place it on another object). The game should pause again.
  • In the CONSOLE tab, enter:
worldServices = this.services
  • Go back to the AutoPlaceSystem.ts file in the SOURCE tab, remove the breakpoint (click it again), then click Resume script execution.

Setting up the function

  • In the CONSOLE, enter:
worldServices = this.services
  • Return to AutoPlaceSystem.ts, remove the breakpoint, then resume execution.

Using the Injection

  • In the CONSOLE, run:
worldServices.world.getAllGameObjects()
  .filter(x => x.hasBehavior("hitpoints") && !x.hasBehavior("shovelable") && !x.hasBehavior("movable"))
  .forEach(x => worldServices.world.removeGameObject(x))

[METHOD 5] : setLuckyMergeChance

Click to expand detailed instructions

Locating the File

  • Go to the SOURCE tab.
  • Open the file search panel (CTRL+P).
  • Search for the file AutoPlaceSystem.ts.

Note: Full path: /farm-merge-game/src/core/gameobjects/systems/AutoPlaceSystem.ts

Injection

  • Inside AutoPlaceSystem.ts, open the search panel (CTRL+F).
  • Search for:
const originCell
  • There will be only one result. Set a breakpoint on this line by clicking in the gray area to the left.

Full line: const originCell: GridCell | undefined = this.services.mapGrid.getCell(autoPlaceBehavior.rootPosition.column, autoPlaceBehavior.rootPosition.row);

  • Return to the game and move an object (or place it on another object). The game should pause again.
  • In the CONSOLE tab, enter:
worldServices = this.services
  • Go back to the AutoPlaceSystem.ts file in the SOURCE tab, remove the breakpoint (click it again), then click Resume script execution.

Setting up the function

  • In the CONSOLE, enter:
let setLuckyMergeChance = (percentage) => worldServices.mapGridView._view.parent.parent.parent._systems.find(x => x._luckyMergeChance)._luckyMergeChance = percentage;

Using the Injection

  • Run in the CONSOLE:
setLuckyMergeChance(percentage);

Replace percentage with a number between 0 and 100.

  • 100 means the lucky merge always happens.
  • 0 means it never happens (default is 5).

Additional Information

  • Changes to XP Level won't update on-screen until you exit and relaunch FMV. However, effects like unlocking new plots apply immediately.
  • Using negative values for level will reduce XP Level; similarly, negative amounts for resources will remove them.
  • Be aware that FMV will become unstable/unplayable if XP Level exceeds 70 (FMV v1.62.6). You can reduce level by adding negative values to fix this. (See issue 7)
  • Need help? Join the Discord Server.
  • Contributions welcome! Open issues or create pull requests.

About

Modify various game elements in the Farm Merge Valley Discord game, including unlimited item acquisition, obstacle removal, and merge chance adjustments. Inspired by @wooslow's archive.

Topics

Resources

License

Stars

Watchers

Forks