Yes it's a bug.Hey guys, i just installed tAPI, but when i import maps and characters, all my different item stacks are reduced to one.
Is it normal ?
Still doesn't work, I just get a crash error and the version of the .exe says 0.0.0.0Game Launcher isn't part of tAPI. it's a different thing.
and GLI name means nothing, just put in the same name as the regular name
In case you haven't found out yet you could add this in the json.Excuse me, could someone tell me if you can change the position of an object when you're using? For example: vanilla weapons in the game, when the player uses the mini-Shark has his hand on the "trigger" but when I use my weapon, the player uses from the lower part to the left and looks weird.
Sorry for my bad english.
"holdoutOffset": [-1, 0],
I also get no message that game crashed on startup.I have tAPI with Necro, Thorium mods. When i launched it it said a error. All i seen is something about framework. When i launched next time no error is appearing. I have seen in task manager that WerFault.exe launches and closes tAPI. LIST WHAT DID I DO: Reinstalled tAPI. Deleted players, mods, worlds. I even reinstalled Terraria! Still the same. HELP!
In case you haven't found out yet you could add this in the json.
You can change the numbers to your liking too.Code:"holdoutOffset": [-1, 0],
public void Damage() {
if (Main.projPet[this.type] && !VanillaMinion) { // Vanilla Minion Summarizes a lot of '&& this.type != VanillaMinionProjectileType
return;
}
}
Main.projPet[ProjDef.byName["InternalModName:ProjectileName"].type] = false; // Makes it not be a pet, so it can do damage
public override void PreItemCheck(Player player) {
Main.projPet[ProjDef.byName["InternalModName:ProjectileName"].type] = true; // Sets projPet to true in order to summon it
}
// And
public override void PostItemCheck(Player player) {
Main.projPet[ProjDef.byName["InternalModName:ProjectileName"].type] = false; // Returns projPet to false in order for it to cause damage
}
No. the cause is that "projectile.friendly" gets deactivated. in my code it sets projectile.friendly to true only if it's attacking and to false if it's just following the player. that way it won't accidentally cut grass/pots/whateverFor anyone interested, here's some info on Minions in tAPI r15...
From looking at the code it looks like the cause might be in the Projectile.cs file, in the Damage() function
In ModJsonHandler.cs when tAPI reads a projectiles JSON file,Code:public void Damage() { if (Main.projPet[this.type] && !VanillaMinion) { // Vanilla Minion Summarizes a lot of '&& this.type != VanillaMinionProjectileType return; } }
Main.projPet[projectile.type] = (flag || projectile.minion);
So all Minions are considered pets, and no pets can do damage.
It looks like that 'if' statement I commented above is just missing an additional - && !this.minion - check.
Seems simple, I'm sure they'll have it fixed for the next version.
In the mean time here's a work-around (May or may not work for Multi-Player) -
In the MBase.cs file in PreGameUpdate() (May work in OnLoad() as well, haven't tested) use
Code:Main.projPet[ProjDef.byName["InternalModName:ProjectileName"].type] = false; // Makes it not be a pet, so it can do damage
Then in the CS file for the item that spawns the minion use
Code:public override void PreItemCheck(Player player) { Main.projPet[ProjDef.byName["InternalModName:ProjectileName"].type] = true; // Sets projPet to true in order to summon it } // And public override void PostItemCheck(Player player) { Main.projPet[ProjDef.byName["InternalModName:ProjectileName"].type] = false; // Returns projPet to false in order for it to cause damage }
I've tested this with two different mods and was able to get their minions to do damage again.
WerFault.exe? try scanning your PC with an antivirusI have tAPI with Necro, Thorium mods. When i launched it it said a error. All i seen is something about framework. When i launched next time no error is appearing. I have seen in task manager that WerFault.exe launches and closes tAPI. LIST WHAT DID I DO: Reinstalled tAPI. Deleted players, mods, worlds. I even reinstalled Terraria! Still the same. HELP!
Did you try my solution? I successfully resolved the issue in two different mods. Perhaps Main.projPet also effects projectile.friendly. Either way the work-around seems to work. And my logic seems valid. It's clear that no damage is caused by anything declared as a projPet, since the Damage() function returns immediately if projPet is true. And all minions have projPet set to true. So no damage actually occurs. As soon as minions have projPet set to false, they do damage again. Further, it seems validated by the fact that the 'if' statement that returns if projPet is true, checks for the special case where the projectile is a vanilla minion. Which is why Vanilla minions still work, but not modded ones.No. the cause is that "projectile.friendly" gets deactivated. in my code it sets projectile.friendly to true only if it's attacking and to false if it's just following the player. that way it won't accidentally cut grass/pots/whatever
I need to try this; ever since r14a I've been just copying over the entire Damage() code (minus the part that stops it from working) to a general Minion class and recommending the same thing in my tutorial. What you have is so much easierFor anyone interested, here's some info on Minions in tAPI r15...
From looking at the code it looks like the cause might be in the Projectile.cs file, in the Damage() function
In ModJsonHandler.cs when tAPI reads a projectiles JSON file,Code:public void Damage() { if (Main.projPet[this.type] && !VanillaMinion) { // Vanilla Minion Summarizes a lot of '&& this.type != VanillaMinionProjectileType return; } }
Main.projPet[projectile.type] = (flag || projectile.minion);
So all Minions are considered pets, and no pets can do damage.
It looks like that 'if' statement I commented above is just missing an additional - && !this.minion - check.
Seems simple, I'm sure they'll have it fixed for the next version.
In the mean time here's a work-around (May or may not work for Multi-Player) -
In the MBase.cs file in PreGameUpdate() (May work in OnLoad() as well, haven't tested) use
Code:Main.projPet[ProjDef.byName["InternalModName:ProjectileName"].type] = false; // Makes it not be a pet, so it can do damage
Then in the CS file for the item that spawns the minion use
Code:public override void PreItemCheck(Player player) { Main.projPet[ProjDef.byName["InternalModName:ProjectileName"].type] = true; // Sets projPet to true in order to summon it } // And public override void PostItemCheck(Player player) { Main.projPet[ProjDef.byName["InternalModName:ProjectileName"].type] = false; // Returns projPet to false in order for it to cause damage }
I've tested this with two different mods and was able to get their minions to do damage again.
That's not the problem; if you're using an aiStyle, then it knows when to set projectile.friendly to true or not.No. the cause is that "projectile.friendly" gets deactivated. in my code it sets projectile.friendly to true only if it's attacking and to false if it's just following the player. that way it won't accidentally cut grass/pots/whatever
I'm using r15 and my minion isn't broken AT ALL. it works perfectly fine and i didn't change any code since r14a.Did you try my solution? I successfully resolved the issue in two different mods. Perhaps Main.projPet also effects projectile.friendly. Either way the work-around seems to work. And my logic seems valid. It's clear that no damage is caused by anything declared as a projPet, since the Damage() function returns immediately if projPet is true. And all minions have projPet set to true. So no damage actually occurs. As soon as minions have projPet set to false, they do damage again. Further, it seems validated by the fact that the 'if' statement that returns if projPet is true, checks for the special case where the projectile is a vanilla minion. Which is why Vanilla minions still work, but not modded ones.
Your minion does damage by firing a projectile, and that minion's projectile is causing damage. So your minion would not be affected by this bug. This particular bug prevents minions from causing damage when coming in contact with an enemy.I'm using r15 and my minion isn't broken AT ALL. it works perfectly fine and i didn't change any code since r14a.