我得到了这个“错误CS1524:{expected” [英] I got this "error CS1524: { expected"

查看:105
本文介绍了我得到了这个“错误CS1524:{expected”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写了这些脚本:



使用System;

使用System.Collections.Generic;

使用Microsoft.Xna.Framework;

使用Terraria;

使用Terraria.DataStructures;

使用Terraria.ID;

使用Terraria.ModLoader;



名称空间Crimson Chaos.Items

{

公共类CustomYoyo:ModItem

{

public覆盖void SetDefaults()

{



item.name =Crimson Yoyo;

item.damage = 26;

item.melee = true;

item.toolTip =它是yoyo,它还能做什么?;

item.useTime = 22;

item.useAnimation = 22;

item.useStyle = 5;

item.channel = true;

item.knockBack = 2f;

item.value = Item.buyPrice(0,10,0,0);

item.rare = 3;

item.autoReuse = false;

item.shoot = mod.ProjectileType(CustomYoyoProjectile);

item.noUseGraphic = true;

item.noMelee = true;

item.UseSound = SoundID.Item1;

}

public override void AddRecipes()

{

ModRecipe recipe = new ModRecipe(mod);

recipe.AddIngredient(ItemID.DirtBlock,1);

recipe.AddTile(TileID.WorkBenches);

recipe.SetResult(this);

recipe.AddRecipe();

}

}

}

}



第二名:



使用System;

使用System.Collections.Generic;

使用Microsoft.Xna.Framework;

使用Terraria;

使用Terraria.ID;

使用Terraria.ModLoader;



名称空间TutorialMOD.Projectiles

{

公共类CustomYoyoProjectile:ModProjectile

{



public override void SetDefaults()

{

projectile.extraUpdates = 0;

projectile.name =Crimson Yoyo Projectile;

projectile.width = 16;

projectile.height = 16;

projectile.aiStyle = 99;

projectile.friendly = true;

projectile.penetrate = -1;

projectile.melee = true;

ProjectileID.Sets.YoyosLifeTimeMultiplier [projectile.type] = -1f;

ProjectileID.Sets.YoyosMaximumRange [projectile.type] = 220f;

ProjectileID.Sets.YoyosTopSpeed [projectile.type] = 10f;

}

公共覆盖无效AI()

{

if(Main.rand.Next(2)== 0)

{

Dust.NewDust(projectile.position + projectile.velocity,projectile.width ,projectile.height,DustID.Fire,projectile.velocity.X * 0.5f,projectile.velocity.Y * 0.5f);

}

}

}

}

第3名:



使用Terraria.ModLoader;



命名空间Crimson Chaos

{

class Crimson Chaos:Mod

{

public Crimson Chaos()

{

Properties = new ModProperties()

{

Autoload = true,

AutoloadGores = true,

AutoloadSounds = true,

};

}

}

}

}



4 ..:



<?xml version =1.0encoding =utf-8?>

< Project ToolsVersion =14.0DefaultTargets =Build xmlns =http://schemas.microsoft.com/developer/msbuild/2003>

< Import Project =$(MSBuildExtensionsPath)$(MSBuildToolsVersion)\ Microsoft.Common.props 条件=存在('$(MSBuildExtensionsPath)$(MSBuildToolsVersion)\ Microsoft.Common.props')/>

< propertygroup>

<配置条件='$(配置)'==''>调试

<平台条件='$(平台)'==''> AnyCPU

< projectguid> {8298EAB6-0586-4BDA-9483-83624B66B13A}

< outputtype>图书馆

< appdesignerfolder>属性

< rootnamespace> Crimson Chaos

< assemblyname> Crimson Chaos

< targetframeworkversion> v4.5.2

< filealignment> 512

< autogeneratebindingredirects> true



< PropertyGroup Condition ='$(Configuration)| $(Platform)'=='Debug | AnyCPU '>

< platformtarget> AnyCPU

< debugsymbols> true

< debugtype> full

< optimize> false

< outputpath> bin \Debug \

< defineconstants> DEBUG; TRACE

< errorreport> ;提示

< warninglevel> 4



< PropertyGroup Condition ='$(Configuration)| $(Platform)'== '发布| AnyCPU'>

