Standalone [1.3] tModLoader - A Modding API

ai[0]: 0 when the projectile is out and then when it reaches where the boomerang would return It goes to 1
ai[1]: goes up really fast when the projectile is out and then returns to 0 instantly and the projectile disappears

I also moved the code I put in public override void AI() to the PostAI()
There must be something wrong there somewhere. I'll have to see all of your projectile's code to really see what's happening. If someone else spots the problem before I do, feel free to jump in with a solution.

The vanilla AI will always get called unless PreAI returns false; that's actually why it's necessary to set an NPC's aiStyle to -1 when you're using completely custom AI.
Thank you. I stand corrected.

I found something odd. When I use this code, it sometimes causes very strange issues:
Code:
public bool bodyTexMatch()
{
    string bodyTexPath = "MyMod/Items/Armor/MyChest_Body";
    string bodyFemTexPath = "MyMod/Items/Armor/MyChest_FemaleBody";

    DrawData data;
    for(int i=0;i<Main.playerDrawData.Count;i++){
        data=Main.playerDrawData[i];
        Main.NewText("Texture name:"+(data.texture.Name ?? ""));
        if(data.texture.Equals(mod.GetTexture(bodyTexPath)) || data.texture.Equals(mod.GetTexture(bodyFemTexPath)))
        {
            return true;
        }
    }
    return false;
}
*snip*
This may or may not be your problem, but it's probably to load a texture during gameplay. I'd suggest you load them within your main mod class. (The one that extends Mod.) define a texture inside that class like so:
Code:
public static Texture2D myTexture;
Then use the Load hook to load that texture like so:
Code:
public override void Load()
        {
            if (Main.dedServ) return; //don't do the following if on a server
            myTexture = GetTexture("myTexturePath");
}
Then you can find that texture with 'myNamespace.mytexture'.

I don't know if that will make any difference, but it's worth a go.
 
i only have windows defender(win10),automatically deleted the .exe i ALREADY have in the main directory ,also deleting the files whenever i re-download thru main link.A bit afraid if i were to ignore it.
My windows defender deleted the Terraria.exe that comes with Tmodloader as well, claiming it's a serious threat and immediately deletes it
 
For my code, I cant get this ammo reduction to work.

player.ammoCost33 = true;

Help. What is the actually sentence.
 
For my code, I cant get this ammo reduction to work.

player.ammoCost33 = true;

Help. What is the actually sentence.
There are no booleans to indicate non-consumability (I hereby patent that word). Thankfully, tModLoader has a very useful solution to that in the form of the ConsumeAmmo hook.

Put this in your ModItem class (if it is a weapon, that is. If it's something else, let me know).
Code:
public override bool ConsumeAmmo(Player player)
{
    if (Main.rand.Next(3) == 0) // Generates a random number between 0 and 3 (0, 1 or 2)
    {
        return false;
    }
    return true;
}

If that doesn't work, add using Microsoft.Xna.Framework; to the top of your code.
 
I guess it's dumb question and it was discussed a lot, but I can't find it. How can I change the direction of projectile when it collides the tile? Multiplying projectile.direction by -1 does not give the expected result.
 
Well my computer is telling me there is trojan virus in the files so i guess i cant play with mods anymore R.I.P modded terraria 13-06-2016
I just told my computer to ignore whatever was triggering it, works fine.. still pretty strange though, because it was the windows defender that triggered, not a random anti-virus i had installed myself
 
And yet another question, I bet, was discussed here, how can I move drill to my hands? I guess something like draworiginoffset could help me, but if I place the drill further on X-axis, while I'm drilling the blocks on the left side of me the drill goes too far on X-axis. I can't find anything about it in example mod.
 
Back
Top Bottom