Standalone [1.3] tModLoader - A Modding API

Just a quick question to confirm my assumption:
A method when placing a tile is absent, right? I want to use the coordinates of the newly placed tile, so if my assumption is correct, I'm guessing I'll have to do the tile placement manually and go from there?

You could try something like the following:
Code:
public override bool PreUpdate()
{
    projectile.rotation += 0.1F * projectile.direction;
    return false;
}
Doesn't work
 
Add

projectile.rotation += 0.1f;

To Your AI() Method
I should have known...
[doublepost=1465737970,1465737795][/doublepost]Is there way to change properties of existing item?
 
So I suppose the real question here is: is it possible to change the color of an armor piece without changing the color of nearby accessories? It feels like it should, since the game already seems to do that with dressers.
I really, really want to know this. I even tried messing with Main.playerDrawData and no luck.
[doublepost=1465738044,1465738004][/doublepost]
I should have known...
[doublepost=1465737970,1465737795][/doublepost]Is there way to change properties of existing item?
Check the documentation for GlobalItem.
 
So I downloaded the GOG Windows version of the tModLoader. It contains this files.
GOG tmod.png


I don't know how to install it. I tried following the README.txt instructions but whenever I try to run terraria, it doesn't start and shows this.
GOG tmod.png


I have downloaded the GOG 1.3.1 version of terraria previously. I wanted to install the Thorium mod but it requires the tModLoader first. Any advice? Thanks.
[doublepost=1465738376,1465738148][/doublepost]
where are enough tutorials on youtube for these
Sorry bout that but I can't seem to find any tutorial on installing the tModLoader for GOG version in youtube.
 
So I downloaded the GOG Windows version of the tModLoader. It contains this files.View attachment 117367

I don't know how to install it. I tried following the README.txt instructions but whenever I try to run terraria, it doesn't start and shows this.
View attachment 117368

I have downloaded the GOG 1.3.1 version of terraria previously. I wanted to install the Thorium mod but it requires the tModLoader first. Any advice? Thanks.
[doublepost=1465738376,1465738148][/doublepost]
Sorry bout that but I can't seem to find any tutorial on installing the tModLoader for GOG version in youtube.
I only remember that Bluemagic postet an Mini-Tutorial in the thread
I can try to search for it C:
 
Can someone explain the custom boss AI.
Link some tutorial of send some example with explained what do all things or some help because i need ai that fallow the player from the sky and shoot to him and some times charge him like queen bee but if I use ai style queen bee he shoot with bees en some green things.
 
Can someone explain the custom boss AI.
Link some tutorial of send some example with explained what do all things or some help because i need ai that fallow the player from the sky and shoot to him and some times charge him like queen bee but if I use ai style queen bee he shoot with bees en some green things.
Programming AI requires an in-depth understanding of (in this case) C#.
Explaining another boss' AI could help, but you'll always need to make adjustments to fit your own boss.
Try taking a look at some of the vanilla mob AI, since boss AI is generally more complicated.
Also try to make some sort of flowchart or documentation on how you want your boss to act. Believe me, that'll make programming your boss way easier.
If you can supply at least some explanation (hovers at the same height above the player? Shoots every 3 seconds, that kind of stuff) I could try writing some basic AI fitting those requirements and give an explanation of that. I think that together with your boss documentation would teach you more than explaining a the AI of a pre-existing boss.
 
So I downloaded the GOG Windows version of the tModLoader. It contains this files.View attachment 117367

I don't know how to install it. I tried following the README.txt instructions but whenever I try to run terraria, it doesn't start and shows this.
View attachment 117368

I have downloaded the GOG 1.3.1 version of terraria previously. I wanted to install the Thorium mod but it requires the tModLoader first. Any advice? Thanks.
[doublepost=1465738376,1465738148][/doublepost]
Sorry bout that but I can't seem to find any tutorial on installing the tModLoader for GOG version in youtube.

Thats here what Blue said
The GOG version for Windows has now been released for v0.8.1.2! Huge thanks to @Jeckel for making the GOG version possible!

In order to make sure only people who have purchased Terraria can play tModLoader, the installation process for the GOG version is the same as when tModLoader was first released. You will need to put your exe files in a Vanilla folder, then run the Patch.bat file in order to create your tModLoader exe files.
 
It still won't work. I tried redownloading the tModLoader but got the same results. It produces a terraria.exe and a tModLoaderServer.exe but still says its not a valid win32 application.
 
It still won't work. I tried redownloading the tModLoader but got the same results. It produces a terraria.exe and a tModLoaderServer.exe but still says its not a valid win32 application.
I dont know what to do too,sry thats was the only thing i found
 
You could try checking if ai[0] is 1 and then multiplying it' velocity by something bigger than 1.


Code:
 public override void AI()
        {
            if (projectile.ai[0] == 1)
            {
                projectile.velocity *= 2;
            }
        }
this makes the boomerang just not come back... what am I doing wrong?
help pls
 
Code:
 public override void AI()
        {
            if (projectile.ai[0] == 1)
            {
                projectile.velocity *= 2;
            }
        }
this makes the boomerang just not come back... what am I doing wrong?
help pls
Is that currently all the code in your AI function?
 