< platformtarget> AnyCPU

< debugtype> pdbonly

< optimize> true
< outputpath> bin \Release \

< defineconstants> TRACE

< errorreport>提示

< warninglevel> 4



< itemgroup>

< Compile Include =** \ * .cs/>



< itemgroup>

< Reference Include =Microsoft.Xna.Framework,Version = 4.0.0.0,Culture = neutral,PublicKeyToken = 842cf8be1de50553,processorArchitecture = x86>

< specificversion> False

< hintpath> C:\ Windows \ MyMicrosoft.NET \assembly \ GAC_32 \ Microsoft.Xna.Framework \v4.0_4.0.0.0__842cf8be1de50553 \ Microsoft.Xna。 Framework.dll



< Reference Include =Microsoft.Xna.Framework.Game,Version = 4.0.0.0,Culture = neutral,PublicKeyToken = 842cf8be1de50553,processorArchitecture = x86 >

< specificversion> False

< hintpath> C:\ Windows \ microsoft.NET \assembly \ GAC_32 \ Microsoft.Xna。 F ramework.Game \v4.0_4.0.0.0__842cf8be1de50553\Microsoft.Xna.Framework.Game.dll



< Reference Include =Microsoft.Xna.Framework .Graphics,Version = 4.0.0.0,Culture = neutral,PublicKeyToken = 842cf8be1de50553,processorArchitecture = x86>

< specificversion> False

< hintpath> C: \ Windows \ Mysrosoft.NET \assembly\GAC_32\Microsoft.Xna.Framework.Graphics\v4.0_4.0.0.0__842cf8be1de50553\Microsoft.Xna.Framework.Graphics.dll



< Reference Include =Microsoft.Xna.Framework.Xact,Version = 4.0.0.0,Culture = neutral,PublicKeyToken = 842cf8be1de50553,processorArchitecture = x86>

< specificversion> False

< hintpath> C:\ Windows \ MyMicrosoft.NET \assembly \ GAC_32 \ Microsoft.Xna.Framework.Xact \v4.0_4.0.0 .0__842cf8be1de50553\Microsoft.Xna.Framework.Xact.dll



< Refer ence Include =System/>

< Reference Include =Terraria>

< hintpath> C:\Program Files(x86)\ Steam \steamapps\common\terraria\Terraria.exe





< Import Project =$(MSBuildToolsPath)\\ \\ Microsoft.CSharp.targets/>

< propertygroup>

< postbuildevent>C:\Program Files(x86)\Steam \ stepamapps \ common\terraria\Terraria.exe-build$(ProjectDir)\-eac$(TargetPath)







第5名:



<?xml version =1.0encoding =utf-8?>

< Project ToolsVersion =14.0xmlns =http://schemas.microsoft.com/developer/msbuild/2003>

< PropertyGroup Condition = '$(配置)| $(平台)'=='调试| AnyCPU'>

< startaction>程序

< startprogram> C:\程序文件%28x86%29 \ team \steamapps\common\Terraria\Terraria.exe

< startworkingdirectory> C:\Program Files%28x86%29 \Steam \steamapps\common\Terraria \\ \\ / $






我尝试过的事情:



问谷歌,其他人甚至不记得了。

在youtube上问人

i wrote these scripts:

using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;

namespace Crimson Chaos.Items
{
public class CustomYoyo : ModItem
{
public override void SetDefaults()
{

item.name = "Crimson Yoyo";
item.damage = 26;
item.melee = true;
item.toolTip = "Its a yoyo, what else could it be?";
item.useTime = 22;
item.useAnimation = 22;
item.useStyle = 5;
item.channel = true;
item.knockBack = 2f;
item.value = Item.buyPrice(0, 10, 0, 0);
item.rare = 3;
item.autoReuse = false;
item.shoot = mod.ProjectileType("CustomYoyoProjectile");
item.noUseGraphic = true;
item.noMelee = true;
item.UseSound = SoundID.Item1;
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.DirtBlock, 1);
recipe.AddTile(TileID.WorkBenches);
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}
}

2nd one:

