Lol Bozo
Steampunker
upperpublic class Dreams : ModItem
{
public override void SetDefaults()
{
item.name = "Your D.R.E.A.M.S Book";
Does it take from the lower or upper file?
upperpublic class Dreams : ModItem
{
public override void SetDefaults()
{
item.name = "Your D.R.E.A.M.S Book";
Does it take from the lower or upper file?
using System.Collections.Generic;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace MadCrafter.Items
{
public class Dreams : ModItem
{
public override void SetDefaults()
{
item.name = "Your D.R.E.A.M.S Book";
item.width = 32;
item.height = 32;
item.toolTip = "A book that holds your wishes.";
item.toolTip2 = "Adds a little of everything.";
item.value = 50;
item.rare = 2;
item.accessory = true;
}
public override void UpdateEquip(Player player)
{
player.meleeDamage = 0.2f;
player.thrownDamage = 0.2f;
player.rangedDamage = 0.2f;
player.magicDamage = 0.2f;
player.minionDamage = 0.2f;
player.meleeSpeed = 0.33f;
player.thrownCost33 = true;
player.ammoCost75 = true;
player.moveSpeed += 0.33f;
player.maxMinions++;
player.statDefense += 100;
player.manaCost -= 0.33f;
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.CobaltShield, 1);
recipe.AddIngredient(ItemID.MusketBall, 1);
recipe.AddIngredient(ItemID.ManaCrystal, 1);
recipe.AddIngredient(ItemID.HerculesBeetle, 1);
recipe.AddIngredient(ItemID.AvengerEmblem, 1);
recipe.AddIngredient(ItemID.FeralClaws, 1);
recipe.AddIngredient(ItemID.HermesBoots, 1);
recipe.AddIngredient(ItemID.Book, 1);
recipe.AddTile(TileID.Autohammer);
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}
using System.Collections.Generic;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace MadCrafter.Items
{
public class Dreams : ModItem
{
public override bool Autoload(ref string name, ref string texture)
{
texture = mod.Name + "/Items/Dreams";
return mod.Properties.Autoload;
}
public override void SetDefaults()
{
item.name = "Your D.R.E.A.M.S Book";
item.width = 32;
item.height = 32;
item.toolTip = "A book that holds your wishes.";
item.toolTip2 = "Adds a little of everything.";
item.value = 50;
item.rare = 2;
item.accessory = true;
}
public override void UpdateEquip(Player player)
{
player.meleeDamage = 0.2f;
player.thrownDamage = 0.2f;
player.rangedDamage = 0.2f;
player.magicDamage = 0.2f;
player.minionDamage = 0.2f;
player.meleeSpeed = 0.33f;
player.thrownCost33 = true;
player.ammoCost75 = true;
player.moveSpeed += 0.33f;
player.maxMinions++;
player.statDefense += 100;
player.manaCost -= 0.33f;
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.CobaltShield, 1);
recipe.AddIngredient(ItemID.MusketBall, 1);
recipe.AddIngredient(ItemID.ManaCrystal, 1);
recipe.AddIngredient(ItemID.HerculesBeetle, 1);
recipe.AddIngredient(ItemID.AvengerEmblem, 1);
recipe.AddIngredient(ItemID.FeralClaws, 1);
recipe.AddIngredient(ItemID.HermesBoots, 1);
recipe.AddIngredient(ItemID.Book, 1);
recipe.AddTile(TileID.Autohammer);
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}
c:\Users\John\Documents\my games\Terraria\ModLoader\Mod Sources\Mad Crafter\Items\Dreams.cs(23,30) : error CS0115: 'MadCrafter.Items.Dreams.Autoload(ref string, ref string)': no suitable method found to override
Did you ever get this afterwards?
[doublepost=1466181507,1466181443][/doublepost]Wait, may know error, sec.
[doublepost=1466181649][/doublepost]Never mind, no idea. Placed where you asked but... same error but 11 instead of 23.
[doublepost=1466181714][/doublepost]Code:using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace MadCrafter.Items { public class Dreams : ModItem { public override bool Autoload(ref string name, ref string texture) { texture = mod.Name + "/Items/Dreams"; return mod.Properties.Autoload; } public override void SetDefaults() { item.name = "Your D.R.E.A.M.S Book"; item.width = 32; item.height = 32; item.toolTip = "A book that holds your wishes."; item.toolTip2 = "Adds a little of everything."; item.value = 50; item.rare = 2; item.accessory = true; } public override void UpdateEquip(Player player) { player.meleeDamage = 0.2f; player.thrownDamage = 0.2f; player.rangedDamage = 0.2f; player.magicDamage = 0.2f; player.minionDamage = 0.2f; player.meleeSpeed = 0.33f; player.thrownCost33 = true; player.ammoCost75 = true; player.moveSpeed += 0.33f; player.maxMinions++; player.statDefense += 100; player.manaCost -= 0.33f; } public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.CobaltShield, 1); recipe.AddIngredient(ItemID.MusketBall, 1); recipe.AddIngredient(ItemID.ManaCrystal, 1); recipe.AddIngredient(ItemID.HerculesBeetle, 1); recipe.AddIngredient(ItemID.AvengerEmblem, 1); recipe.AddIngredient(ItemID.FeralClaws, 1); recipe.AddIngredient(ItemID.HermesBoots, 1); recipe.AddIngredient(ItemID.Book, 1); recipe.AddTile(TileID.Autohammer); recipe.SetResult(this); recipe.AddRecipe(); } } }
Get rid of the whole Autoload override and just put the texture for the item in the same folder as the script and has the same name. Much easier.
c:\Users\John\Documents\my games\Terraria\ModLoader\Mod Sources\Mad Crafter\Items\Dreams.cs(23,30) : error CS0115: 'MadCrafter.Items.Dreams.Autoload(ref string, ref string)': no suitable method found to override
Did you ever get this afterwards?
[doublepost=1466181507,1466181443][/doublepost]Wait, may know error, sec.
[doublepost=1466181649][/doublepost]Never mind, no idea. Placed where you asked but... same error but 11 instead of 23.
[doublepost=1466181714][/doublepost]Code:using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace MadCrafter.Items { public class Dreams : ModItem { public override bool Autoload(ref string name, ref string texture) { texture = mod.Name + "/Items/Dreams"; return mod.Properties.Autoload; } public override void SetDefaults() { item.name = "Your D.R.E.A.M.S Book"; item.width = 32; item.height = 32; item.toolTip = "A book that holds your wishes."; item.toolTip2 = "Adds a little of everything."; item.value = 50; item.rare = 2; item.accessory = true; } public override void UpdateEquip(Player player) { player.meleeDamage = 0.2f; player.thrownDamage = 0.2f; player.rangedDamage = 0.2f; player.magicDamage = 0.2f; player.minionDamage = 0.2f; player.meleeSpeed = 0.33f; player.thrownCost33 = true; player.ammoCost75 = true; player.moveSpeed += 0.33f; player.maxMinions++; player.statDefense += 100; player.manaCost -= 0.33f; } public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.CobaltShield, 1); recipe.AddIngredient(ItemID.MusketBall, 1); recipe.AddIngredient(ItemID.ManaCrystal, 1); recipe.AddIngredient(ItemID.HerculesBeetle, 1); recipe.AddIngredient(ItemID.AvengerEmblem, 1); recipe.AddIngredient(ItemID.FeralClaws, 1); recipe.AddIngredient(ItemID.HermesBoots, 1); recipe.AddIngredient(ItemID.Book, 1); recipe.AddTile(TileID.Autohammer); recipe.SetResult(this); recipe.AddRecipe(); } } }
But that is what wasn't working before.
I dont beleive so. Send me a example code of one.But that is what wasn't working before.
[doublepost=1466182081,1466182019][/doublepost]
Is autoload enabled in your main mod file?
Tryed that.Get rid of the whole Autoload override and just put the texture for the item in the same folder as the script. Much easier.
Tryed that.
Same name and png.Then the image file you are using doesn't have the same name as the class (file name, not class name, although those should be the same) or is not a valid file (should be PNG).
public override void AI()
{
npc.ai[0]++;
Player P = Main.player[npc.target];
if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead || !Main.player[npc.target].active)
{
npc.TargetClosest(true);
}
npc.netUpdate = true;
npc.ai[1] >= 230)
{
float Speed = 20f;
Vector2 vector8 = new Vector2(npc.position.X + (npc.width / 2), npc.position.Y + (npc.height / 2));
int damage = 10;
int type = mod.ProjectileType("DragonSlimePro");
Main.PlaySound(23, (int)npc.position.X, (int)npc.position.Y, 17);
float rotation = (float)Math.Atan2(vector8.Y - (P.position.Y + (P.height * 0.5f)), vector8.X - (P.position.X + (P.width * 0.5f)));
int num54 = Projectile.NewProjectile(vector8.X, vector8.Y, (float)(Math.Cos(rotation) * Speed) * -1), (float)((Math.Sin(rotation) * Speed) * -1), type, damage, 0f, 0);
npc.ai[1] = 0;
}
}
I have been messing around with this trying to make one item, and I can safely say after scrolling through every page of your tutorial, countless you tube tutorials and threads on these forums, I can safely say that this is more perplexing then trying to comprehend what is outside the known universe. How does anyone manage to create mods? I cant even make a basic sword.
Can someone please tell me whats wrong with this?
Code:public override void AI() { npc.ai[0]++; Player P = Main.player[npc.target]; if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead || !Main.player[npc.target].active) { npc.TargetClosest(true); } npc.netUpdate = true; npc.ai[1] >= 230) { float Speed = 20f; Vector2 vector8 = new Vector2(npc.position.X + (npc.width / 2), npc.position.Y + (npc.height / 2)); int damage = 10; int type = mod.ProjectileType("DragonSlimePro"); Main.PlaySound(23, (int)npc.position.X, (int)npc.position.Y, 17); float rotation = (float)Math.Atan2(vector8.Y - (P.position.Y + (P.height * 0.5f)), vector8.X - (P.position.X + (P.width * 0.5f))); int num54 = Projectile.NewProjectile(vector8.X, vector8.Y, (float)(Math.Cos(rotation) * Speed) * -1), (float)((Math.Sin(rotation) * Speed) * -1), type, damage, 0f, 0); npc.ai[1] = 0; } }
Mainly because the most people that start modding have not programmed before. Meaning that they are using applied programming without even knowing basic programming. It's like taking up scuba diving if you don't know how to swim.
I just fixed that and there was also something wrong in here:Mainly because the most people that start modding have not programmed before. Meaning that they are using applied programming without even knowing basic programming. It's like taking up scuba diving if you don't know how to swim.
Looks like a part of your if statement went missing (at npc.ai[1] >= 230) ).
{
float Speed = 20f;
Vector2 vector8 = new Vector2(npc.position.X + (npc.width / 2), npc.position.Y + (npc.height / 2));
int damage = 10;
int type = mod.ProjectileType("DragonSlimePro");
Main.PlaySound(23, (int)npc.position.X, (int)npc.position.Y, 17);
float rotation = (float)Math.Atan2(vector8.Y - (P.position.Y + (P.height * 0.5f)), vector8.X - (P.position.X + (P.width * 0.5f)));
int num54 = Projectile.NewProjectile(vector8.X, vector8.Y, (float)(Math.Cos(rotation) * Speed) * -1), (float)((Math.Sin(rotation) * Speed) * -1), type, damage, 0f, 0);
npc.ai[1] = 0;
}
go into your /terraria/ModLoader/Logs/Compile Errors.txt and it'll be easier to help youI just fixed that and there was also something wrong in here:
And I don't what it is.Code:{ float Speed = 20f; Vector2 vector8 = new Vector2(npc.position.X + (npc.width / 2), npc.position.Y + (npc.height / 2)); int damage = 10; int type = mod.ProjectileType("DragonSlimePro"); Main.PlaySound(23, (int)npc.position.X, (int)npc.position.Y, 17); float rotation = (float)Math.Atan2(vector8.Y - (P.position.Y + (P.height * 0.5f)), vector8.X - (P.position.X + (P.width * 0.5f))); int num54 = Projectile.NewProjectile(vector8.X, vector8.Y, (float)(Math.Cos(rotation) * Speed) * -1), (float)((Math.Sin(rotation) * Speed) * -1), type, damage, 0f, 0); npc.ai[1] = 0; }
I just fixed that and there was also something wrong in here:
And I don't what it is.Code:{ float Speed = 20f; Vector2 vector8 = new Vector2(npc.position.X + (npc.width / 2), npc.position.Y + (npc.height / 2)); int damage = 10; int type = mod.ProjectileType("DragonSlimePro"); Main.PlaySound(23, (int)npc.position.X, (int)npc.position.Y, 17); float rotation = (float)Math.Atan2(vector8.Y - (P.position.Y + (P.height * 0.5f)), vector8.X - (P.position.X + (P.width * 0.5f))); int num54 = Projectile.NewProjectile(vector8.X, vector8.Y, (float)(Math.Cos(rotation) * Speed) * -1), (float)((Math.Sin(rotation) * Speed) * -1), type, damage, 0f, 0); npc.ai[1] = 0; }
int num54 = Projectile.NewProjectile(vector8.X, vector8.Y, (float)(Math.Cos(rotation) * Speed) * -1), (float)((Math.Sin(rotation) * Speed) * -1), type, damage, 0f, 0);
int num54 = Projectile.NewProjectile(vector8.X, vector8.Y, (float)(Math.Cos(rotation) * Speed) * -1);
c:\Users\Bryson\Documents\My Games\Terraria\ModLoader\Mod Sources\GunPulse\Items\DragonEgg.cs(32,13) : warning CS0162: Unreachable code detected
c:\Users\Bryson\Documents\My Games\Terraria\ModLoader\Mod Sources\GunPulse\NPCs\Boss\DragonSlime.cs(71,40) : error CS0234: The type or namespace name 'NewProjectile' does not exist in the namespace 'GunPulse.Projectile' (are you missing an assembly reference?)
using System;
using System.IO;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Graphics.Effects;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;
namespace GunPulse.NPCs.Boss
{
public class DragonSlime : ModNPC
{
public override void SetDefaults()
{
npc.name = "Dragon Slime";
npc.displayName = "Dragon Slime";
npc.aiStyle = 3;
npc.lifeMax = 5000;
npc.damage = 60;
npc.defense = 200;
npc.knockBackResist = 0;
npc.width = 162;
npc.height = 126;
animationType = NPCID.Zombie;
Main.npcFrameCount[npc.type] = 3;
npc.value = Item.buyPrice(0, 40, 75, 42);
aiType = NPCID.Bunny;
npc.npcSlots = 1f;
npc.boss = true;
npc.lavaImmune = true;
npc.noGravity = false;
npc.noTileCollide = false;
npc.soundHit = 8;
npc.soundKilled = 14;
npc.netAlways = true;
}
public override void AutoloadHead(ref string headTexture, ref string bossHeadTexture)
{
bossHeadTexture = "GunPulse/NPCs/Boss/DragonSlime_Head_Boss";
}
public override void BossLoot(ref string name, ref int potionType)
{
potionType = ItemID.GreaterHealingPotion;
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DragonBar"), 23);
}
public override void ScaleExpertStats(int numPlayers, float bossLifeScale)
{
npc.lifeMax += (int)(npc.lifeMax * 0.579f * bossLifeScale);
npc.damage += (int)(npc.damage * 0.6f);
}
public override void AI()
{
npc.ai[0]++;
Player P = Main.player[npc.target];
if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead || !Main.player[npc.target].active)
{
npc.TargetClosest(true);
}
npc.netUpdate = true;
npc.ai[1]++;
if (npc.ai[1] >= 230)
{
float Speed = 20f;
Vector2 vector8 = new Vector2(npc.position.X + (npc.width / 2), npc.position.Y + (npc.height / 2));
int damage = 10;
int type = mod.ProjectileType("DragonSlimePro");
Main.PlaySound(23, (int)npc.position.X, (int)npc.position.Y, 17);
float rotation = (float)Math.Atan2(vector8.Y - (P.position.Y + (P.height * 0.5f)), vector8.X - (P.position.X + (P.width * 0.5f)));
int num54 = Projectile.NewProjectile(vector8.X, vector8.Y, (float)(Math.Cos(rotation) * Speed) * -1);
npc.ai[1] = 0;
}
}
}
}