LimeLi0n101
Plantera
Great. Thanks I was worrying
The reason this will not work is because the game only loads NPC textures once NPCs are actually spawned in the game, if the textures have not been loaded yet - as Shockah mentioned.Another quick question shockah: I have created a MBase file that changes textures of default stuff, however at first when I log in npcs don't have the new texture. Reloading mods and returning to the world fixes this, however may be considered inconvenient for some. Is there any reason as to why this would be happening?
MBase.cs
Is OnLoad not sufficient for what I want?Code:using System; using System.Collections.Generic; using System.Text; using System.Diagnostics; using TAPI; using Terraria; using jLib; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; namespace jMod { public sealed class MBase : ModBase { internal static MBase BaseInstance; public override void OnLoad() { BaseInstance = this; DateTime now = DateTime.Now; int day = now.Day; int month = now.Month; if (day == 20 && month == 10) { Main.npcTexture[5] = Main.goreTexture[GoreDef.gores["jMod:Stuff"]]; Main.npcTexture[6] = Main.goreTexture[GoreDef.gores["jMod:Stuff2"]]; } } } }
Sorry yorai, what do you mean by key/where would I put said key?The reason this will not work is because the game only loads NPC textures once NPCs are actually spawned in the game, if the textures have not been loaded yet - as Shockah mentioned.
What you need to do is set Main.NPCLoaded[type] = true; and make sure Main.npcTexture[type] has a key (specifically via setting it)
(If the npcTexture was not set but you set NPCLoaded to true you'd get a key not found exception in FindFrame because it will look for a texture key that it doesnt have)
rename terraria.bak to terraria.exe and then open through steamWhen i open terraria.bak it says open the game from your game client.
Right.. sorry , forgot that happens because of Steam's check.When i open terraria.bak it says open the game from your game client.
Key is how you refer the indexer of a Dictionary object. (the part in the square brackets)Sorry yorai, what do you mean by key/where would I put said key?
You probably don't have windows set to display file extensions. I'm merely assuming that since you said you try to launch Terraria.bak rather than Terraria.bak.exe.when i launch terraria.bak it says please launch the game from your steam client. Also i don't have a terraria.exe file. Am I missing something important?
Oh man I feel stupid, thanks so much. I feel as though you deserve to see what I was using that for, I'll send a PMRight.. sorry , forgot that happens because of Steam's check.
You're going to have to rename the file to Terraria.exe or get Eikester's game launcher for convenience.
Key is how you refer the indexer of a Dictionary object. (the part in the square brackets)
Main.npcTexture is a dictionary, while Main.NPCLoaded is an array.
What you did to the textures in the code you posted (setting textures of key 5 and 6) was fine, and you just need to add Main.NPCLoaded[5] = true; and Main.NPCLoaded[6] = true; in that same area of code.
You probably don't have windows set to display file extensions. I'm merely assuming that since you said you try to launch Terraria.bak rather than Terraria.bak.exe.
The files still have '.exe' on them , you just need to rename your "Terraria.bak" to "Terraria" in this case... (and rename "Terraria" to "tAPI" or whatever)
Lunar music does not exist in actual game... yet.How to change my boss music? For example I want it to be Lunar Music. Tnx
just a small thing i noticed:
"version": [0,1,0,0] doesn't work, only "version": "some.version" works, gives errorCode:Key "version" is missing or is not a String!
removed*.i'm refering to the docs http://tapi.axxim.net/docs/ and according to that its either a string ("0.1") or an int array ([0,0,0,0]) so its either removed or a Bug
Okay, but how to change the music of boss?Lunar music does not exist in actual game... yet.
Looking into it for r12.A major glitch happened in tAPI; I opened the crafting window and right-clicked a torch, and it took one out of the crafting interface as if I took it from a chest
Now crafting torches gives me nothing, and the pick-up text says "Vanilla: ".
Is there any way to undo this? Placing the torches back in the crafting window does not work
I tested this with all my characters on all worlds, apparently stealing from the crafting window has a global effect
EDIT: I fixed it by reinstalling tAPI. But I find that this bug may become annoying to those who use the crafting window.