Oh, Lang.misc[37] basically just translates the word "Any" for you, just in case someone is using a different language.Bluemagic123 I man this :
public override void AddCraftGroups()
{
AddCraftGrouop("Lasers", Lang.misc[37] + " " + ...
}
I have it so that you don't have to call Projectile.NewProjectile if you want the weapon to decide what's fired. You just need to modify the type parameter in the Shoot hook to the type of the projectile you want to shoot.Yeah, yeah, I should have known my expression going ambiguously again, sorry about that.
Buy this "ammo", I mean, what a gun shoots does not decide on what its "item.shoot" is, but decide on the ammo it's using. So, if this is the case, how should I create the projectile of the ammo-decided projectile in Shoot hook? Now normally regarding some laser weapons, they have their own projectile. If I'm to modify their lasers, it's quite simple. And if I'm to modify what a gun shoots, that can be a lot of works to do, since I don't know how to refer to what a gun is shooting, I can only use "if" to judge this type by type. Maybe you could give me some examples about how to create a projectile (same as a gun is shooting) in Shoot hook.
And in a NewProjectile call:
There seems not to be a value that defines the update times, How should I call this ExtraUpdates?Code:Projectile.NewProjectile(float, float, float, float, int, int, float, int, float, float)
It is a field of projectile. You set it in modprojectile.setdefaults(). You don't call it because it is a number(int) not a function.There seems not to be a value that defines the update times, How should I call this ExtraUpdates?
The error there explains it perfectly. Set it to an int not a boolWhat should i do if mod cannot be build because of extraUpdate ?
It make this error : Cannot implicitly convert type 'bool' to 'int'
If you check the vanilla ammos, you'll notice they have a shoot field. Essentially, whenever a weapon uses an ammo, it uses the ammo's shoot field, shootSpeed too iirc. So you essentially want your weapon to have multiple ammos with multiple different shoot IDs so that they will shoot different projectiles depending on the ammo.Yeah, yeah, I should have known my expression going ambiguously again, sorry about that.
Buy this "ammo", I mean, what a gun shoots does not decide on what its "item.shoot" is, but decide on the ammo it's using. So, if this is the case, how should I create the projectile of the ammo-decided projectile in Shoot hook? Now normally regarding some laser weapons, they have their own projectile. If I'm to modify their lasers, it's quite simple. And if I'm to modify what a gun shoots, that can be a lot of works to do, since I don't know how to refer to what a gun is shooting, I can only use "if" to judge this type by type. Maybe you could give me some examples about how to create a projectile (same as a gun is shooting) in Shoot hook.
And in a NewProjectile call:
There seems not to be a value that defines the update times, How should I call this ExtraUpdates?Code:Projectile.NewProjectile(float, float, float, float, int, int, float, int, float, float)
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
int proj = Projectile.NewProjectile(position.X,position.Y,speedX,speedY,type,damage,knockBack,player.whoAmI);
Main.projectile[proj].extraUpdates = 2;
return false;
}
But i just add extraUpdate and it wryte this errorThe error there explains it perfectly. Set it to an int not a bool
If you mean hit instantly, make your weapon shoot very slowly (like maybe a shootSpeed of 1 or 2), then give the projectile a number of extraUpdates equal to speed*X pixels of distance you want your laser to reach. In the projectile's preAI or postAI, make it create dusts, so it will not look completely invisible.But i just add extraUpdate and it wryte this error
or how do i make projectile look like laser i want to make it to just appear like with shoot speed unlimited
https://github.com/bluemagic123/tMo...4/ExampleMod/Projectiles/ExampleBullet.cs#L23and how the extraupdate code looks like because it didnt work for me if i tryed this
Sure. I found this old post from this very thread. ( I searched this thread only for clentaminator and it was in the results.)Is it possible to make a clentaminator/solution?
Underground desert? more like giant bee hive!!
another:
last one:
heh, I've never used the Clentaminator until a few days ago, it's pretty cool. Any ideas for a cool solution?
Any idea of how to do it in the code?Sure. I found this old post from this very thread. ( I searched this thread only for clentaminator and it was in the results.)
Also a couple pages back I posted code for someone trying to combat corruption. A solution is the same code, just on a projectile instead of a tile. I think on ai. Check the vanilla item fields values spreadsheet for the specifics on the solutions.
This reminds me, I need to make a spreadsheet for projectiles too.
can someone help me i cant return to vanilla please i need help and fast please
Call this funtion:so its possible to give a effect on hit enemy
and possible to spawn item on hit enemy
but is it possible to spawn a enemy on hit enemy?
Call this funtion:
public static int NewItem(int X, int Y, int Width, int Height, int Type, int Stack = 1)
...on these functions:
https://github.com/bluemagic123/tMo...ojectile-int-damage-float-knockback-bool-crit
https://github.com/bluemagic123/tMo...tem-item-int-damage-float-knockback-bool-crit
...should work.
Oops, I thought you said spawn item on hit. Here is the method you'll call instead of Item.newItem:thats all well and good but i got no idea how to use these codes
need code thats made that i then can change some things on
public override void OnHitByItem(Player player, Item item, int damage, float knockback, bool crit)
{
NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("ModNPCNameHere"));
// OR
NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, Terraria.ID.NPCID.Bunny);
}
public override void OnHitByProjectile(Projectile projectile, int damage, float knockback, bool crit)
{
NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("ModNPCNameHere"));
// OR
NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, Terraria.ID.NPCID.Bunny);
}
Oops, I thought you said spawn item on hit. Here is the method you'll call instead of Item.newItem:
public static int NewNPC(int X, int Y, int Type, int Start = 0, float ai0 = 0f, float ai1 = 0f, float ai2 = 0f, float ai3 = 0f, int Target = 255)
As for code, it's like this in your ModNPC: (I'm assuming the npc is the one spawning the other npc, but for an item or projectile to have the same effect, there are similar hooks you can use. The GitHub wiki knows all)
Code:public override void OnHitByItem(Player player, Item item, int damage, float knockback, bool crit) { NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("ModNPCNameHere")); NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, Terraria.ID.NPCID.Bunny); } public override void OnHitByProjectile(Projectile projectile, int damage, float knockback, bool crit) { NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("ModNPCNameHere")); NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, Terraria.ID.NPCID.Bunny); }
K, I assumed you wanted an npc that kept multiplying itself when hit.useing like example sword to hit any mob and spawn it on the other mobs spot so noth mobs are there
EDIT just so u know all these things are on the weapon not the NPC
public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit)
{
target.AddBuff(BuffID.OnFire, 60);
//NPC.NewNPC((int)target.Center.X, (int)target.Center.Y, mod.NPCType("ModNPCNameHere"));
NPC.NewNPC((int)target.Center.X, (int)target.Center.Y, NPCID.LostGirl);
}
K, I assumed you wanted an npc that kept multiplying itself when hit.
Here is what you can add to ExampleSword.cs
Code:public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { target.AddBuff(BuffID.OnFire, 60); //NPC.NewNPC((int)target.Center.X, (int)target.Center.Y, mod.NPCType("ModNPCNameHere")); NPC.NewNPC((int)target.Center.X, (int)target.Center.Y, NPCID.LostGirl); }