tModLoader Tutorial: [1] Getting started with tModLoader

Soooooooo I could need some help. Whenever I try to Build and Load my Mod it comes up with the "{ expected" error
My Code is:
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Graphics.Effects;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;

namespace ScourgeImage.Items
{
public class Scourge : ModItem
{
public override void SetDefaults()
{
item.name = "Scourge of Zophran the Sprite";
item.damage = 70;
item.thrown = true;
item.noMelee = true;
item.width = 20;
item.height = 20;
item.useTime = 10;
item.useAnimation = 10;
item.useStyle = 1;
item.knockBack = 6;
item.value = 100;
item.rare = 10;
item.reuseDelay = 10;
item.useSound = 1;
item.autoReuse = true;
item.shoot = mod.ProjectileType("ThrownScourge");
item.shootSpeed = 9f;
item.useTurn = true;
item.maxStack = 1;
item.consumable = false;
item.noUseGraphic = true;

}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.Wood, 1);
recipe.AddTile(TileID.WorkBenches);
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}





Would be glad for anybody to help me out on this one
 
Soooooooo I could need some help. Whenever I try to Build and Load my Mod it comes up with the "{ expected" error
My Code is:
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Graphics.Effects;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;

namespace ScourgeImage.Items
{
public class Scourge : ModItem
{
public override void SetDefaults()
{
item.name = "Scourge of Zophran the Sprite";
item.damage = 70;
item.thrown = true;
item.noMelee = true;
item.width = 20;
item.height = 20;
item.useTime = 10;
item.useAnimation = 10;
item.useStyle = 1;
item.knockBack = 6;
item.value = 100;
item.rare = 10;
item.reuseDelay = 10;
item.useSound = 1;
item.autoReuse = true;
item.shoot = mod.ProjectileType("ThrownScourge");
item.shootSpeed = 9f;
item.useTurn = true;
item.maxStack = 1;
item.consumable = false;
item.noUseGraphic = true;

}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.Wood, 1);
recipe.AddTile(TileID.WorkBenches);
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}





Would be glad for anybody to help me out on this one
Are you sure it is saying that about this file? This file has 2 other errors, useSound should be "item.UseSound = SoundID.Item1;" and item.name isn't valid. Look at examplemod to see how to set the display name. (Hint, look for a SetStaticDefaults method.)
 
I already fixed everything, my mistake was that I didn't save the text file while I was still using NotePad++,
but I have a different question now: what AI Style is the Eater's Bite from the Scourge of the Corruptor using?
Because else I think I'll just switch over to the daybreak behaviour on my weapon
 
I just don't get it all I want to is to re-texture the nebula tools and unobtainable nebula tools different shades of yellow
 
Help! i keep getting this error message
error CS1703: An assembly with the same identity 'Ionic.Zip.Reduced, Version=1.9.1.8, Culture=neutral, PublicKeyToken=edbe51ad942a3f5c' has already been imported. Try removing one of the duplicate references.
error CS1704: An assembly with the same simple name 'MP3Sharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null has already been imported. Try removing one of the references or sign them to enable side-by-side.
error CS1703: An assembly with the same identity 'Mono.Cecil, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756' has already been imported. Try removing one of the duplicate references.
 
so uh, I'm having an issue where this pops up and idk whats causing the problem, I'm on a mac and what i can understand that there is something for windows that isn't on my mac. idk what it is though
 

Attachments

  • Screen Shot 2018-03-30 at 8.05.52 PM.png
    Screen Shot 2018-03-30 at 8.05.52 PM.png
    339.2 KB · Views: 253
I Apologize For Being Stupid But I'm Having Trouble Working With The Code That Makes Items Drop Only In Expert Worlds... :confused:
Can I Get Some Help Please?
 
