C# MOD Compile Error (TModloader)C#

Место общения программистов C#
Ответить
Anonymous
 C# MOD Compile Error (TModloader)

Сообщение Anonymous »

Итак, я делаю свой собственный мод Terraria, но у меня есть одна проблема, заключающаяся в том, что когда я использую один из элементов из моего мода в рецепте Crating для чего -то другого в моем моде, это дает мне ошибку. Я уверен, что код все в порядке. < /P>

Это элемент, который использует что -то из моего мода: < /p>

using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Graphics.Effects;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;

namespace TestMod.Items.Weapons //Where it is located
{
public class BladeOfTheElements : ModItem
{
public override void SetDefaults()
{
item.name = "Blade Of The Elements"; //Sword name
item.damage = 26; //Sword damage - Damage is x2.5 - 43 here = 109 in game
item.crit = -46; //Crit chance of the weapon
item.melee = true; //Is it a melee item?
item.width = 74; //Sword width
item.height = 74; //Sword height
item.toolTip = "A blade containing the power of; Fire, Ice and Forest"; //Item Description
item.useTime = 23; //How fast is the item? How fast does it swing or shoot?
item.useAnimation = 23;
item.useStyle = 1; //How is the item used? 1 is sword
item.knockBack = 4; //The knockback of the item
item.value = 100000; //How much does it sell for? 100 = 1 Silver
item.rare = 5;
item.useSound = 1; //What sound type? 1 is sword
item.autoReuse = true; //If it's a sword can it autoswing?
item.useTurn = true;
item.shoot = mod.ProjectileType("BladeOfTheElementsProj");
item.shootSpeed = 6f; //Speed of the projectile
}
public override void AddRecipes() //How do you craft the item?
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.BladeOfTheForest, 1); //What do you need to craft the item? (Use 1 dirt block for testing)
recipe.AddIngredient(ItemID.BladeOfIce, 1);
recipe.AddIngredient(ItemID.BladeOfTheDemons, 1);
recipe.AddTile(TileID.Anvils); //Where is it made? Work bench, anvil, water? etc (Use worck bench for testing)
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}
< /code>

Все лезвия в рецепте крафта внизу находятся от моего мода, но я получаю эту ошибку, когда я пытаюсь скомпилировать свой мод: < /p>

Произошла ошибка при составлении мода. < /p>

c:/Users/Nicolas/Documents/My Games/Terraria/ModLoader/Mod Sources/TestMod/Items/Weapons/BladeOfTheElements.cs(37,41) : error CS0117: 'Terraria.ID.ItemID' does not contain a definition for 'BladeOfTheForest'
< /code>

Я бы просто хотел указать, что когда я использовал грязные блоки для рецепта (для проверки оружия), я мог бы просто скомпилировать мод. < /p>

Подробнее здесь: https://stackoverflow.com/questions/378 ... tmodloader
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «C#»