Skip to content

Instantly share code, notes, and snippets.

View phillipdodd's full-sized avatar

Phillip Dodd phillipdodd

View GitHub Profile
function fibberGonnaFib(count) {
var fibs = [];
for (var i = 0; i < count; i++) {
fibs.push((fibs[fibs.length - 1] || 1) + (fibs[fibs.length - 2] || 0))
}
return fibs[fibs.length - 1];
}
var theFibbening = [];
class CUBENING {
constructor() {
this.grid = [
["W", "W", "W"],
["W", "W", "W"],
["W", "W", "W"],
["O", "O", "O", "G", "G", "G", "R", "R", "R", "Y", "Y", "Y"],
["O", "O", "O", "G", "G", "G", "R", "R", "R", "Y", "Y", "Y"],
["O", "O", "O", "G", "G", "G", "R", "R", "R", "Y", "Y", "Y"],
["B", "B", "B"],
t = World.SpawnEntity(
"thingy",
Vector3.Add(
World.GetPlayerPosition(),
Vector3.New(-1,0,0)
)
)
t.gameObject.AddModel("btoast.models.trophy", Vector3.zero, Vector3.one, Vector3.new(0.5, 0.5, 0.5))
t.gameObject.transform.SetParent(Player.gameObject.transform)
const pills = [];
function makeGrid(x, y) {
let cols = new Array(y);
for (let i = 0; i < x; i++) {
let row = new Array(x).fill(0);
cols[i] = row;
}
return cols;
}
-- BACKUP GAME FILES (particularly the world) BEFORE USING
-- to be run in modding console
-- lists from from https://www.gardenpawsgame.com/modding/Data%20Dumps/Events/
upgradeEventList = {"animalshop_1", "appearanceshop_1", "backpack_1", "backpack_2", "backpack_3", "bakery_1", "barn_2", "barn_3", "blacksmith_1", "coop_1", "coop_2", "coop_3", "costumeshop_1", "discountbin_1", "discountbin_2", "discountbin_3", "discountbin_4", "discountbin_5", "duckpond_2", "duckpond", "fisherman_1", "flowershop_1", "fruittreeshop", "horsestable", "inn_1", "minercamp_1", "shop_2", "shop_3", "shop_4", "shop_5", "treefarm_1", "u_20percentcave", "u_alphabetworkbench", "u_apiary", "u_assistant", "u_bedroom", "u_bettertools2axe", "u_bettertools2pickaxe", "u_bettertoolsaxe", "u_bettertoolspickaxe", "u_blackgalaxy", "u_butterflygarden", "u_candle", "u_candlelrg", "u_candlemed", "u_colourfulsplatter", "u_cornerwall_glass", "u_cornerwall_plaster", "u_custompaintings", "u_decorationstation", "u_dryingrack_fish", "u_dungeonworkbench",
{
"difficulty_settings":
{
"recipe_difficulty": 0,
"technology_difficulty": 0,
"technology_price_multiplier": 1,
"research_queue_setting": "after-victory"
},
"pollution":
{
{
"_terrain_segmentation_comment": "Inverse of map scale",
"terrain_segmentation": 1,
"_water_comment":
[
"Multiplier for water 'coverage' - higher increases the water level.",
"Water level = 10 * log2(this value)"
],
"water": 1,
class CUBENING {
constructor() {
this.grid = [
["W", "W", "W"],
["W", "W", "W"],
["W", "W", "W"],
["O", "O", "O", "G", "G", "G", "R", "R", "R", "Y", "Y", "Y"],
["O", "O", "O", "G", "G", "G", "R", "R", "R", "Y", "Y", "Y"],
["O", "O", "O", "G", "G", "G", "R", "R", "R", "Y", "Y", "Y"],
["B", "B", "B"],
// n must be odd square-able integer
function doTheThing(n, grid, coords, direction) {
if (!grid) {
let sqrt = Math.sqrt(n)
let grid = new Array(sqrt);
for (let i = 0; i < sqrt; i++) {
grid[i] = new Array(sqrt).fill(0);
}
let midIndex = Math.floor(sqrt / 2);
grid[midIndex][midIndex] = "01";
# See https://docs.microsoft.com/en-us/powershell/scripting/developer/module/how-to-write-a-powershell-script-module?view=powershell-7
function gp-togglemoddingmode() {
# Thanks for pointing out needing relative path Vinapocalypse!
$gpDir = $env:APPDATA.Replace("Roaming", '') + "\LocalLow\Bitten Toast Games\GardenPaws\"
$existingFiles = Get-Item "$($gpDir)*"
$moddingMode = $false
$disabledModdingMode = $false
# $moddingConsole = $false