using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace TutorialMOD.Projectiles
{
public class CustomYoyoProjectile : ModProjectile
{

public override void SetDefaults()
{
projectile.extraUpdates = 0;
projectile.name = "Crimson Yoyo Projectile";
projectile.width = 16;
projectile.height = 16;
projectile.aiStyle = 99;
projectile.friendly = true;
projectile.penetrate = -1;
projectile.melee = true;
ProjectileID.Sets.YoyosLifeTimeMultiplier[projectile.type] = -1f;
ProjectileID.Sets.YoyosMaximumRange[projectile.type] = 220f;
ProjectileID.Sets.YoyosTopSpeed[projectile.type] = 10f;
}
public override void AI()
{
if (Main.rand.Next(2) == 0)
{
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, DustID.Fire, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f);
}
}
}
}
3rd one:

using Terraria.ModLoader;

namespace Crimson Chaos
{
class Crimson Chaos : Mod
{
public Crimson Chaos()
{
Properties = new ModProperties()
{
Autoload = true,
AutoloadGores = true,
AutoloadSounds = true,
};
}
}
}
}

4th..:

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<propertygroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug
<Platform Condition=" '$(Platform)' == '' ">AnyCPU
<projectguid>{8298EAB6-0586-4BDA-9483-83624B66B13A}
<outputtype>Library
<appdesignerfolder>Properties
<rootnamespace>Crimson Chaos
<assemblyname>Crimson Chaos
<targetframeworkversion>v4.5.2
<filealignment>512
<autogeneratebindingredirects>true

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<platformtarget>AnyCPU
<debugsymbols>true
<debugtype>full
<optimize>false
<outputpath>bin\Debug\
<defineconstants>DEBUG;TRACE
<errorreport>prompt
<warninglevel>4

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<platformtarget>AnyCPU
<debugtype>pdbonly
<optimize>true
<outputpath>bin\Release\
<defineconstants>TRACE
<errorreport>prompt
<warninglevel>4

<itemgroup>
<Compile Include="**\*.cs" />

<itemgroup>
<Reference Include="Microsoft.Xna.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
<specificversion>False
<hintpath>C:\Windows\Microsoft.NET\assembly\GAC_32\Microsoft.Xna.Framework\v4.0_4.0.0.0__842cf8be1de50553\Microsoft.Xna.Framework.dll

<Reference Include="Microsoft.Xna.Framework.Game, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
<specificversion>False
<hintpath>C:\Windows\Microsoft.NET\assembly\GAC_32\Microsoft.Xna.Framework.Game\v4.0_4.0.0.0__842cf8be1de50553\Microsoft.Xna.Framework.Game.dll

<Reference Include="Microsoft.Xna.Framework.Graphics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
<specificversion>False
<hintpath>C:\Windows\Microsoft.NET\assembly\GAC_32\Microsoft.Xna.Framework.Graphics\v4.0_4.0.0.0__842cf8be1de50553\Microsoft.Xna.Framework.Graphics.dll

<Reference Include="Microsoft.Xna.Framework.Xact, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
<specificversion>False
<hintpath>C:\Windows\Microsoft.NET\assembly\GAC_32\Microsoft.Xna.Framework.Xact\v4.0_4.0.0.0__842cf8be1de50553\Microsoft.Xna.Framework.Xact.dll

<Reference Include="System" />
<Reference Include="Terraria">
<hintpath>C:\Program Files (x86)\Steam\steamapps\common\terraria\Terraria.exe


<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<propertygroup>
<postbuildevent>"C:\Program Files (x86)\Steam\steamapps\common\terraria\Terraria.exe" -build "$(ProjectDir)\" -eac "$(TargetPath)"



5th:

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<startaction>Program
<startprogram>C:\Program Files %28x86%29\Steam\steamapps\common\Terraria\Terraria.exe
<startworkingdirectory>C:\Program Files %28x86%29\Steam\steamapps\common\Terraria\



What I have tried:

Asked google, others that i cant even remeber.
Asked people on youtube

推荐答案

(MSBuildExtensionsPath)
(MSBuildExtensionsPath)


(MSBuildToolsVersion)\ Microsoft.Common.propsCondition =Exists('
(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('


(MSBuildExtensionsPath)
(MSBuildExtensionsPath)


这篇关于我得到了这个“错误CS1524:{expected”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