Standalone [1.3] tModLoader - A Modding API

Discussion in 'Works-in-Progress' started by blushiemagic, Jul 7, 2015.

  1. jopojelly

    jopojelly Retinazer

  2. Kobieko_Games

    Kobieko_Games Terrarian

    what do i need to do? plz help me.(this will show up if i click on mod browser)
    20181027184327_1.jpg
     
  3. ShadowTiger

    ShadowTiger Official Terrarian

    Does tModLoader crash on exit for anyone else? Sorry if it's been reported already. Quite a few posts to go through. Here's my crash log. It even happens with no mods enabled.

    Silently Caught Exception: Object reference not set to an instance of an object. at Terraria.ModLoader.IO.ItemIO.Save(Item item) at Terraria.ModLoader.ModCompile.<>c.<ActivateExceptionReporting>b__15_0(Object sender, FirstChanceExceptionEventArgs exceptionArgs)
    at Terraria.ModLoader.IO.ItemIO.Save(Item item)
    at Terraria.ModLoader.IO.PlayerIO.SaveInventory(Item[] inv)
    at Terraria.ModLoader.IO.WorldIO.SaveChests()
    at Terraria.ModLoader.IO.WorldIO.Save(String path, Boolean isCloudSave)
    at Terraria.IO.WorldFile.saveWorld(Boolean useCloudSaving, Boolean resetTime)
    at Terraria.WorldGen.saveAndPlayCallBack(Object threadContext)
    at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
    at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
    at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
    at System.Threading.ThreadPoolWorkQueue.Dispatch()
    at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

    It also crashes at random. No cause in particular.

    I should specify that this is a custom TerraCustom world I imported from Vanilla into tModLoader. I'll bet that would make a difference.
     
    Last edited: Oct 27, 2018
  4. Kobieko_Games

    Kobieko_Games Terrarian

    it does not crach for me but i just can't get to my mod browser and can't update my mods bc. of this
     
  5. 009dylan

    009dylan Skeletron Prime

    Looking to make a mod, but I'm really not the best at spriting... Anyone who can sprite I would love to talk to! I have a few ideas, but if you have a sprite and details of what you want something to do, I'd be more than happy to implament them. In the tooltip would be the name of the person who sprited the item(s) (Unless you don't want that, and for it to be anonomyous, or have a fake name/Terraria name/ whatever you really want I don't care...).
    you can ask me about this on this forum (which I'll be checking periodically), or as a conversation, or email me! My email is: [email protected]
     
  6. Kobieko_Games

    Kobieko_Games Terrarian

    I would love helping you but i can't sprite srry.
     
  7. Yvori

    Yvori Terrarian

    Hey uh... So, this is a strange error I'm getting since adding two Texture Packs to the TexturePacks folder with Experimental Features enabled.
    From my understanding (and having looked at the source code) tModLoader is supposed to support running multiple texture packs at once, yes?
    I assume this is because dictionaries probably don't accept duplicate values, and perpaps since both have an "Images" folder there's a problem?
    I've checked, and they have no matching filenames aside from that one folder. Even the zips are named differently.
    upload_2018-10-28_11-26-45.png
     
  8. 009dylan

    009dylan Skeletron Prime

    [QUOTE="I would love helping you but i can't sprite srry.[/QUOTE]
    Ok, thank you for your response! If you would like to help modding or .wav files, I'd be fine with that, or just support it as it goes!
     
  9. Glipko

    Glipko Terrarian

    Help please
    There's error:
    Parameteris not valid
    в System.Drawing.Bitmap..ctor(Stream stream)
    в Terraria.ModLoader.IO.ImageIO.ToRaw(Stream src, Stream dst)
    в Terraria.ModLoader.IO.ImageIO.ToRawBytes(Stream src)
    в Terraria.ModLoader.ModCompile.AddResource(TmodFile modFile, String relPath, String filePath)
    в Terraria.ModLoader.ModCompile.Build(BuildingMod mod, IBuildStatus status)
    в Terraria.ModLoader.ModCompile.Build(String modFolder, IBuildStatus status)
    в Terraria.ModLoader.ModLoader.<>c.<BuildMod>b__74_0(Object _)
    Here's code of item:
    using Terraria.ID;
    using Terraria.ModLoader;
    namespace TerrariaLegends.items
    {
    class BreadSword : ModItem
    {
    public override void SetDefaults()
    {
    item.melee = true;
    item.width = 50;
    item.height = 50;
    item.useTime = 24;
    item.useAnimation = 24;
    item.useStyle = 1;
    item.damage = 100;
    item.knockBack = 5;
    item.rare = 13;
    item.autoReuse = true;
    }
    public override void SetStaticDefaults()
    {
    DisplayName.SetDefault("BreadSword");
    Tooltip.SetDefault("Sword of heroes of bread town");
    }
    public override void AddRecipes()
    {
    ModRecipe mModRecipe = new ModRecipe(mod);
    mModRecipe.AddIngredient(ItemID.DirtBlock, 1);
    mModRecipe.AddTile(TileID.WorkBenches);
    mModRecipe.SetResult(this);
    mModRecipe.AddRecipe();
    }
    }
    }
     
  10. Boberskiy

    Boberskiy Skeletron Prime

    Yo guys. Do only I have probems with mods like ~ if you have a lot of mods, it crashes on *adding recipes* if it doesn't then on creating worlds. Just try to create world and it crashes
    --- Double Post Merged, Oct 29, 2018, Original Post Date: Oct 29, 2018 ---
    And now when I try to go in large world it crashes every time.
    MY PC SPECS:
    Gtx 1070
    Ryzen 5 2600
    16GB ram
     

    Attached Files:

  11. Coochie

    Coochie Terrarian

    When I try to host a server to play with friends it gets stuck on "receiving tile data: complete" and won't go farther than that so is there something I'm supposed to do to play with friends?
     
  12. Yvori

    Yvori Terrarian

    Terraria (and by extension, tModLoader), is a 32 bit program due to using Microsoft's 32 bit-only XNA framework.
    As a 32 bit program, it can only use a maximum of 4 GB of RAM, so adding enough content to push it over that limit while loading (or while playing) will cause an out of memory crash like that one. It's unavoidable in the current scheme of things, unfortunately.
    Your best bet is to remove some mods, I'm afraid.

    There is someone working on a beta for a 64 bit tModLoader, but I'm unsure how stable it is as they're still in the testing phase.
    Perhaps look them up. Their name is Draedonhunter or something if I recall. If you'd be willing to accept the risks associated with trying it, you could always try out the 64 bit beta from them and see if it works.
     
  13. Zwip-Zwap Zapony

    Zwip-Zwap Zapony Terrarian

    If you have the Regen From Bosses mod active, disable it. Apparently I somehow made version 2.0 of it completely multiplayer-incompatible while trying to make it as multiplayer-compatible as possible. (No, I do not know how to fix that, unfortunately.)
     
  14. 009dylan

    009dylan Skeletron Prime

    Take a look at Example mod's Code for a sword, and use that as a base. If you still can't figure it out, then contact me!
     
  15. WoC

    WoC Terrarian

    is it okay if i extract terraria.exe then change the tmod extracting code so that it extracts it no matter what so that i can see other mods code for easier coding ?
    PS: i am not expert at coding that's why it will take me a long time to figure out how but is it still allowed ?
     
  16. Thornstromb

    Thornstromb Terrarian

    I have a question: once, looooong ago when i first looked into modding, i received information that there is a limit to how many items/blocks/whatevers terraria can actually register, as the system used to index those things had an upper limit. I believe it was changed, but my questions are : does this limit still apply, what is it now, and is this limitation still meaningful for a modder? (google is failing me badly, but i found an implication that the new "tile limit" is "65536", which i assume to be beyond any meaningful limitation. Maybe?

    ** Also, as another part of my ongoing semi-project to rebuild Story of Red Cloud, can Plantera Bulbs be disabled? or can the spawn effect be disabled if not?
     
    Last edited: Nov 4, 2018
  17. Fabulous-Senpaii

    Fabulous-Senpaii Terrarian

    Hi when I try to play with some mods it crashes after like 10-15 mins of playing and this images shows, maybe its too many mods but Idk
     

    Attached Files:

  18. WoC

    WoC Terrarian

    be sure to have at least 8 gb of ram unlike me and tell me mods ur using
     
  19. Rcki

    Rcki Official Terrarian

    Is there a way to achieve this effect on a custom boss?
    upload_2018-11-10_13-30-0.png
     
  20. Jofairden

    Jofairden The Destroyer

    Yes, check in ExampleMod for the bullet. You can do the same for NPCs.