I made a little code that makes the armor piece log all the texture names in Main.playerDrawData. What I've noticed is that my custom armor's texture is not showing up; instead, the texture name is null. In contrast, vanilla armor and accessories have an associated texture name in Main.playerDrawData.texture.Name.
Piece of the log which shows what I mean:
Code:
Hey man! Texture name of this object is: Images/Acc_HandsOn_12
Hey man! Texture name of this object is: Images/Wings_26
Hey man! Texture name of this object is: Images/Player_4_3
Hey man! Texture name of this object is: Images/Player_4_10
Hey man! Texture name of this object is: Images/Armor_Legs_6
Hey man! Texture name of this object is: Images/Acc_Shoes_9
Hey man! Texture name of this object is:
Hey man! Texture name of this object is: Images/Acc_HandsOff_7
Hey man! Texture name of this object is: Images/Acc_Neck_3
Hey man! Texture name of this object is: Images/Player_0_0
Hey man! Texture name of this object is: Images/Player_0_1
Hey man! Texture name of this object is: Images/Player_0_2
Hey man! Texture name of this object is: Images/Armor_Head_4
Hey man! Texture name of this object is: Images/Acc_Shield_4
Hey man! Texture name of this object is:
See those two blank spots? That's where my armor piece is likely *supposed* to be (arms texture and body texture), but it isn't. Somehow, it's still being rendered on the player, though.
The big issue with this is that because the texture name isn't where it's supposed to be, you're effectively unable to do any complicated screwing around with how that layer is drawn.

This same issue occurs when equipping armor and accessories from other mods as well.
 
Last edited:
I made a little code that makes the armor piece log all the texture names in Main.playerDrawData. What I've noticed is that my custom armor's texture is not showing up; instead, the texture name is null. In contrast, vanilla armor and accessories have an associated texture name in Main.playerDrawData.texture.Name.
Piece of the log which shows what I mean:
Code:
Hey man! Texture name of this object is: Images/Acc_HandsOn_12
Hey man! Texture name of this object is: Images/Wings_26
Hey man! Texture name of this object is: Images/Player_4_3
Hey man! Texture name of this object is: Images/Player_4_10
Hey man! Texture name of this object is: Images/Armor_Legs_6
Hey man! Texture name of this object is: Images/Acc_Shoes_9
Hey man! Texture name of this object is:
Hey man! Texture name of this object is: Images/Acc_HandsOff_7
Hey man! Texture name of this object is: Images/Acc_Neck_3
Hey man! Texture name of this object is: Images/Player_0_0
Hey man! Texture name of this object is: Images/Player_0_1
Hey man! Texture name of this object is: Images/Player_0_2
Hey man! Texture name of this object is: Images/Armor_Head_4
Hey man! Texture name of this object is: Images/Acc_Shield_4
Hey man! Texture name of this object is:
See those two blank spots? That's where my armor piece is likely *supposed* to be (arms texture and body texture), but it isn't. Somehow, it's still being rendered on the player, though.
The big issue with this is that because the texture name isn't where it's supposed to be, you're effectively unable to do any complicated screwing around with how that layer is drawn.

This same issue occurs when equipping armor and accessories from other mods as well.
Hmm, that's strange, since I can see how modded texture names should show up.
Could you try taking a different route? Try debugging:
Code:
Main.itemTexture[player.head].Name
Or something like that. I'm not entirely sure if the playerDrawData is to blame, but it can't hurt to try... Right?
 
I made a little code that makes the armor piece log all the texture names in Main.playerDrawData. What I've noticed is that my custom armor's texture is not showing up; instead, the texture name is null. In contrast, vanilla armor and accessories have an associated texture name in Main.playerDrawData.texture.Name.
Piece of the log which shows what I mean:
Code:
Hey man! Texture name of this object is: Images/Acc_HandsOn_12
Hey man! Texture name of this object is: Images/Wings_26
Hey man! Texture name of this object is: Images/Player_4_3
Hey man! Texture name of this object is: Images/Player_4_10
Hey man! Texture name of this object is: Images/Armor_Legs_6
Hey man! Texture name of this object is: Images/Acc_Shoes_9
Hey man! Texture name of this object is:
Hey man! Texture name of this object is: Images/Acc_HandsOff_7
Hey man! Texture name of this object is: Images/Acc_Neck_3
Hey man! Texture name of this object is: Images/Player_0_0
Hey man! Texture name of this object is: Images/Player_0_1
Hey man! Texture name of this object is: Images/Player_0_2
Hey man! Texture name of this object is: Images/Armor_Head_4
Hey man! Texture name of this object is: Images/Acc_Shield_4
Hey man! Texture name of this object is:
See those two blank spots? That's where my armor piece is likely *supposed* to be (arms texture and body texture), but it isn't. Somehow, it's still being rendered on the player, though.
The big issue with this is that because the texture name isn't where it's supposed to be, you're effectively unable to do any complicated screwing around with how that layer is drawn.

This same issue occurs when equipping armor and accessories from other mods as well.
Hm, that's probably because textures from mods are created from streams, since they can't be loaded in by the content manager. I suppose in the next update I could try to manually assign their Name property. In the meantime you could check for reference equality with mod.GetTexture.
 
Hm, that's probably because textures from mods are created from streams, since they can't be loaded in by the content manager. I suppose in the next update I could try to manually assign their Name property. In the meantime you could check for reference equality with mod.GetTexture.
I'm getting confused here. How am I supposed to compare a Terraria.DataStructures.DrawData.texture object with a mod.GetTexture object? I'm trying to find armor textures, so would I be using mod.GetEquipTexture instead? How would this account for multiple textures e.g. arms?

EDIT: According to the documentation, I'm supposed to do mod.GetTexture("MyMod/items/armor/MyArmorTexture") to get the texture object, then I can compare it with the Terraria.DataStructures.DrawData.texture with .Equals? Or can I just use the normal operator (==)?
 
Last edited:
Allright, so I've got the following problem:
I've got a tile of which I'm getting the top-left coordinates, to access the some data belonging to that tile (kind of how chests are accessed).
Now my problem is that I want to animate the tile based on some of the values of the data. Problem is that in the AnimateTile function of the ModTile, there are no coordinate parameters, so I'm kind of at a loss.
 
Back
Top Bottom