Hello modding community, this is my first time posting on modding with Terraria, and I'm hitting quite a few snags. As of this post, I've only attempted modding for one day, and I literally never touched any kind of real coding, so I'm still far below a novice at this sort of thing. I've a few things I'd like help and clarification on, as well as a couple of general questions I could not find the answer to by searching Google, the forums, or asking on other sites. Sprite work is not an issue, especially with how simple it is to mimic the art style in the game (though I wonder why sprites are drawn tiny and upscaled 2x), but coding is something I've never been good with. I spent a good chunk of the day trying to learn how to do this, since I had a lot of free time, and I might've missed stuff in my searching. If I ask something that was answered that I missed, I apologize and would be greatly appreciative if I could be pointed to the post with the answer if that happened.
I also apologize for the wall of text that I'm about to drop. I wanted to be thorough on what I wanted to explain, and it got a bit winded. It's also 4:30 AM when I posted this, so I'm tired when I posted it.
I. Accessories
First, I've been trying to make a few accessories. The first issue is the most obnoxious of the bunch, being that I get this error every time I try to build the mod in the game;
"accessory01.cs(11,30) : error CS0115: 'My_Mod.Items.CustomShield.Autoload(ref string, ref string, System.Collections.Generic.IList<Terraria.ModLoader.EquipType>)': no suitable method found to override"
The code for it is as follows;
Code:
using System;
using System.Collections.Generic;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace My_Mod.Items
{
public class CustomShield : ModItem
{
public override bool Autoload(ref string name, ref string texture, IList<EquipType> equips)
{
equips.Add(EquipType.Shield);
return true;
}
public override void SetDefaults()
{
item.name = "Mythic Bulwark";
item.width = 24;
item.height = 28;
item.toolTip = "Grants immunity to knockback.";
item.value = Item.buyPrice(0, 2, 0, 0);
item.rare = 4;
item.accessory = true;
item.defense = 4;
}
public override void UpdateAccessory(Player player, bool hideVisual) // Does this actually hide the shield? I don't want that, how would I remove this safely?
{
player.noKnockback = true;
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.DirtBlock, 1);
recipe.AddTile(TileID.WorkBenches);
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}
I followed a guide on youtube to creating a shield, which was my first accessory choice. I was able to get a proper melee weapon added in, which was surprisingly simple, but accessories seem to be much harder. The error tells me that the item.name line is the problem, but I cannot figure out why as the videos I watch on making mods for tmodloader clearly use the same code with different text. What am I doing wrong with the code that causes the error?
II. Visual Studio Question
The shortest question I have is related to Visual Studio. In the guide on how to set up MVS to work with Terraria, I followed everything step by step. Thankfully, everything does work, and I've had little to no trouble at all getting used to it. Unfortunately, the IntelliSense stated in the opening post of this thread doesn't happen. It'll fill in stuff like "Items" when I try to type "item", but it doesn't fill in anything like I've seen in the opening post or in the tutorials I've watched and read. Is there some small detail I somehow missed?
III. Monsters
On the next topic, I'm also making sprites for monsters. I figured out how to implement basic zombies and slimes, but I only know how to make them spawn at night since the zombie was the first thing I managed to make. I want to make more monsters, specifically things similar to a Wyvern since I want to make bigger monster sprites without going into boss territory (that's biting way too much for a beginner, most likely). I found how to make the zombie as it was the first tutorial I found, but I can't find ANYTHING on how to make a Wyvern. I mainly just want to make variants spawn, much like there's a bunch of zombies, slimes, and skeletons. I just want to have different skins on default Wyvern stats, and I've got a few already sprited. I just can't find the details on a Wyvern. I have access to decompiled data, thanks to Google, but even then I can't find anything at all. Would someone be capable of posting a modded wyvern's code? This is one of my more ambitious goals, even if it's not much.
On two similar notes, how would I increase the movement speed and jump height of the other mentioned enemies, and what are the codes to allow monsters to spawn at certain times and biomes? I want mad hopping skeletons in the purity, zombies running at mach four in the desert, and slimes jumping into space like the dolphins from the Hitchhiker's Guide movie.
IV. Weapons
Next on my questions, and hearkening back to the weapon I mentioned, I don't know how to make them fire projectiles. I'm not aiming to make something absurd like Meowmere and Starwrath, but I just want to make a melee weapon that you upgrade over time that is useful in every tier. I understand how to do the crafting and recipes, since that's incredibly simple, but I've had a hard time finding anything that's not a basic melee weapon. No yoyos, no thrown items, but a normal sword/hammer/axe/fish that has a projectile that progressively gets better as the weapon upgrades. How would I go about making a melee weapon that sends out a projectile?
V. Buffs on Items
My last question can probably be lumped together with the above questions, but I kept it separate because it's also a bit off topic from the above parts. As is evident from the above code, I don't have anything in the way of buffs on the accessory other than knockback resistance. I found a single, incredibly lacking wiki with a few possible things, but half of them didn't work and provided a similar error as stated above. Is there a list with all the buffs that can be applied to accessories and armor?
I'm using Notepad ++ and MSV 2017. I've downloaded the files from the various threads on setting up tmodloader and MSV for Terraria, so I've prepared as best as I could for actually doing this. I just lack the resources and know how to make the very things I want to make.