Jump to content

Vintagebob

Vintarian
  • Posts

    8
  • Joined

  • Last visited

Vintagebob's Achievements

Wolf Bait

Wolf Bait (1/8)

3

Reputation

  1. Hello, im not a code wizard but something i can code too . Here is the codefile. It makes, that only the third part of the drifters, which spawn above the Y-Position 100, really spawn. You can open the file with the normal text-editor or a better programm and change the properties. Its written down there, where you must change. Dont forget to create a "src" folder next to the assets folder, change your modtype to "code" and change the drifterclass to th class "EntityDrifter". I've tested the mod out and even if you spawn a drifter with the spawnitem, there is a chance, that he does'nt spawn. In fact, the naturally spawning and the spawning with the item is the same. I hope i could help you, and sorry for my writing mistakes, im not english Class1.cs
  2. I asked this allready, but in the wrong forum, now again in the Modding questions Hello, im programming a Vintage Story mod and want do add hydrothermal vents to the game. The block itself works perfectly, but i can't generate these vents under the water :(. ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Here is my programm code in the .cs file: using System; using Vintagestory.API.Common; using Vintagestory.API.Common.Entities; using Vintagestory.API.MathTools; namespace omniummod { public class Omniummod : ModSystem { public override void Start(ICoreAPI api) { base.Start(api); api.RegisterBlockClass("hydrothermal_vent", typeof(hydrothermal_vent)); } } public class hydrothermal_vent : Block { Random random = new Random(); Block[] blocks; public override bool TryPlaceBlockForWorldGen(IBlockAccessor blockAccessor, BlockPos pos, BlockFacing onBlockFace, LCGRandom worldGenRand) { BlockPos belowPos = pos.DownCopy(); Block block = blockAccessor.GetBlock(belowPos); if (block.LiquidCode != "water") return false; int depth = 1; while (depth < 100) { belowPos.Down(); block = blockAccessor.GetBlock(belowPos); if (block.Fertility >= 0) { belowPos.Up(); PlaceVent(blockAccessor, belowPos, depth); return true; } else { if (!block.IsLiquid()) return false; } depth++; } return false; } private void PlaceVent(IBlockAccessor blockAccessor, BlockPos pos, int depth) { int height = Math.Min(depth - 1, 1 + random.Next(3) + random.Next(3)); AssetLocation assetl = new AssetLocation("omniummod", "blocktypes/deepwaterblocks/hydrothermal_vent"); blockAccessor.SetBlock(blockAccessor.GetBlock(assetl).BlockId, pos); } } } (some parts I copied from the Seaweed class ) ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Here is the .json file of the hydrothermal vent, if the problem ist not in the code but in the block: { code: "hydrothermal_vent", entityClass: "hydrothermal_vent", creativeinventory: { "general": ["*"] }, blockmaterial: "Stone", drawtype: "json", shape: { base: "block/deepwaterblocks/hydrothermal_vent*", }, storageFlags: 257, lightAbsorption: 0, sidesolid: { all: "false" }, sideopaque: { all: "false" }, resistance: 2.0, sounds: { "place": "game:block/stone", "walk": "game:block/stone" }, particleProperties: [ { hsvaColor: [{ avg: 0, var: 1 }, { avg: 0, var: 1 }, { avg: 0, var: 1 }, { avg: 0, var: 1 }], gravityEffect: { avg: -0.02, var: 0.01 }, posOffset: [ { avg: 0, var: 0.1 }, { avg: 0.5, var: 0.1 }, { avg: 0, var: 0.1 }], velocity: [ { avg: 0, var: 0.25 }, { avg: 0.1, var: 0.1 }, { avg: 0, var: 0.25 }], quantity: { avg: 1, var: 1 }, size: { avg: 5, var: 1 }, sizeEvolve: { transform: "quadratic", factor: 0.5 }, lifeLength: { avg: 3, var: 1 }, vertexFlags: 128 } ], guiTransform: { rotation: { x: -22.6, y: -145, z: 0 } }, tpHandTransform: { translation: { x: -2.1, y: -1.4, z: -1.5 }, rotation: { x: 0, y: 17, z: -88 } }, groundTransform: { translation: { x: 0, y: 0, z: 0 }, rotation: { x: -58, y: -45, z: 0 }, origin: { x: 0.5, y: 0, z: 0.5 }, scale: 1.5 } } ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- And here is the .json worldgen file, where I make the hydrothermal vent - blockpatch: { chanceMultiplier: { dist: "uniform", avg: 2.5, var: 2 }, patches: [ { comment: "Large patches of hydrothermal vent", blockCodes: ["hydrothermal_vent"], quantity: { avg: 25, var: 15 }, offsetX: { avg: 0, var: 12 }, offsetZ: { avg: 0, var: 12 }, chance: 1, minWaterDepth: 1, placement: "UnderWater" }, ] } its copied from the Seaweed blockpatch... ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- I hope someone will be able to help me and thank you in advance
  3. Yes, if you safe your mod there, it has to be .zip-compressed. Its right to safe it in this folder, but to programm mods you can also use this path: "folder, were your vintage story.exe is installed/Mods" . In this folder the mod can be normal, not .zipp-ed. Hopefully it will work now.
  4. I dont know, were the problem is, in my oppinion all is right, but can you say, were do you safe you mod to test it? In wich folder? And maybe it is, because bth is writte down in capital letters, and this is not so good in vintage story. And can you say me speciffically, wat doesnt work?
  5. Hello, im programming a Vintage Story mod and want do add hydrothermal vents to the game. The block itself works perfectly, but i can't generate these vents under the water :(. ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Here is my programm code in the .cs file: using System; using Vintagestory.API.Common; using Vintagestory.API.Common.Entities; using Vintagestory.API.MathTools; namespace omniummod { public class Omniummod : ModSystem { public override void Start(ICoreAPI api) { base.Start(api); api.RegisterBlockClass("hydrothermal_vent", typeof(hydrothermal_vent)); } } public class hydrothermal_vent : Block { Random random = new Random(); Block[] blocks; public override bool TryPlaceBlockForWorldGen(IBlockAccessor blockAccessor, BlockPos pos, BlockFacing onBlockFace, LCGRandom worldGenRand) { BlockPos belowPos = pos.DownCopy(); Block block = blockAccessor.GetBlock(belowPos); if (block.LiquidCode != "water") return false; int depth = 1; while (depth < 100) { belowPos.Down(); block = blockAccessor.GetBlock(belowPos); if (block.Fertility >= 0) { belowPos.Up(); PlaceVent(blockAccessor, belowPos, depth); return true; } else { if (!block.IsLiquid()) return false; } depth++; } return false; } private void PlaceVent(IBlockAccessor blockAccessor, BlockPos pos, int depth) { int height = Math.Min(depth - 1, 1 + random.Next(3) + random.Next(3)); AssetLocation assetl = new AssetLocation("omniummod", "blocktypes/deepwaterblocks/hydrothermal_vent"); blockAccessor.SetBlock(blockAccessor.GetBlock(assetl).BlockId, pos); } } } (some parts I copied from the Seaweed class ) ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Here is the .json file of the hydrothermal vent, if the problem ist not in the code but in the block: { code: "hydrothermal_vent", entityClass: "hydrothermal_vent", creativeinventory: { "general": ["*"] }, blockmaterial: "Stone", drawtype: "json", shape: { base: "block/deepwaterblocks/hydrothermal_vent*", }, storageFlags: 257, lightAbsorption: 0, sidesolid: { all: "false" }, sideopaque: { all: "false" }, resistance: 2.0, sounds: { "place": "game:block/stone", "walk": "game:block/stone" }, particleProperties: [ { hsvaColor: [{ avg: 0, var: 1 }, { avg: 0, var: 1 }, { avg: 0, var: 1 }, { avg: 0, var: 1 }], gravityEffect: { avg: -0.02, var: 0.01 }, posOffset: [ { avg: 0, var: 0.1 }, { avg: 0.5, var: 0.1 }, { avg: 0, var: 0.1 }], velocity: [ { avg: 0, var: 0.25 }, { avg: 0.1, var: 0.1 }, { avg: 0, var: 0.25 }], quantity: { avg: 1, var: 1 }, size: { avg: 5, var: 1 }, sizeEvolve: { transform: "quadratic", factor: 0.5 }, lifeLength: { avg: 3, var: 1 }, vertexFlags: 128 } ], guiTransform: { rotation: { x: -22.6, y: -145, z: 0 } }, tpHandTransform: { translation: { x: -2.1, y: -1.4, z: -1.5 }, rotation: { x: 0, y: 17, z: -88 } }, groundTransform: { translation: { x: 0, y: 0, z: 0 }, rotation: { x: -58, y: -45, z: 0 }, origin: { x: 0.5, y: 0, z: 0.5 }, scale: 1.5 } } ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- And here is the .json worldgen file, where I make the hydrothermal vent - blockpatch: { chanceMultiplier: { dist: "uniform", avg: 2.5, var: 2 }, patches: [ { comment: "Large patches of hydrothermal vent", blockCodes: ["hydrothermal_vent"], quantity: { avg: 25, var: 15 }, offsetX: { avg: 0, var: 12 }, offsetZ: { avg: 0, var: 12 }, chance: 1, minWaterDepth: 1, placement: "UnderWater" }, ] } its copied from the Seaweed blockpatch... ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- I hope someone will be able to help me and thank you in advance
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.