Eldrazi
Eater of Worlds
They're both the same ID (the name is a bit confusing ).So I've noticed that only the Mythril Anvil is refrenecable in TileID, is there a way to reference the Orichalcum anvil?
They're both the same ID (the name is a bit confusing ).So I've noticed that only the Mythril Anvil is refrenecable in TileID, is there a way to reference the Orichalcum anvil?
I think they are the same. Like how anvils is general term for all anvilsSo I've noticed that only the Mythril Anvil is refrenecable in TileID, is there a way to reference the Orichalcum anvil?
So I've noticed that only the Mythril Anvil is refrenecable in TileID, is there a way to reference the Orichalcum anvil?
So, to give them different IDs, would one need to override the vanilla anvil func?They're both the same ID (the name is a bit confusing ).
Yeah, you can either just paste the new tModLoader files or run the installer jar file.How do you automatically update tModLoader? Or do you just paste the tModLoader files everytime you want to update it?
That should be a safe thing to do. The save file locations are referenced to in the actual code of the exe, so nothing will go wrong there. I actually did this back in the tAPI days, and the only bad thing that happened was that my hours playing tAPI weren't recorded by Steam.Small question! I'd like to use both Tmodloader and vanilla Terraria, so I did a small thing. I had to manually install Tmod copying the content of the folder into my terraria steam folder, and I managed to keep both Tmod "terraria.exe" and vanilla.exe by changing the former's name into Tmod.exe. For now it SEEMS that the system works, with my Steam launching vanilla Terraria when I need to do stuff there, and the tmod.exe launching tmod when I want to play a modded version of the game. My doubt is: Is this a safe thing to do? Will I have problem doing this, or there's the risk of walking into weird save shenanigans?
Haang on, haaaaaang on...So, to give them different IDs, would one need to override the vanilla anvil func?
I don't know why you'd want to do that in modPlayer, but I did something similar for a projectile of my own. Essentially what you need to do is iterate through all NPC's in the world, check the distance from each NPC to your desired position and use the shortest one. Here's the function that I used, though you may need to modify it.Using modplayer, I am trying to get projectiles to randomly fire at the closest npc to you. What would I use to define the closest npc?
public NPC FindNearest(Vector2 pos)
{
//Vector2 wLocation = new Vector2(x, y); //get the location of Whip
NPC nearest = null;
float oldDist = 1001;
float newDist = 1000;
for (int i = 0; i < Terraria.Main.npc.Length; i++) //Do once for each NPC in the world
{
//if (ignoreList.Contains(Terraria.Main.npc[i].whoAmI))
if (Terraria.Main.npc[i].friendly == true)//Don't target town NPCs
continue;
if (Terraria.Main.npc[i].active == false)//Don't target dead NPCs
continue;
if (Terraria.Main.npc[i].damage == 0)//Don't target non-aggressive NPCs
continue;
if (nearest == null) //if no NPCs have made it past the previous few checks
nearest = Terraria.Main.npc[i]; //become the nearest NPC
else
{
oldDist = Vector2.Distance(pos, nearest.position);//Check the distance to the nearest NPC that's earlier in the loop
newDist = Vector2.Distance(pos, Terraria.Main.npc[i].position);//Check the distance to the current NPC in the loop
if (newDist < oldDist)//If closer than the previous NPC in the loop
nearest = Terraria.Main.npc[i];//Become the nearest NPC
}
}
return nearest; //return the npc that is nearest to the vector 'pos'
}
Well, for crafting purposes! For example, I want item A to be accessible only in worlds with Mythril, and item B - in worlds with orichalcum. I don't know why that guy would want to do that, but *I* think it's actually a good way to balance some stuff. Because, you know, second set of HM ores is OP, unlike the first one. So yeah, balance.Haang on, haaaaaang on...
Why would you want to give the vanilla tiles a different ID exactly?
I don't want to spoil your fun, but I'd advice you not to loop through the NPCs using Main.npc.Length. Reason being that the last index of that array is a faulty NPC (when something is not right when spawning/setting the defaults of the NPC). You'll basically want to avoid using the last index of that array, so Main.npc.Lenght - 1 would work (although it's really not that pretty ).I don't know why you'd want to do that in modPlayer, but I did something similar for a projectile of my own. Essentially what you need to do is iterate through all NPC's in the world, check the distance from each NPC to your desired position and use the shortest one. Here's the function that I used, though you may need to modify it.
All you need to do is give this function the center of your player as a vector (which it is already) and it will return a reference to the NPC that is nearest to you. Be warned: if there are no NPC's in existence, this will return null, so you will need to check for that and skip any code that uses the npc.Code:public NPC FindNearest(Vector2 pos) { //Vector2 wLocation = new Vector2(x, y); //get the location of Whip NPC nearest = null; float oldDist = 1001; float newDist = 1000; for (int i = 0; i < Terraria.Main.npc.Length; i++) //Do once for each NPC in the world { //if (ignoreList.Contains(Terraria.Main.npc[i].whoAmI)) if (Terraria.Main.npc[i].friendly == true)//Don't target town NPCs continue; if (Terraria.Main.npc[i].active == false)//Don't target dead NPCs continue; if (Terraria.Main.npc[i].damage == 0)//Don't target non-aggressive NPCs continue; if (nearest == null) //if no NPCs have made it past the previous few checks nearest = Terraria.Main.npc[i]; //become the nearest NPC else { oldDist = Vector2.Distance(pos, nearest.position);//Check the distance to the nearest NPC that's earlier in the loop newDist = Vector2.Distance(pos, Terraria.Main.npc[i].position);//Check the distance to the current NPC in the loop if (newDist < oldDist)//If closer than the previous NPC in the loop nearest = Terraria.Main.npc[i];//Become the nearest NPC } } return nearest; //return the npc that is nearest to the vector 'pos' }
Hmmm, that's... Allright... Well I guess you'll want to make changes using GlobalTile, then (and possibly make the Orichalcum anvil uncraftable, so you can program it yourself). Hmmmm...Well, for crafting purposes! For example, I want item A to be accessible only in worlds with Mythril, and item B - in worlds with orichalcum. I don't know why that guy would want to do that, but *I* think it's actually a good way to balance some stuff. Because, you know, second set of HM ores is OP, unlike the first one. So yeah, balance.
u do know the vanilla can be run fine from the extra terraria.exe the tmodloader makes on installing so u dont need to do this just install normal and both can be used just the one on steam will be modded and vanilla is in the steam filesSmall question! I'd like to use both Tmodloader and vanilla Terraria, so I did a small thing. I had to manually install Tmod copying the content of the folder into my terraria steam folder, and I managed to keep both Tmod "terraria.exe" and vanilla.exe by changing the former's name into Tmod.exe. For now it SEEMS that the system works, with my Steam launching vanilla Terraria when I need to do stuff there, and the tmod.exe launching tmod when I want to play a modded version of the game. My doubt is: Is this a safe thing to do? Will I have problem doing this, or there's the risk of walking into weird save shenanigans?
System.DllNotFoundException: Unable to load DLL 'CSteamworks': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
at Steamworks.NativeMethods.SteamAPI_RestartAppIfNecessary(AppId_t unOwnAppID)
at Terraria.Social.Steam.CoreSocialModule.Initialize()
at Terraria.Social.SocialAPI.Initialize(Nullable`1 mode)
at Terraria.Program.LaunchGame(String[] args)
I think you missed file CSteamworks.dll in ***/common/TerrariaUhh, for a while there tModLoader was working amazingly until this happened:
Code:System.DllNotFoundException: Unable to load DLL 'CSteamworks': The specified module could not be found. (Exception from HRESULT: 0x8007007E) at Steamworks.NativeMethods.SteamAPI_RestartAppIfNecessary(AppId_t unOwnAppID) at Terraria.Social.Steam.CoreSocialModule.Initialize() at Terraria.Social.SocialAPI.Initialize(Nullable`1 mode) at Terraria.Program.LaunchGame(String[] args)
Do you know why? I've tried tMod v1.6, 1.7 and 1.7.1.1, and all do the same error. The vanilla .exe works fine though.
I think you missed file CSteamworks.dll in ***/common/Terraria