Not until someone with the GOG version joins the team and helps us make it happen.So I'm assuming this still doesn't have support for the gig version right?
Not until someone with the GOG version joins the team and helps us make it happen.So I'm assuming this still doesn't have support for the gig version right?
using System;
using System.Windows.Input;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace Trekko727Mod.Items
{
public class SASKnife : ModItem
{
public override void SetDefaults()
{
item.name = "SAS Knife";
item.damage = 35;
item.melee = true;
item.width = 36;
item.height = 36;
item.position.Y = 2;
item.toolTip = "This is a modded sword.";
item.useTime = 18;
item.useAnimation = 20;
item.useStyle = 0;
item.knockBack = 6;
item.value = 10000;
item.channel = true;
item.rare = 2;
item.useSound = 1;
item.autoReuse = false;
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.DirtBlock, 1);
recipe.AddTile(TileID.WorkBenches);
recipe.SetResult(this);
recipe.AddRecipe();
}
public override void UseStyle(Player player)
{
int counter = 0;
if (counter > 10 && item.channel == true)
{
// position the itemlocation over the head
} else if (counter >10 && item.channel == true){
// spawn the projectile
} else if (item.channel == true){
counter++;
} else {
// copy in the code for useStyle of 1 for the swing
}
}
}
}
I doubt that, we are almost 200 pages in on this thread. What problems are you running into?This mod is apparently incomplete or is not working on 1.3.0.8
I'd still recommend doing a weapon for each behavior first before trying to do it all-in-one.I just did my scripts! haven't gotten other things in without getting the basics correct though
Anybody got any coding to make my projectile have looping frames?
Lol I just remembered that I had a txt file of all the Ai stlyes 1.2.4.1It appears that most of the sprite handling for projectiles is hardcoded. I do not believe there is a way to do this without some serious fiddling.
Well, you can look up tutorials on how to begin learn C#. You can also look at terraria's source code to learn how things work for it.How do I do .cs coding!!!!!!
It looks very complicated!Well, you can look up tutorials on how to begin learn C#. You can also look at terraria's source code to learn how things work for it.
What I have tried to do isIt looks very complicated!
I actually just programmed such a spell. It's a bit messy, but it uses 80 mana to create a portal at the cursor that pulls in any NPCs close enough, excluding town NPCs.Hey, I have a question @bluemagic123.
Can you make a projectile "implode", or pull enemies towards it's center, and have it created at the cursor?
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ModLoader;
namespace MyMod.Items.Weapons
{
public class Abyss : ModItem
{
public override void SetDefaults()
{
item.name = "Abyss";
item.damage = 20;
item.magic = true;
item.mana = 80;
item.width = 28;
item.height = 30;
item.toolTip = "Suck 'em in.";
item.useTime = 15;
item.useAnimation = 15;
item.useStyle = 5;
item.noMelee = true;
item.knockBack = -1;
item.value = 10000;
item.rare = 7;
item.useSound = 8;
item.autoReuse = false;
item.shoot = mod.ProjectileType("AbyssProjectile");
item.shootSpeed = 0.0f;
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient("Spell Tome", 1);
recipe.AddIngredient("Hallowed Bar", 20);
recipe.AddIngredient("Soul of Night", 24);
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ModLoader;
namespace MyMod.Projectiles
{
public class AbyssProjectile : ModProjectile
{
public Vector2 mpos;
public override void SetDefaults()
{
projectile.name = "Abyss Projectile";
projectile.width = 50;
projectile.height = 65;
projectile.alpha = 0;
projectile.scale = 1.0f;
projectile.timeLeft = 1000;
projectile.penetrate = 7;
projectile.hostile = false;
projectile.friendly = true;
projectile.magic = true;
projectile.tileCollide = false;
projectile.ignoreWater = true;
mpos = new Vector2(-1f, -1f);
}
public override void AI()
{
if (mpos.X == -1f && mpos.Y == -1f) {
projectile.position = mpos = Main.MouseWorld - new Vector2(projectile.width/2, projectile.height/2);
}
for (int i = 0; i < 201; i++) {
if (!Main.npc[i].boss && !Main.npc[i].townNPC) {
double dist = Math.Sqrt(Math.Pow(projectile.position.X-Main.npc[i].position.X,2)+Math.Pow(projectile.position.Y-Main.npc[i].position.Y,2));
if (dist <= 400.0f) {
if (Main.npc[i].position.X < projectile.position.X && Main.npc[i].velocity.X < 3.0f) {
Main.npc[i].velocity.X += (float)dist/300.0f;
} else if (Main.npc[i].position.X > projectile.position.X && Main.npc[i].velocity.X > -3.0f) {
Main.npc[i].velocity.X -= (float)dist/300.0f;
}
if (Main.npc[i].position.Y < projectile.position.Y && Main.npc[i].velocity.Y < 3.0f) {
Main.npc[i].velocity.Y += (float)dist/100.0f;
} else if (Main.npc[i].position.Y > projectile.position.Y && Main.npc[i].velocity.Y > -3.0f) {
Main.npc[i].velocity.Y -= (float)dist/100.0f;
}
}
}
}
}
public override bool? CanHitNPC(NPC target) {
if (target.townNPC) {
return false;
}
return true;
}
}
}
I highly suggest just opening up the Example Mod and tooling around with it. If you have no prior experience in programming, then I would suggest starting with a different language, personally.How do I do .cs coding!!!!!!
either that or go Khan Academy (its free and online) learn javascript (everything is similar)What I have tried to do is
1. Download Visual Studio Community
2. Open up example mod
3. Open up C# files in VS
4. Stare at the code and learn what should do what and how it does that.
5. Attempt at writing code for a simple item so that you can begin learning.
On a final note, if you try to do this for awhile you should be able to type C# soon!
Hope this helps
I think you should try something more basic than C# coding. Then try and do some basic stuff. If you want to mod, you'll need to know these basic things:How do I do .cs coding!!!!!!
public override bool PreShoot(Player player,Vector2 ShootPos,Vector2 ShootVelocity,int projType,int Damage,float knockback)
{
Projectile.NewProjectile(ShootPos.X,ShootPos.Y,projType,Damage,knockback,Main.myPlayer);
return false;
}
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
return base.Shoot(player, ref position, ref speedX, ref speedY, ref type, ref damage, ref knockBack);
}
guys? one question
any way to spawn projectile?
item.shoot = mod.ProjectileType("MyProjectile");
item.shoot = <x>;
Never mind this won't work because you need to set the permission to run this file and i don't know how to automate that.I made a command file that you can double click on mac and as long as you have mono installed it will open the installer. I attached it if you wanna include it in the mac download.
(apparently you can't upload .commands so here is media fire)
https://www.mediafire.com/?wnf201evu1xwbja