i'm getting this:
Error running mcs: Cannot find the specified file
at Mono.CSharp.CSharpCodeCompiler.CompileFromFileBatch (System.CodeDom.Compiler.CompilerParameters options, System.String[] fileNames) [0x00176] in <6c7c03f48a9747c8a644da4f63a34480>:0
at Mono.CSharp.CSharpCodeCompiler.CompileAssemblyFromFileBatch (System.CodeDom.Compiler.CompilerParameters options, System.String[] fileNames) [0x00011] in <6c7c03f48a9747c8a644da4f63a34480>:0
at System.CodeDom.Compiler.CodeDomProvider.CompileAssemblyFromFile (System.CodeDom.Compiler.CompilerParameters options, System.String[] fileNames) [0x00014] in <6c7c03f48a9747c8a644da4f63a34480>:0
at Terraria.ModLoader.ModCompile.CompileMod (Terraria.ModLoader.ModCompile+BuildingMod mod, System.Collections.Generic.List`1[T] refMods, System.Boolean forWindows, System.Byte[]& dll, System.Byte[]& pdb) [0x00267] in <7195c050d4864dbc99c957f98a3d2dcb>:0
at Terraria.ModLoader.ModCompile.Build (Terraria.ModLoader.ModCompile+BuildingMod mod, Terraria.ModLoader.ModCompile+IBuildStatus status) [0x00151] in <7195c050d4864dbc99c957f98a3d2dcb>:0
at Terraria.ModLoader.ModCompile.Build (System.String modFolder, Terraria.ModLoader.ModCompile+IBuildStatus status) [0x0000b] in <7195c050d4864dbc99c957f98a3d2dcb>:0
at Terraria.ModLoader.ModLoader+<>c.<BuildMod>b__72_0 (System.Object _) [0x00000] in <7195c050d4864dbc99c957f98a3d2dcb>:0

Please help!
[doublepost=1528525540,1528525078][/doublepost]Please help!
i get this when trying to build the mod:

Error running mcs: Cannot find the specified file
at Mono.CSharp.CSharpCodeCompiler.CompileFromFileBatch (System.CodeDom.Compiler.CompilerParameters options, System.String[] fileNames) [0x00176] in <6c7c03f48a9747c8a644da4f63a34480>:0
at Mono.CSharp.CSharpCodeCompiler.CompileAssemblyFromFileBatch (System.CodeDom.Compiler.CompilerParameters options, System.String[] fileNames) [0x00011] in <6c7c03f48a9747c8a644da4f63a34480>:0
at System.CodeDom.Compiler.CodeDomProvider.CompileAssemblyFromFile (System.CodeDom.Compiler.CompilerParameters options, System.String[] fileNames) [0x00014] in <6c7c03f48a9747c8a644da4f63a34480>:0
at Terraria.ModLoader.ModCompile.CompileMod (Terraria.ModLoader.ModCompile+BuildingMod mod, System.Collections.Generic.List`1[T] refMods, System.Boolean forWindows, System.Byte[]& dll, System.Byte[]& pdb) [0x00267] in <7195c050d4864dbc99c957f98a3d2dcb>:0
at Terraria.ModLoader.ModCompile.Build (Terraria.ModLoader.ModCompile+BuildingMod mod, Terraria.ModLoader.ModCompile+IBuildStatus status) [0x00151] in <7195c050d4864dbc99c957f98a3d2dcb>:0
at Terraria.ModLoader.ModCompile.Build (System.String modFolder, Terraria.ModLoader.ModCompile+IBuildStatus status) [0x0000b] in <7195c050d4864dbc99c957f98a3d2dcb>:0
at Terraria.ModLoader.ModLoader+<>c.<BuildMod>b__72_0 (System.Object _) [0x00000] in <7195c050d4864dbc99c957f98a3d2dcb>:0
 
good tutorial to get into, im used to different APIs of other games, and getting into tmodloader now ,
just a question,
I got VS as my IDE running and all working.
But is there a better/faster way to test out small changes of your code instead of exit,build+reload and enter the game again ?
that gets a bit annoying... :/
 
Back
Top Bottom