Standalone [1.3] tModLoader - A Modding API

I made so that my sword shoots the star wrath projectile (503), but then instead of the star falling, it constantly shot it in a stream. . .

So how do i make a projectile fall from the sky???
I looked it up for you and this guy has a pretty good answer.
Do you want this effect on a custom projectile, or with a custom weapon?
If it's the weapon part you want, you can override the Shoot function on the ModItem and give the position.Y (of the projectile you want to shoot) some negative values like 'position.Y -= 100;' and fiddle around a bit with the speedX and speedY values depending on which side the player is facing (if you want to take that into account). After that just return true in the shoot function and (with a bit of fiddling around with the values) you might just end up with the effect you want.
If you want this effect on a custom projectile, it's going to be a bit harder (still quite possible, though) you actually want to do the same as with the custom weapon (change the position etc.) in the AI function (which you'll have to override). Inside this AI, you have to do a check if the projectile hasn't updated yet so something like this will do (note, this can be better)
Code:
private bool hasUpdated = false;
public override void AI()
{
        if(!hasUpdated)
        {
                hasUpdated = true;
                projectile.position.Y -= 100;
                // Change the velocity parameter of the projectile here.   
        }
}
As you can see, I've added a comment. Instead of changing speedX and speedY parameters like you'd do with the custom weapon, you have to change the projectile.velocity.X and projectile.velocity.Y parameters to get the effect you want. Again, fiddle around with this a bit untill you end up with the effect you want (since the effect you want to achieve might differ from the effect I'm thinking of, so I'm not giving you resolute values).
Hope this helps you on your way.

P.S. Sorry for the large amount of text ><
 
