You have probably added some unnecessary tokens. You should really let us see the script where the error occurs, so the contents your 'WindofSpeedWings.cs' file.
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(Terraria.ID.ItemID.Wood, 5);
recipe.AddTile(null, "TileID.WorkBenches");
recipe.SetResult(this);
recipe.AddRecipe();
}
}}
[DOUBLEPOST=1444778223,1444778197][/DOUBLEPOST]
i post it
This is a really easy fix:
You see the line that says 'public class Wind of Speed Wings : ModItem'? The part between 'public class' and ': ModItem' is what we call a class name. You are not allowed to have spaces in your class names, so just remocing those will do the trick. Just make it 'public class WindofSpeedWings : ModItem'.
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(Terraria.ID.ItemID.Wood, 5);
recipe.AddTile(null, "TileID.WorkBenches");
recipe.SetResult(this);
recipe.AddRecipe();
}
}}
[DOUBLEPOST=1444778223,1444778197][/DOUBLEPOST]
i post it
[DOUBLEPOST=1444778316][/DOUBLEPOST]
i post it
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(Terraria.ID.ItemID.Wood, 5);
recipe.AddTile(null, "TileID.WorkBenches");
recipe.SetResult(this);
recipe.AddRecipe();
}
}}
[DOUBLEPOST=1444778223,1444778197][/DOUBLEPOST]
i post it
[DOUBLEPOST=1444778316][/DOUBLEPOST]
i post it
Allright, major error there. Your whole image (exept the wings of course) was white, where it should have been transparent. For future reference: anything in an image that you don't want on screen should be transparent! I fixed it for you in this case, though. Here's the image.
Open the file in your explorer (may it be Chrome, Firefox or whatever) then right-click the image and select 'Save Image As..." where you can save it as a .png file.
Also, please do try to refrain from double posting. Use the 'Edit' button at the lower right of an earlier post to make adjustments
Open the file in your explorer (may it be Chrome, Firefox or whatever) then right-click the image and select 'Save Image As..." where you can save it as a .png file.
Also, please do try to refrain from double posting. Use the 'Edit' button at the lower right of an earlier post to make adjustments
It's true that a lot of these questions are about the basics of the basics regarding modding (or even image creating).
I'd really suggest looking up some info on the topic. Just look for some tutorials that suit your needs.
I'm not sure whether this is an appropriate place to ask this (or if such a place exists, really) but I've been having some trouble figuring out how to path to an image file.
My Project is called "StupidSwords". and is in the file structure "Terraria/ModLoader/Mod Sources/StupidSwords". Within this, I have an Items folder, containing TwigSword.cs and twigSword.png. In my StupidSwords.cs file (the main file for the mod, if my understanding is correct) I override Load() with the following:
Code:
AddItem("twigSword", new TwigSword(), "StupidSwords/Items/twigSword");
The ExampleMod never calls AddItem, as far as I can tell, but the docs say that the path format here should be the same as in ModLoader.GetTexture, for which the example calls "ExampleMod/Tiles/AnimatedLoom". ExampleMod(folder), like StupidSwords(folder), holds the Project file for the mod in question, so as far as I can tell the two are functionally equivalent.
Attempting to build and reload in the client results in the following error:
Code:
Missing texture StupidSwords/Items/TwigSword
at Terraria.ModLoader.ModLoader.GetTexture(String name)
at Terraria.ModLoader.Mod.SetupContent()
at Terraria.ModLoader.ModLoader.do_Load(Object threadContext)
What file path should I be using to reference the image? The Items subfolder contains the twigSword.png file.
EDIT: Looking back at the start of this thread, it's implied that the filename itself should be left out of the path, but doing so (passing "StupidSwords/Items") results in the same error.
EDIT 2: Resolved by disabling Autoload in SetModInfo(). However, the game now seems to not close properly; Steam thinks I still have it running over a minute later, but neither Terraria.exe or gameoverlayui is visible in task manager.
Sub-edit: It was just being slow, apparently. Long unload time.
1.How to make a block inflict debuffs when touched?
2. How to make a block similar to a placed Iron bar?
3.How to make a block act like sand, silt, or slush blocks?
4.How to make trees or grasses?
5.How to make homing projectiles? (Either targeting a player or an NPC)
6.How to put cooldowns when using, let's say sword shooting a beam every 2 seconds?
7.How to make a weapon shoot multiple projectiles?
8.How to make Spears and boomerangs?
9.How to make worm type npcs?
10.How make something, let's say a projectile face it's direction? (Rotation, An Arrow facing it's target)
I have a bunch of questions, but for now this..... You can answer them anytime but I hope you can help me. But yeah, please do respond and don't leave me hanging.. Thanks in advance!
1.How to make a block inflict debuffs when touched?
2. How to make a block similar to a placed Iron bar?
3.How to make a block act like sand, silt, or slush blocks?
4.How to make trees or grasses?
5.How to make homing projectiles? (Either targeting a player or an NPC)
6.How to put cooldowns when using, let's say sword shooting a beam every 2 seconds?
7.How to make a weapon shoot multiple projectiles?
8.How to make Spears and boomerangs?
9.How to make worm type npcs?
10.How make something, let's say a projectile face it's direction? (Rotation, An Arrow facing it's target)
I have a bunch of questions, but for now this..... You can answer them anytime but I hope you can help me. But yeah, please do respond and don't leave me hanging.. Thanks in advance!
Allright, I'll try to answer the questions I'm sure I've got an answer for. When there's a '-' behind your question number, then I'm not quite sure if I can answer your question correctly, so I'm leaving that out. Here we go!
1.
- (good start)
2.
I think that creating a regular tile would just be OK (?). I've seen something like this on the tModLoader thread, though, so I'll look it up for you!
3.
This might actually be tougher that you'd think. You need a lot of code for this one, but I'll try to fit in in here...
This is the code for the ball projectile. This is basically a projectile that spawns upon destroying your 'sand' block, so that it can fall down, etc.
public override void SetDefaults()
{
Main.tileSolid[Type] = true;
Main.tileMergeDirt[Type] = true;
Main.tileBlockLight[Type] = true;
Main.tileSand[Type] = true;
Main.tileLighted[Type] = true;
drop = mod.ItemType("YourSandItem");
}
public override bool TileFrame(int x, int y, ref bool resetFrame, ref bool noBreak)
{
if (WorldGen.noTileActions)
{
return false;
}
Tile above = Main.tile[x, y - 1];
Tile below = Main.tile[x, y + 1];
if (below != null && !below.active() && (!above.active() || !(above.type == 21 || above.type == 323)))
{
Main.tile[x, y].active(false);
if (Main.netMode == 0)
{
int proj = Projectile.NewProjectile((float)(x * 16 + 8), (float)(y * 16 + 8), 0f, 0.41f, mod.ProjectileType("Ball"), 10, 0f, Main.myPlayer, 1f, 0f);
WorldGen.SquareTileFrame(x, y, true);
}
else if (Main.netMode == 2)
{
int proj = Projectile.NewProjectile((float)(x * 16 + 8), (float)(y * 16 + 8), 0f, 2.5f, mod.ProjectileType("Ball"), 10, 0f, Main.myPlayer, 1f, 0f);
Main.projectile[proj].velocity.Y = 0.5f;
Main.projectile[proj].position.Y += 2f; ;
Main.projectile[proj].netUpdate = true;
NetMessage.SendTileSquare(-1, x, y, 1);
WorldGen.SquareTileFrame(x, y, true);
}
return true;
}
return true;
}
4.
This is already possible, but it wouldn't really have much effect. This is because World Hooks have not been implemented yet, so I don't think you can actually make the trees and grass spawn...
5.
You're asking for some stuff that requires quite the code and I'm running out of space... When you're making a bullet that follows an enemy NPC, just loop through the Main.npc array if the projectile doesn't have a target yet. In the loop you need to define the maximum allowed rotation for this bullet (so that it doesn't follow an NPC that's standing right behind the player when shooting) and check that against the direction from the bullet towards the NPC in question. If that's all OK, just set the index of the NPC as your target and make the projectile rotate towards that NPCs position in world space. If you know a bit of programming, this should be no probs
6.
This is also quite easy (although my solution might not actually be the best one. Define an integer variable, give that a value of 120 (2 seconds), update that value every tick and check that value against 0... Here's some code:
Code:
int shootCooldown = 120;
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
if (shootCooldown <= 0)
{
shootCooldown = 120;
return true;
}
return false;
}
public override void UpdateInventory(Player player)
{
shootCooldown--;
}
7.
Really easy one once again. Just override the Shoot function (like in my answer to the question before this one) and just spawn multiple projectiles using the 'Projectile.NewProjectile' function.
8 & 9.
I'm not going to answer these for you, although I could ( ). I'd advice you to take a look at Terraria's source for this. Believe me, it will help you a lot! If you don't know how: Download a program called 'IlSpy', drag and drop your Terraria.exe file in and you can just take a stroll through the source.
10.
Uhm... Just take the projectiles velocity, normalize it, get a direction out of it, convert to radians and apply to projectile.rotation...
Pffffft finally done!! >< Hope this (at least some of it) helps!
Allright, I'll try to answer the questions I'm sure I've got an answer for. When there's a '-' behind your question number, then I'm not quite sure if I can answer your question correctly, so I'm leaving that out. Here we go!
1.
- (good start)
2.
I think that creating a regular tile would just be OK (?). I've seen something like this on the tModLoader thread, though, so I'll look it up for you!
3.
This might actually be tougher that you'd think. You need a lot of code for this one, but I'll try to fit in in here...
This is the code for the ball projectile. This is basically a projectile that spawns upon destroying your 'sand' block, so that it can fall down, etc.
public override void SetDefaults()
{
Main.tileSolid[Type] = true;
Main.tileMergeDirt[Type] = true;
Main.tileBlockLight[Type] = true;
Main.tileSand[Type] = true;
Main.tileLighted[Type] = true;
drop = mod.ItemType("YourSandItem");
}
public override bool TileFrame(int x, int y, ref bool resetFrame, ref bool noBreak)
{
if (WorldGen.noTileActions)
{
return false;
}
Tile above = Main.tile[x, y - 1];
Tile below = Main.tile[x, y + 1];
if (below != null && !below.active() && (!above.active() || !(above.type == 21 || above.type == 323)))
{
Main.tile[x, y].active(false);
if (Main.netMode == 0)
{
int proj = Projectile.NewProjectile((float)(x * 16 + 8), (float)(y * 16 + 8), 0f, 0.41f, mod.ProjectileType("Ball"), 10, 0f, Main.myPlayer, 1f, 0f);
WorldGen.SquareTileFrame(x, y, true);
}
else if (Main.netMode == 2)
{
int proj = Projectile.NewProjectile((float)(x * 16 + 8), (float)(y * 16 + 8), 0f, 2.5f, mod.ProjectileType("Ball"), 10, 0f, Main.myPlayer, 1f, 0f);
Main.projectile[proj].velocity.Y = 0.5f;
Main.projectile[proj].position.Y += 2f; ;
Main.projectile[proj].netUpdate = true;
NetMessage.SendTileSquare(-1, x, y, 1);
WorldGen.SquareTileFrame(x, y, true);
}
return true;
}
return true;
}
4.
This is already possible, but it wouldn't really have much effect. This is because World Hooks have not been implemented yet, so I don't think you can actually make the trees and grass spawn...
5.
You're asking for some stuff that requires quite the code and I'm running out of space... When you're making a bullet that follows an enemy NPC, just loop through the Main.npc array if the projectile doesn't have a target yet. In the loop you need to define the maximum allowed rotation for this bullet (so that it doesn't follow an NPC that's standing right behind the player when shooting) and check that against the direction from the bullet towards the NPC in question. If that's all OK, just set the index of the NPC as your target and make the projectile rotate towards that NPCs position in world space. If you know a bit of programming, this should be no probs
6.
This is also quite easy (although my solution might not actually be the best one. Define an integer variable, give that a value of 120 (2 seconds), update that value every tick and check that value against 0... Here's some code:
Code:
int shootCooldown = 120;
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
if (shootCooldown <= 0)
{
shootCooldown = 120;
return true;
}
return false;
}
public override void UpdateInventory(Player player)
{
shootCooldown--;
}
7.
Really easy one once again. Just override the Shoot function (like in my answer to the question before this one) and just spawn multiple projectiles using the 'Projectile.NewProjectile' function.
8 & 9.
I'm not going to answer these for you, although I could ( ). I'd advice you to take a look at Terraria's source for this. Believe me, it will help you a lot! If you don't know how: Download a program called 'IlSpy', drag and drop your Terraria.exe file in and you can just take a stroll through the source.
10.
Uhm... Just take the projectiles velocity, normalize it, get a direction out of it, convert to radians and apply to projectile.rotation...
Pffffft finally done!! >< Hope this (at least some of it) helps!
Hehe of course the code surely did help, about 2 and 4, I asked because I wanted my block to act as of a tree, if first block is removed, so as everything on top of it.
5 I was just assuming if anyone can tell me the projectile AI of it, I remember using it before (the Bee, Bat, Flairon Bubbles, etc AIs).
6-7 I know this already however it this error shows "No Suitable Method found to override"... I have done it to tapi before but won't work on tML now... Can you tell me why please?
8-9 Aww... Men... Do I really need to do the thing Red does not want people to do? I mean.. You know why not tell? XP
10 err I don't really get things much, unless it's coded.. Or oh well i'll just go check the tAPI template. P
Either ways, I am very glad you responded. Thank you very much!
Just in case if you know how, can you tell me how to animate a tile consisting of 15 frames with 4 tiles (16 x16) per frame (chest like) ? Because I'm kinda having a hard time doing so...
Allright, I'll try to answer the questions I'm sure I've got an answer for. When there's a '-' behind your question number, then I'm not quite sure if I can answer your question correctly, so I'm leaving that out. Here we go!
1.
- (good start)
2.
I think that creating a regular tile would just be OK (?). I've seen something like this on the tModLoader thread, though, so I'll look it up for you!
3.
This might actually be tougher that you'd think. You need a lot of code for this one, but I'll try to fit in in here...
This is the code for the ball projectile. This is basically a projectile that spawns upon destroying your 'sand' block, so that it can fall down, etc.
public override void SetDefaults()
{
Main.tileSolid[Type] = true;
Main.tileMergeDirt[Type] = true;
Main.tileBlockLight[Type] = true;
Main.tileSand[Type] = true;
Main.tileLighted[Type] = true;
drop = mod.ItemType("YourSandItem");
}
public override bool TileFrame(int x, int y, ref bool resetFrame, ref bool noBreak)
{
if (WorldGen.noTileActions)
{
return false;
}
Tile above = Main.tile[x, y - 1];
Tile below = Main.tile[x, y + 1];
if (below != null && !below.active() && (!above.active() || !(above.type == 21 || above.type == 323)))
{
Main.tile[x, y].active(false);
if (Main.netMode == 0)
{
int proj = Projectile.NewProjectile((float)(x * 16 + 8), (float)(y * 16 + 8), 0f, 0.41f, mod.ProjectileType("Ball"), 10, 0f, Main.myPlayer, 1f, 0f);
WorldGen.SquareTileFrame(x, y, true);
}
else if (Main.netMode == 2)
{
int proj = Projectile.NewProjectile((float)(x * 16 + 8), (float)(y * 16 + 8), 0f, 2.5f, mod.ProjectileType("Ball"), 10, 0f, Main.myPlayer, 1f, 0f);
Main.projectile[proj].velocity.Y = 0.5f;
Main.projectile[proj].position.Y += 2f; ;
Main.projectile[proj].netUpdate = true;
NetMessage.SendTileSquare(-1, x, y, 1);
WorldGen.SquareTileFrame(x, y, true);
}
return true;
}
return true;
}
4.
This is already possible, but it wouldn't really have much effect. This is because World Hooks have not been implemented yet, so I don't think you can actually make the trees and grass spawn...
5.
You're asking for some stuff that requires quite the code and I'm running out of space... When you're making a bullet that follows an enemy NPC, just loop through the Main.npc array if the projectile doesn't have a target yet. In the loop you need to define the maximum allowed rotation for this bullet (so that it doesn't follow an NPC that's standing right behind the player when shooting) and check that against the direction from the bullet towards the NPC in question. If that's all OK, just set the index of the NPC as your target and make the projectile rotate towards that NPCs position in world space. If you know a bit of programming, this should be no probs
6.
This is also quite easy (although my solution might not actually be the best one. Define an integer variable, give that a value of 120 (2 seconds), update that value every tick and check that value against 0... Here's some code:
Code:
int shootCooldown = 120;
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
if (shootCooldown <= 0)
{
shootCooldown = 120;
return true;
}
return false;
}
public override void UpdateInventory(Player player)
{
shootCooldown--;
}
7.
Really easy one once again. Just override the Shoot function (like in my answer to the question before this one) and just spawn multiple projectiles using the 'Projectile.NewProjectile' function.
8 & 9.
I'm not going to answer these for you, although I could ( ). I'd advice you to take a look at Terraria's source for this. Believe me, it will help you a lot! If you don't know how: Download a program called 'IlSpy', drag and drop your Terraria.exe file in and you can just take a stroll through the source.
10.
Uhm... Just take the projectiles velocity, normalize it, get a direction out of it, convert to radians and apply to projectile.rotation...
Pffffft finally done!! >< Hope this (at least some of it) helps!
Hehe of course the code surely did help, about 2 and 4, I asked because I wanted my block to act as of a tree, if first block is removed, so as everything on top of it.
5 I was just assuming if anyone can tell me the projectile AI of it, I remember using it before (the Bee, Bat, Flairon Bubbles, etc AIs).
6-7 I know this already however it this error shows "No Suitable Method found to override"... I have done it to tapi before but won't work on tML now... Can you tell me why please?
8-9 Aww... Men... Do I really need to do the thing Red does not want people to do? I mean.. You know why not tell? XP
10 err I don't really get things much, unless it's coded.. Or oh well i'll just go check the tAPI template. P
Either ways, I am very glad you responded. Thank you very much!
Just in case if you know how, can you tell me how to animate a tile consisting of 15 frames with 4 tiles (16 x16) per frame (chest like) ? Because I'm kinda having a hard time doing so...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.