Sosmula2011
Terrarian
Can you make mods without Visual studio? I cant run it on my computer.
It's possible (I always make my mods using plain old Notepad), but if you're new to programming it would make programming very hard for you.Can you make mods without Visual studio? I cant run it on my computer.
Can you make mods without Visual studio? I cant run it on my computer.
yeah, i don't even know what visual studio is, but i use textedit on my mac and it works fineIt's possible (I always make my mods using plain old Notepad), but if you're new to programming it would make programming very hard for you.
It should by default.How to forbid decompile my mod?
Sorry, I meant during hardmode.What is post hardmode??
Of course you can, only you'll have to figure out all errors and mistakes by yourself. Shouldn't be much of an issue for experienced programmers though.Can you mod it without visual studio? I cant run VS on my computer.
Yes you canCan you mod it without visual studio? I cant run VS on my computer.
umm... you just asked this, and we already told you...Can you mod it without visual studio? I cant run VS on my computer.
Okay, ThanksCan you make mods without Visual studio? I cant run it on my computer.
https://github.com/bluemagic123/tModLoader/blob/master/ExampleMod/NPCs/Octopus.csHow do I make it to where an enemy only spawns on the beach during hardmode?
EDIT: I know how to do the hardmode part, but how do I make it spawn only on the beach?
The first post details tModReader, the program to unpack mods. If the modder has decided not to allow unpacking the source code, I'm sure you can PM them and they will be happy to tell you....unless they don't want to.Sorry if this has been asked or the answer is obvious but is it possible to decompile tmod files and if so how can I?
What I'm wanting to do is check out the code to find the exact spawn conditions for some modded mobs, plus maybe the drop rates for items
Not working.what situation for multiplayers?
It'd help if you can show us the error?Hello, dont know if this was answered but, every time i try to load the Tremor mod, i get an error page, plz help.
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ModLoader;
namespace TEM.Projectiles
{
public class VortexPulseShot : ModProjectile
{
public override void SetDefaults()
{
projectile.name = "Vortex Pulse Shot";
projectile.width = 22;
projectile.height = 22;
projectile.aiStyle = 0;
projectile.friendly = true;
projectile.penetrate = -1;
projectile.tileCollide = false;
projectile.hide = true;
projectile.ranged = true;
projectile.ignoreWater = true;
}
public override void AI()
{
if (flag && Main.myPlayer == projectile.owner)
{
if (player.channel && player.HasAmmo(player.inventory[player.selectedItem], true) && !player.noItems && !player.CCed)
{
float num5 = player.inventory[player.selectedItem].shootSpeed * projectile.scale;
Vector2 vector2_2 = vector2_1;
Vector2 vector2_3 = Main.screenPosition + new Vector2((float) Main.mouseX, (float) Main.mouseY) - vector2_2;
if ((double) player.gravDir == -1.0)
vector2_3.Y = (float) (Main.screenHeight - Main.mouseY) + Main.screenPosition.Y - vector2_2.Y;
Vector2 vector2_4 = Vector2.Normalize(vector2_3);
if (float.IsNaN(vector2_4.X) || float.IsNaN(vector2_4.Y))
vector2_4 = -Vector2.UnitY;
vector2_4 *= num5;
if ((double) vector2_4.X != (double) projectile.velocity.X || (double) vector2_4.Y != (double) projectile.velocity.Y)
projectile.netUpdate = true;
projectile.velocity = vector2_4;
float num6 = 14f;
int num7 = 7;
for (int index = 0; index < 2; ++index)
{
Vector2 vector2_5 = projectile.Center + new Vector2((float) Main.rand.Next(-num7, num7 + 1), (float) Main.rand.Next(-num7, num7 + 1));
Vector2 spinningpoint = Vector2.Normalize(projectile.velocity) * num6;
spinningpoint = Utils.RotatedBy(spinningpoint, Main.rand.NextDouble() * 0.196349546313286 - 0.0981747731566429, new Vector2());
if (float.IsNaN(spinningpoint.X) || float.IsNaN(spinningpoint.Y))
spinningpoint = -Vector2.UnitY;
Projectile.NewProjectile(vector2_5.X, vector2_5.Y, spinningpoint.X, spinningpoint.Y, "TEM:PulseShot", projectile.damage, projectile.knockBack, projectile.owner, 0.0f, 0.0f);
}
}
else
projectile.Kill();
}
}
}
}
Yup, that's this line, right:When I build my mod I get this error on line 50 of this code
View attachment 93418
Code:using System; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace TEM.Projectiles { public class VortexPulseShot : ModProjectile { public override void SetDefaults() { projectile.name = "Vortex Pulse Shot"; projectile.width = 22; projectile.height = 22; projectile.aiStyle = 0; projectile.friendly = true; projectile.penetrate = -1; projectile.tileCollide = false; projectile.hide = true; projectile.ranged = true; projectile.ignoreWater = true; } public override void AI() { if (flag && Main.myPlayer == projectile.owner) { if (player.channel && player.HasAmmo(player.inventory[player.selectedItem], true) && !player.noItems && !player.CCed) { float num5 = player.inventory[player.selectedItem].shootSpeed * projectile.scale; Vector2 vector2_2 = vector2_1; Vector2 vector2_3 = Main.screenPosition + new Vector2((float) Main.mouseX, (float) Main.mouseY) - vector2_2; if ((double) player.gravDir == -1.0) vector2_3.Y = (float) (Main.screenHeight - Main.mouseY) + Main.screenPosition.Y - vector2_2.Y; Vector2 vector2_4 = Vector2.Normalize(vector2_3); if (float.IsNaN(vector2_4.X) || float.IsNaN(vector2_4.Y)) vector2_4 = -Vector2.UnitY; vector2_4 *= num5; if ((double) vector2_4.X != (double) projectile.velocity.X || (double) vector2_4.Y != (double) projectile.velocity.Y) projectile.netUpdate = true; projectile.velocity = vector2_4; float num6 = 14f; int num7 = 7; for (int index = 0; index < 2; ++index) { Vector2 vector2_5 = projectile.Center + new Vector2((float) Main.rand.Next(-num7, num7 + 1), (float) Main.rand.Next(-num7, num7 + 1)); Vector2 spinningpoint = Vector2.Normalize(projectile.velocity) * num6; spinningpoint = Utils.RotatedBy(spinningpoint, Main.rand.NextDouble() * 0.196349546313286 - 0.0981747731566429, new Vector2()); if (float.IsNaN(spinningpoint.X) || float.IsNaN(spinningpoint.Y)) spinningpoint = -Vector2.UnitY; Projectile.NewProjectile(vector2_5.X, vector2_5.Y, spinningpoint.X, spinningpoint.Y, "TEM:PulseShot", projectile.damage, projectile.knockBack, projectile.owner, 0.0f, 0.0f); } } else projectile.Kill(); } } } }
Projectile.NewProjectile(vector2_5.X, vector2_5.Y, spinningpoint.X, spinningpoint.Y, "TEM:PulseShot", projectile.damage, projectile.knockBack, projectile.owner, 0.0f, 0.0f);
"TEM:PulseShot"
Now I got really puzzled, use 2 gifs to show the problem:Allright, on your ModItem, you'll want to set 'item.noUseGraphic = true;' so that the item spear graphic will not show, 'item.noMelee = true;' so that the animation of the player will not damage enemies (the projectile will take care of that). You also need to make sure that you give 'item.shootSpeed' a value (default spear would be: item.shootSpeed = 3.7f; ).
Then... You know what, I'll make the spear easier on both of us (although maybe a little more confusing, beware ).
In the spoiler is AI code for your spear. As you can see, there are two values at the top: retract- and protract speed. 'protractSpeed' will determine the speed at which the spear shoots out, whereas retractSpeed determines how quick the spear is pulled back after it reached its dead point.
You can copy the function right beneath your SetDefaults function. I hope it works!
Code:public override bool PreAI() { float protractSpeed = 1.5F; float retractSpeed = 1.4F; Vector2 vector21 = Main.player[projectile.owner].RotatedRelativePoint(Main.player[projectile.owner].MountedCenter, true); projectile.direction = Main.player[projectile.owner].direction; Main.player[projectile.owner].heldProj = projectile.whoAmI; Main.player[projectile.owner].itemTime = Main.player[projectile.owner].itemAnimation; projectile.position.X = vector21.X - (float)(projectile.width / 2); projectile.position.Y = vector21.Y - (float)(projectile.height / 2); if (!Main.player[projectile.owner].frozen) { if (projectile.ai[0] == 0f) { projectile.ai[0] = 3f; projectile.netUpdate = true; } if (Main.player[projectile.owner].itemAnimation < Main.player[projectile.owner].itemAnimationMax / 3) { projectile.ai[0] -= retractSpeed; } else { projectile.ai[0] += protractSpeed; } } projectile.position += projectile.velocity * projectile.ai[0]; if (Main.player[projectile.owner].itemAnimation == 0) { projectile.Kill(); } projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 2.355f; if (projectile.spriteDirection == -1) { projectile.rotation -= 1.57f; } return false; }