tAPI Getting Started with Modding

Status
Not open for further replies.
A most helpful guide, this is. Very helpful! Great job!
f3uyjcS.png
 
a good sword size is at least 22 x 22, try to make a sprite 11 x 11 and then double the size, that's how most terraria sprites are made
Well, I am being annoying, but my sword has finally shown up in the hotbar (eet hideeus) but when I try to swing it, it shows this error:
System.IndexOutOfRangeException: Index was outside the bounds of the array.
at Terraria.Player.ItemCheckReal(System.Int32 i)
at Terraria.Player.ItemCheck(System.Int32 i)
at Terraria.Player.UpdatePlayer(System.Int32 i)
at Terraria.Main.UpdateReal(Microsoft.Xna.Framework.GameTime gameTime).
 
Its not an emotion, its a image. /\
Back on topic, a few questions that all revolve around the same thing,
How do i make an ore spawn after a boss has been defeated?
What is the format for making a npc appear after a specific boss has been defeated(i was confused with it from the npc tutorial)?
Can you make it so that the bosses that you need to defeat are custom bosses?
How do i make blocks/items/npcs invisible?
 
Its not an emotion, its a image. /\
Back on topic, a few questions that all revolve around the same thing,
How do i make an ore spawn after a boss has been defeated?
What is the format for making a npc appear after a specific boss has been defeated(i was confused with it from the npc tutorial)?
Can you make it so that the bosses that you need to defeat are custom bosses?
How do i make blocks/items/npcs invisible?
Does anyone know a ore generation code?
 
Of course i do, here it is name it whatever you want.cs and place it in your mods main folder

Code:
using Terraria;
using TAPI;

namespace Internalmodname
{
    public class Internalmodname : ModWorld
    {
        public override void WorldGenPostGen()
        {
            ModifyWorld();
        }

public void ModifyWorld()
{
Main.statusText = "Inserttexthere"; //This is what displays as your ore is being generated. feel free to tweak
int Amount_Of_Spawns = 100+(int)(Main.maxTilesY/5); //feel free to tweak
for(int i=0;i<Amount_Of_Spawns;i++) AddMyOres();
}
public void AddMyOres()
{
int LowX = 200; //after ocean on left edge of map
int HighX = Main.maxTilesX-200; //before ocean on right edge of map
int LowY = (int)Main.worldSurface; //where the brown background and the sky background meets
int HighY = Main.maxTilesY-200; //where hell and the grey background meets

int X = WorldGen.genRand.Next(LowX,HighX); //don't touch
int Y = WorldGen.genRand.Next(LowY,HighY); //don't touch

int OreMinimumSpread = 8; //minimum amount of ore in a vein. feel free to tweak
int OreMaximumSpread = 18; //Maximum amount of ore in a vein. feel free to tweak

int OreMinimumFrequency = 1; //feel free to tweak, this and the next line mean how frequent your ore spawns.
int OreMaximumFrequency = 15; //feel free to tweak

int OreSpread = WorldGen.genRand.Next(OreMinimumSpread,OreMaximumSpread+1); //don't touch
int OreFrequency = WorldGen.genRand.Next(OreMinimumFrequency,OreMaximumFrequency+1); //don't touch

WorldGen.OreRunner(X, Y, (double)OreSpread, OreFrequency, TileDef.byName["Internalmodname:nameoforeintilesfolder"]);
}
    }
}
 
Hmm whats wrong with this?
Code:
{
"displayName": "Zirconium Ore",
"size": [16,16],
"maxStack": 999,
"value": [0,0,200,0],
"rare": 1,
"tooltip": "'An our that is pure'"

"recipes"
[{
  "items": { "Iron Ore": 25, "Fallen Star": 1},
  "tiles": [ "Furnace" ],
  "creates": 25,
}]
}

it says
Error: Parse error on line 7:
...r that is pure'"

"recipes"
[{
"i
---------------------^
Expecting 'EOF', '}', ':', ',', ']', got 'STRING'
 
Check your commas, also its ore not our.
Code:
{
"displayName": "Zirconium Ore",
"size": [16,16],
"maxStack": 999,
"value": [0,0,200,0],
"rare": 1,
"tooltip": "'An our that is pure'",

"recipes"
[{
  "items": { "Iron Ore": 25, "Fallen Star": 1},
  "tiles": [ "Furnace" ],
  "creates": 25
}]
}

it says
Error: Parse error on line 9:
...e'",

"recipes"
[{
"items": { "Ir
--------------------^
Expecting 'EOF', '}', ':', ',', ']', got '['
 
Code:
{
"displayName": "Zirconium Ore",
"size": [16,16],
"maxStack": 999,
"value": [0,0,200,0],
"rare": 1,
"tooltip": "'An our that is pure'",

"recipes"
[{
  "items": { "Iron Ore": 25, "Fallen Star": 1},
  "tiles": [ "Furnace" ],
  "creates": 25
}]
}

it says
Error: Parse error on line 9:
...e'",

"recipes"
[{
"items": { "Ir
--------------------^
Expecting 'EOF', '}', ':', ',', ']', got '['
You forgot a colon after "recipes".
 
This means??

TAPI.Mods+LoadException: No item "Zirconium Ore" found for recipe of item "Zirconium+:ZirconiumBar"
at TAPI.RecipeResolver.Resolve()
at TAPI.ResolverQueue.ResolveAll()
at TAPI.Mods.Load()
 
Status
Not open for further replies.
Back
Top Bottom