tAPI Getting Started with Modding

Status
Not open for further replies.
You mean like prefixes?
Hey hmm could you help me with this prob? i put this into JSON Editor Online
{
"displayName" : "ZirconiumPlus",
"author" : "Terraria_Lover595901",
"info" : "Just play the mod already!",
"internalName" : "ZirconiumPlus",
}

And this came up
Error: Parse error on line 5:
...: "ZirconiumPlus",
}
----------------------^
Expecting 'STRING', got '}'
 
Remove the comma after "ZirconiumPlus" . The comma indicates that there is something more, when the bracket should mark the ending of that section or file.
 
Remove the comma after "ZirconiumPlus" . The comma indicates that there is something more, when the bracket should mark the ending of that section or file.
I did and

Error: Parse error on line 2:
... : "ZirconiumPlus"
"author" : "Terraria
----------------------^
Expecting 'EOF', '}', ':', ',', ']', got 'STRING'
 
It should be
{
"displayName" : "ZirconiumPlus",
"author" : "Terraria_Lover595901",
"info" : "Just play the mod already!",
"internalName" : "ZirconiumPlus"
}

"internalName" : "ZirconiumPlus" <- comma is missing = good
 
look its like this "author" : "Terraria_Lover595901"
[DOUBLEPOST=1422154316][/DOUBLEPOST]
It should be
{
"displayName" : "ZirconiumPlus",
"author" : "Terraria_Lover595901",
"info" : "Just play the mod already!",
"internalName" : "ZirconiumPlus"
}

"internalName" : "ZirconiumPlus" <- comma is missing = good
it it it WORKED
THANKS!
 
Also, is there a way to make it so that a minion weapon can summon multiple projectiles (like the Pirate Staff)
and is there a way to make it in random order, or does it have to be in a set order?
 
Also, is there a way to make it so that a minion weapon can summon multiple projectiles (like the Pirate Staff)
and is there a way to make it in random order, or does it have to be in a set order?
That seems to be very hard-coded into the game. I suppose you could work with .cs files and either try to manually call Projectile.NewProjectile, or just change the type in the projectile's OnSpawn method. Or, if everything has the same behavior, it would be easiest to randomly use multiple animation frames and manually set the frame in OnSpawn.
 
Hey, I'm trying to compile a texture pack based off of a tutorial by MiraiMai, but I get this error whenever I try to compile:
Terraria 1.2.4.1, tAPI Builder r14a

========================================
Building mod CrimsonPack

Validating Jsons...
Compiling code...
MBase.cs (4,36)
} expected
}
^
Failed to build CrimsonPack.

========================================

Built 0 mods.
Here is the MBase.cs
Code:
using System;
using System.IO;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

using TAPI;
using Terraria;

namespace CrimsonPack
{
    public class MBase : TAPI.ModBase //MBase can be any name
    {
        public override void OnLoad(){ } //Called when the mod is first loaded.
        public override void OnUnload(){ } //Called when the mod is unloaded.
        public override void OnAllModsLoaded() //Called when all mods are loaded.
        {
        // Replace Corruption with Crimson textures
        if(!Main.dedServ) {
            Main.tileTexture[21] = textures["Images/Tiles_21"];
            Main.tileTexture[82] = textures["Images/Tiles_82"];           
            Main.tileTexture[83] = textures["Images/Tiles_83"];
            Main.tileTexture[84] = textures["Images/Tiles_84"];           
            Main.itemTexture[273] = textures["Image/Item_273"];
            Main.itemTexture[274] = textures["Image/Item_274"];
            Main.itemTexture[310] = textures["Image/Item_310"];
            Main.itemTexture[316] = textures["Image/Item_316"];
            Main.itemTexture[328] = textures["Image/Item_328"];
            Main.itemTexture[329] = textures["Image/Item_329"];
            Main.itemTexture[675] = textures["Image/Item_675"];       
            Main.npcTexture[47] = textures["Image/NPC_47"];               
            Main.npcTexture[79] = textures["Image/NPC_79"];
            Main.npcTexture[85] = textures["Image/NPC_85"];               
            Main.npcTexture[140] = textures["Image/NPC_140"];           
        }
        public override void PreGameDraw(SpriteBatch sb) { } //Called before all game drawing.
        public override void PostGameDraw(SpriteBatch sb) { } //Called after all game drawing is finished.

        public override void ChooseTrack(ref string current) { } //Called when the music track updates.

        public override void OptionChanged(Option option) { } // Called when leaving the options page on all options for this mod with notify (ie recently changed)
        public override List<string> OptionList(Option option) // Called on Dynamic options for this mod to fill possibleValues.
        {
            if (option.name == "codedValue")
            {
                List<string> list = new List<string>();
                list.AddRange(new string[] { "Derp", "> 9000", "much choice", "I don't even", "NOPE" });
                return list;
            }
            return null;
        }

        public override object OnModCall(TAPI.ModBase mod, params object[] args) { return base.OnModCall(mod, args);  } //Called when another mod calls this on your mod. (used for inter-mod communicating)
    }
}
 
What about this
Code:
{
"displayName": "Zirconium Sword",
"size": [40, 40],
"maxStack": 1,
"value": [0,5,0,0],
"rare": 5,
"tooltip": "'Hows that for a sword!'",
"useStyle": 1,
"useAnimation": 9,
"useTime": 9,
"damage": 45,
"knockback" 4,
"useSound": 1,
"autoReuse": false,
"melee": true,

"recipes"
[{
"items": { "Dirt Block",
"tiles": [ "Work Bench",
"creates": 1
  }]
}

When i put it into JSON Editor Online it says
Error: Parse error on line 12:
...": 45,
"knockback" 4,
"useSound": 1,
----------------------^
Expecting 'EOF', '}', ':', ',', ']', got 'NUMBER'
 
What about this
Code:
{
"displayName": "Zirconium Sword",
"size": [40, 40],
"maxStack": 1,
"value": [0,5,0,0],
"rare": 5,
"tooltip": "'Hows that for a sword!'",
"useStyle": 1,
"useAnimation": 9,
"useTime": 9,
"damage": 45,
"knockback" 4,
"useSound": 1,
"autoReuse": false,
"melee": true,

"recipes"
[{
"items": { "Dirt Block",
"tiles": [ "Work Bench",
"creates": 1
  }]
}

When i put it into JSON Editor Online it says
Error: Parse error on line 12:
...": 45,
"knockback" 4,
"useSound": 1,
----------------------^
Expecting 'EOF', '}', ':', ',', ']', got 'NUMBER'
No } or ] ending the recipe information
 
this happened
Error: Parse error on line 17:
...true,

"recipes"
[{
"items": { "Dir
--------------------^
Expecting 'EOF', '}', ':', ',', ']', got '['
validated by jsonlint

could you just retype the hole code and fix everything?
Code:
{
"displayName": "Zirconium Sword",
"size": [40, 40],
"maxStack": 1,
"value": [0,5,0,0],
"rare": 5,
"tooltip": "'Hows that for a sword!'",
"useStyle": 1,
"useAnimation": 9,
"useTime": 9,
"damage": 45,
"knockback" 4,
"useSound": 1,
"autoReuse": false,
"melee": true,

"recipes":
[{
"items": { "Dirt Block": 1 },
"tiles": [ "Work Bench" ],
"creates": 1
  }]
}
 
Status
Not open for further replies.
Back
Top Bottom