ArcaneTrain
Terrarian
So I’m really interested in learning how to mod Terraria, but I’ve run into a bit of a roadblock. I understand how to make basic items like swords and bows and stuff, but how do people go about learning more complicated things like boss AIs or more unique and complex items that require more intensive code?
For example, here’s one bit I’ve found on a modding tutorial here on the forums:
[/QUOTE]
So what does perturbedSpeed mean? What is MathHelper.Lerp? What do each of these arguements do/mean, and why are they set up like this? Most importantly, how does one go about learning what each of these mean and how to use them effectively for more complicated modding? Does anyone know of documentation that explains these, or tutorials that teach you how to do more complicated code like this? Any and all help is greatly appreciated!
For example, here’s one bit I’ve found on a modding tutorial here on the forums:
Code:
float rotation = MathHelper.ToRadians(20);
[QUOTE="Jofairden, post: 999290, member: 14826"]
for (int i = 0; i < numberProjectiles; i++)
{
Vector2 perturbedSpeed = new Vector2(speedX, speedY).RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (numberProjectiles - 1)));
Projectile.NewProjectile(position.X, position.Y, perturbedSpeed.X, perturbedSpeed.Y, type, damage, knockBack, player.whoAmI);
}
So what does perturbedSpeed mean? What is MathHelper.Lerp? What do each of these arguements do/mean, and why are they set up like this? Most importantly, how does one go about learning what each of these mean and how to use them effectively for more complicated modding? Does anyone know of documentation that explains these, or tutorials that teach you how to do more complicated code like this? Any and all help is greatly appreciated!