Standalone [1.3] tModLoader - A Modding API

Ahh okay :)
[DOUBLEPOST=1439067033,1439066979][/DOUBLEPOST]Can u make items have like a 1in 1000 drop rate ?
[DOUBLEPOST=1439067055][/DOUBLEPOST]or like a 000.1% chance to drop ?
[DOUBLEPOST=1439067166][/DOUBLEPOST]And how to make a sword like as big breaker blade
 
When I first went to try this out, everything worked perfectly. Examplemod worked, and I was able to edit the Examplesword to do more damage and be made from dirt blocks, so that's cool. Then I tried editing examplesword again. I changed the image (it had the same name as before so it should have worked) to look like a banana, because who doesn't want to hit things with a banana? I went to reload the mod, and everything looked normal. I clicked single player, played the game, and tried to use my 10 dirt blocks to craft my banana. I was so excited for my banana. Then my banana didn't show up in the crafting menu. Then I realized there was nothing from examplemod in the crafting menu. I tried uninstalling terraria and doing it all again, but that only made it so I can't see anything in the mod sources folder. Then I tried to download a new version of examplemod, and that didn't work. I checked, and everything is in place and should work fine, but nothing works. I'm so lost XD any help would be appreciated!
 
Ahh okay :)
[DOUBLEPOST=1439067033,1439066979][/DOUBLEPOST]Can u make items have like a 1in 1000 drop rate ?
[DOUBLEPOST=1439067055][/DOUBLEPOST]or like a 000.1% chance to drop ?
[DOUBLEPOST=1439067166][/DOUBLEPOST]And how to make a sword like as big breaker blade
You can make items have low drop rates by using Main.rand.Next(/*insert huge number here*/).

You can make a sword huge by making the item's width, height, and scale large.

When I first went to try this out, everything worked perfectly. Examplemod worked, and I was able to edit the Examplesword to do more damage and be made from dirt blocks, so that's cool. Then I tried editing examplesword again. I changed the image (it had the same name as before so it should have worked) to look like a banana, because who doesn't want to hit things with a banana? I went to reload the mod, and everything looked normal. I clicked single player, played the game, and tried to use my 10 dirt blocks to craft my banana. I was so excited for my banana. Then my banana didn't show up in the crafting menu. Then I realized there was nothing from examplemod in the crafting menu. I tried uninstalling terraria and doing it all again, but that only made it so I can't see anything in the mod sources folder. Then I tried to download a new version of examplemod, and that didn't work. I checked, and everything is in place and should work fine, but nothing works. I'm so lost XD any help would be appreciated!
Huh, so to summarize, you reinstalled tModLoader, tModLoader runs properly, the ExampleMod isn't working for you, and you have the ExampleMod folder inside the Mod Sources folder?
 
Yeah, basically. No mods are working for me. The only thing that changed in ExampleMod before it stopped working was the image for ExampleSword. Then every mod just stopped working altogether, even after reinstalling them. My friend uses tmodloader too, and all files are exactly the same. It works for him.
 
Yeah, basically. No mods are working for me. The only thing that changed in ExampleMod before it stopped working was the image for ExampleSword. Then every mod just stopped working altogether, even after reinstalling them. My friend uses tmodloader too, and all files are exactly the same. It works for him.
That's really weird. So a clean ExampleMod doesn't work even when you rebuild it, and it doesn't work only for you? It's hard to tell what's happening here. At this point, I would try playing with the enabled files in the mod folder to see if disabling the example mod helps anything.
 
No, that didn't work. Even with example mod disabled and everything else as it should be with a mod my friend made and tested, nothing works. I really appreciate your help! I guess I'll try to get my friend to test the mods I make.
 
No, that didn't work. Even with example mod disabled and everything else as it should be with a mod my friend made and tested, nothing works. I really appreciate your help! I guess I'll try to get my friend to test the mods I make.
Do you get any errors, and if so; where and when? If Terraria crashes, go to your ModLoader/Mods folder and remove all files in there. Then rebuild the mod(s). Also might want to check ModLoader/Logs and check all the log files there. If your mod is building w/o issues, make sure it's enabled and then it 'should' work. You also made sure to put your world files into ModLoader/Worlds and player files into ModLoader/Players ?
 
I get no errors, Terraria doesn't crash, for some reason I don't see any log files, and yes I put my world files into modloader/worlds and player files into modloader/players. Am I supposed to see log files?
Do you get any errors, and if so; where and when? If Terraria crashes, go to your ModLoader/Mods folder and remove all files in there. Then rebuild the mod(s). Also might want to check ModLoader/Logs and check all the log files there. If your mod is building w/o issues, make sure it's enabled and then it 'should' work. You also made sure to put your world files into ModLoader/Worlds and player files into ModLoader/Players ?
 
Quick question, what is the tile ID for the workbench and the anvil? I tried to use "recipe.AddTile(TileID.IronAnvil)" to add an required tile for a recipe, but does not work and gives an error saying that that tile does not exist. This seems to happen with tiles with an alternate skin/style (i.e. Table) and using tiles that have no alternate skins, such as stone, works.
 
Quick question, what is the tile ID for the workbench and the anvil? I tried to use "recipe.AddTile(TileID.IronAnvil)" to add an required tile for a recipe, but does not work and gives an error saying that that tile does not exist. This seems to happen with tiles with an alternate skin/style (i.e. Table) and using tiles that have no alternate skins, such as stone, works.
I believe for Anvil it's Anvils and with Work Bench it's WorkBenches
 
Quick question, what is the tile ID for the workbench and the anvil? I tried to use "recipe.AddTile(TileID.IronAnvil)" to add an required tile for a recipe, but does not work and gives an error saying that that tile does not exist. This seems to happen with tiles with an alternate skin/style (i.e. Table) and using tiles that have no alternate skins, such as stone, works.

Iron/Lead Anvil = 16
Work Bench = 18
If you dont have the terraria source code, you can look the IDs in the official wiki.
 
I have a problem, here
o0sfbBx

followed the instructions, i cannot use the tmodloader
1.3.0.7
 
Hey @bluemagic123 is it possible to make an item that can change the time of the day ?
Please Help :)
Thanks In Advance :D
Hm, it's starting to get too time-consuming to reply to all of this...

If you want to do things like that, I'd recommend trying to get familiar with the source code; I got to where I am now by searching through the source code and putting all the puzzle pieces together in my head just so that I could add features I wanted to in my tAPI mod. Right now, I'll give the following hints: 1. yes, it is possible, 2. many miscellaneous things are stored in the Main class, and 3. the things you're looking for probably have "time" in their name.
 
Hey @bluemagic123 is it possible to make an item that can change the time of the day ?
Please Help :)
Thanks In Advance :D

Yes! You can :) I've done this myself. What I'd do is make a consumable item, and add the following to the method when the item is consumed.

First, of all. dayTime yes/no?
Code:
dayTime     bool     Returns true if it's daytime, false if it's nighttime. (Terraria v. 1.1.2)
Now, when exactly is it daytime or nighttime? Well..
Code:
time     double   

Used in conjuction with Main.dayTime to determine time of day. (Terraria v. 1.1.2)

If Main.dayTime == true, Main.time goes from 0.0 (dawn) to 54000.0 (nightfall) and resets.

If Main.dayTime == false, Main.time goes from 0.0 (nightfall) to 32400.0 (dawn) and resets. 16200.0 (midnight) is in the middle.

So for example, you could do:
Code:
Main.dayTime = false;
Main.time = 16200.0;

This should set the world's time at midnight.
Taken from: http://tconfig.wikia.com/wiki/Main_Class
 
Back
Top Bottom