I'm currently playing through Terraria with a bunch of mods, and i just defeated all 3 mech bosses, then i went to mine Chlorophyte, and i couldn't craft Chlorophyte bars! So then i looked in the recipe browser and clicked on Chlorophyte and it said that to make a Chlorophyte bar, I needed a: "Red potion"! Does anyone know of a fix for this??? I play hours of modded Terraria a day, I will be SO bored without it. :(
 
I'm currently playing through Terraria with a bunch of mods, and i just defeated all 3 mech bosses, then i went to mine Chlorophyte, and i couldn't craft Chlorophyte bars! So then i looked in the recipe browser and clicked on Chlorophyte and it said that to make a Chlorophyte bar, I needed a: "Red potion"! Does anyone know of a fix for this??? I play hours of modded Terraria a day, I will be SO bored without it. :(
One of your mods, in a rather weird move, has removed the original Chlorophyte Bar recipe and added one that requires a Red Potion. Disable your mods one by one until the recipe changes again: that'll point out which mod is changing the recipe. If I were you, I'd drop that mod entirely, because unless there is a way to legitimately get the Red Potion in that mod, that mod is essentially a troll mod by locking away a good portion of the progression.
 
One of your mods, in a rather weird move, has removed the original Chlorophyte Bar recipe and added one that requires a Red Potion. Disable your mods one by one until the recipe changes again: that'll point out which mod is changing the recipe. If I were you, I'd drop that mod entirely, because unless there is a way to legitimately get the Red Potion in that mod, that mod is essentially a troll mod by locking away a good portion of the progression.
The culprit was Tremor Mod, but they have released an update fixing the issue.
 
You Should Re-download tmodloader. Just replace the similar files, because the new update v0.2.3 has mac mod browser support.

Tell me if the didn't work
[doublepost=1491915765,1491915727][/doublepost][doublepost=1491915727,1491915674][/doublepost]

Thanks!

EDIT: I just read It. Would it possibly :redspin: up my computer?

Um I already re downloaded T Mod Loader for multiple times, since the start of V 0.9.2.1 I have been trying to solve this problem myself and it doesn't seem to work. So should I try to re download v 0.9.2.3 again ?
 
can someone tell me how to fix the white boxes around (almost) all modded tiles, items, projectiles, and entities? Thanks in advance
 
can someone tell me how to fix the white boxes around (almost) all modded tiles, items, projectiles, and entities? Thanks in advance
I've only seen that problem in a few of "All the walls" mod's wall items.. But I think that just may be because those item icons didn't get created with the proper transparency colors...

How many mods are you running into that's doing that? A screenshot could help in understanding what you're seeing.
 
I get an error upon compiling my mod, the error is:

c:\Users\Tyler\Documents\My Games\Terraria\ModLoader\Mod Sources\TestMod\TestMod\Items\HeroBlade.cs(6,15) : error CS0101: The namespace 'TestMod.Items' already contains a definition for 'HeroBlade'

Can someone help? the code of that section is as follows:

The place the error says its in, is in the "class" word of public class HeroBlade : ModItem


using Terraria.ID;
using Terraria.ModLoader;
namespace TestMod.Items
{
public class HeroBlade : ModItem
{
public override void SetDefaults()
{
item.name = "Hero Blade";
item.damage = 200;
item.melee = true;
item.width = 40;
item.height = 40;
item.toolTip = "A blade forged from the gods."
item.useTime = 20;
item.useAnimation = 20;
item.useStyle = 1;
item.knockBack = 6;
item.value = 10000;
item.rare = 4;
item.UseSound = SoundID.Item1;
item.autoReuse = true;
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(HeroBlade);
recipe.AddIngredient(ItemID.DirtBlock);
recipe.AddIngredient(ItemID.Wood, 5);
//recipe.AddTile(TileID.MythrilAnvil);
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}
 
I get an error upon compiling my mod, the error is:

c:\Users\Tyler\Documents\My Games\Terraria\ModLoader\Mod Sources\TestMod\TestMod\Items\HeroBlade.cs(6,15) : error CS0101: The namespace 'TestMod.Items' already contains a definition for 'HeroBlade'

Can someone help? the code of that section is as follows:

The place the error says its in, is in the "class" word of public class HeroBlade : ModItem


using Terraria.ID;
using Terraria.ModLoader;
namespace TestMod.Items
{
public class HeroBlade : ModItem
{
public override void SetDefaults()
{
item.name = "Hero Blade";
item.damage = 200;
item.melee = true;
item.width = 40;
item.height = 40;
item.toolTip = "A blade forged from the gods."
item.useTime = 20;
item.useAnimation = 20;
item.useStyle = 1;
item.knockBack = 6;
item.value = 10000;
item.rare = 4;
item.UseSound = SoundID.Item1;
item.autoReuse = true;
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(HeroBlade);
recipe.AddIngredient(ItemID.DirtBlock);
recipe.AddIngredient(ItemID.Wood, 5);
//recipe.AddTile(TileID.MythrilAnvil);
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}
Look in the other .cs files, you have a duplicate class somewhere in your code, hence the error: The namespace 'TestMod.Items' already contains a definition for 'HeroBlade'
 
I have public class HeroBlade in 2 cs files, HeroBlade.cs and TestMod.cs, what do I do if I dont want them to conflict?
Then they would have to be in different namespaces. Although if one is an item, and one is a projectile, for example, it might be better to name one HeroBladeItem and the other HeroBladeProjectile.

Think of namespaces like folders, you can't have 2 files with the same filename in the same folder, just like you can't have 2 classes with the same classname in the same namespace.
 
I have public class HeroBlade in 2 cs files, HeroBlade.cs and TestMod.cs, what do I do if I dont want them to conflict?

My case is that I simply have HeroBlade.cs and HeroBlade.png, I created a folder for the hero blade it self, and put the sprite and cs file inside that folder. I changed the namespace, the one in TestMod.cs is TestMod.Items and the one in HeroBlade.cs is TestMod.Items.HeroBlade (heroblade being my folder) and it still gives me the same error.
 
My case is that I simply have HeroBlade.cs and HeroBlade.png, I created a folder for the hero blade it self, and put the sprite and cs file inside that folder. I changed the namespace, the one in TestMod.cs is TestMod.Items and the one in HeroBlade.cs is TestMod.Items.HeroBlade (heroblade being my folder) and it still gives me the same error.
I don't really get what you are doing. Are these both ModItems? Why do you have 2? Are you sure you changed the namespace in both files? It might be easiest to just come to the Discord channel so we can chat. discord.me/tmodloader
 
I don't really get what you are doing. Are these both ModItems? Why do you have 2? Are you sure you changed the namespace in both files? It might be easiest to just come to the Discord channel so we can chat. discord.me/tmodloader

I joined the discord, and what I mean is that I have one code in the main mod folder (TestMod) and I have a subfolder called Items, and I have another subfolder inside Items called HeroBlade. this is where I keep the sprite, sounds and the C# file.
 
Wait, we are able to put item data into their own items/subfolder now, instead of them all being in the item directory?
That has never been a restriction. Even in ExampleMod things are wherever we happened to put them. The namespace and folder combo has always been the deciding factor.
 
That has never been a restriction. Even in ExampleMod things are wherever we happened to put them. The namespace and folder combo has always been the deciding factor.
Err, I wasn't actually aware of that. I came from Tapi or whatever came before that, so I haven' actually started modding with Tmodloader. I just didn't expect it to be more open like that. It's a good change, for sure.
 
i dont know if its possible, but can someone make a volcanic biome? it replaces the desert biome. the underground volcanic biome has a entrance similar to the one of the desert, except the underground volcanic biome is inside the volcano, and ocassionaly the volcano erupts and the underground portion will start to flood with lava, once the lava has covered the entrance of the volcano, lava balls will start to jump out and upon hitting a wall or the floor will "drop" half a block of lava.
Shadowflame volcanic biome: corruption + volcanic biome, the lava turns purple and the debuff that the lava gives will now be shadowflame. different enemies also spawn.
even if its not possible on tmodloader, i wont mind it being a standalone mod
didn't understand? ask me and i'll give a more detailed explanation
 
Back
Top Bottom