Sleepy_bøi
Terrarian
oh ok thanksThat's a debugging text screen toggled either with F7 or F8. You can turn it off with the same button.
oh ok thanksThat's a debugging text screen toggled either with F7 or F8. You can turn it off with the same button.
it may be because your cpu is 2.20 ghz, im not sure because mine is 2.59 ghz, but can go up to 3 ghz, i know terraria is a cpu intensive game which is why i was thinking it could be the cpuSo I've already got an idea of what my issue is from other sources but I wanted to post here and get other people's opinions. So tmodloader runs just fine and smooth and max graphics. When I tried installing the 64 bit version and tried playing the game, even with 0 mods installed my fps dropped to 30-45FPS on the lowest graphics setting. These are my PC's specs, anyone know what the issue may be?
Intel i7-8750H CPU @ 2.20GHz
16GB Ram
64 bit OS Windows 10
GeForce® GTX 1070 with 8GB GDDR5
So I've already got an idea of what my issue is from other sources but I wanted to post here and get other people's opinions. So tmodloader runs just fine and smooth and max graphics. When I tried installing the 64 bit version and tried playing the game, even with 0 mods installed my fps dropped to 30-45FPS on the lowest graphics setting. These are my PC's specs, anyone know what the issue may be?
Intel i7-8750H CPU @ 2.20GHz
16GB Ram
64 bit OS Windows 10
GeForce® GTX 1070 with 8GB GDDR5
Have we heard anything about the update yet?
tModLoader has been updated several times since the 1.4 update. You can find it by searching Steam for tModLoader.How do you download the mod
Pretty sure they were asking about the status of the 1.4 update for tModLoader itself.tModLoader has been updated several times since the 1.4 update.
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader.IO;
using Terraria.UI;
using Terraria.Utilities;
using NewJourney.Tiles;
using Terraria;
using Terraria.ModLoader;
using static Terraria.ModLoader.ModContent;
using NewJourney.Projectiles;
namespace NewJourney.NPCs
{
public class StuffedSlime : ModNPC
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Stuffed Slime");
}
public override void SetDefaults()
{
npc.width = 20;
npc.height = 20;
npc.damage = 6;
npc.defense = 4;
npc.lifeMax = 60;
npc.HitSound = SoundID.NPCHit1;
npc.DeathSound = SoundID.NPCDeath1;
npc.value = 50f;
npc.knockBackResist = 1f;
npc.noGravity = false;
npc.scale = 1f;
npc.aiStyle = -1;
npc.buffImmune[20] = true;
npc.buffImmune[24] = true;
Main.npcFrameCount[npc.type] = 2;
animationType = 535;
}
public override float SpawnChance(NPCSpawnInfo spawnInfo)
{
if (spawnInfo.player.ZoneOverworldHeight && Main.dayTime)
return SpawnCondition.OverworldDaySlime.Chance * 0.1f;
return SpawnCondition.OverworldNight.Chance * 0.05f;
}
public override void NPCLoot()
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 23, Main.rand.Next(1, 20));
}
private const int AI_State_Slot = 0;
private const int AI_Timer_Slot = 1;
private const int AI_Shoot_Time_Slot = 2;
private const int State_Asleep = 0;
private const int State_Slime = 1;
private const int State_ShootSlime = 2;
public float AI_State {
get => npc.ai[AI_State_Slot];
set => npc.ai[AI_State_Slot] = value;
}
public float AI_Timer {
get => npc.ai[AI_Timer_Slot];
set => npc.ai[AI_Timer_Slot] = value;
}
public float AI_ShootTime {
get => npc.ai[AI_Shoot_Time_Slot];
set => npc.ai[AI_Shoot_Time_Slot] = value;
}
public override void AI()
{
if (AI_State == State_Asleep) {
npc.TargetClosest(true);
if (npc.HasValidTarget && Main.player[npc.target].Distance(npc.Center) < 500f) {
AI_State = State_Slime;
AI_Timer = 0;
Main.PlaySound(SoundID.NPCHit1, npc.position);
}
}
else if (AI_State == State_Slime) {
if (Main.player[npc.target].Distance(npc.Center) < 750f) {
AI_Timer++;
if (AI_Timer == 1) {
npc.TargetClosest(true);
npc.velocity = new Vector2(npc.direction * 2, -2f);
}
else if (AI_Timer >= 360) {
Vector2 velocity = player.Center - npc.Center;
float magnitude = Magnitude(velocity);
int type = 468;
if (magnitude > 0)
{
velocity *= 18 / magnitude;
}
else
{
velocity = new Vector2(0f, 5f);
}
Projectile.NewProjectile((int)npc.position.X, (int)npc.position.Y, 0, -1, mod.ProjectileType("SlimeBall"), 30, 3f, Main.myPlayer, 1, 8);
Projectile.NewProjectile((int)npc.position.X, (int)npc.position.Y, 0, -1, 605, 30, 3f, Main.myPlayer, 4, 4);
AI_State = State_ShootSlime;
AI_Timer = 0;
Main.PlaySound(SoundID.NPCHit1, npc.position);
}
}
}
else if (AI_State == State_ShootSlime) {
npc.aiStyle = -1;
AI_Timer += 1;
if (AI_Timer == 1 && Main.netMode != NetmodeID.MultiplayerClient) {
AI_ShootTime = Main.rand.NextBool() ? 150 : 200;
npc.netUpdate = true;
Vector2 velocity = player.Center - npc.Center;
float magnitude = Magnitude(velocity);
int type = 468;
if (magnitude > 0)
{
velocity *= 18 / magnitude;
}
else
{
velocity = new Vector2(0f, 5f);
}
Projectile.NewProjectile((int)npc.position.X, (int)npc.position.Y, 0, -1, mod.ProjectileType("SlimeBall"), 30, 3f, Main.myPlayer, 1, 8);
Projectile.NewProjectile((int)npc.position.X, (int)npc.position.Y, 0, -1, 605, 30, 3f, Main.myPlayer, 4, 4);
}
if (AI_Timer > AI_ShootTime) {
AI_State = State_Slime;
AI_Timer = 0;
Main.PlaySound(SoundID.NPCHit1, npc.position);
}
}
}
private const int Frame_Slime_1 = 0;
private const int Frame_Slime_2 = 1;
public override void FindFrame(int frameHeight) {
npc.spriteDirection = npc.direction;
npc.frameCounter++;
if (npc.frameCounter < 10) {
npc.frame.Y = Frame_Slime_1 * frameHeight;
}
else if (npc.frameCounter < 20) {
npc.frame.Y = Frame_Slime_2 * frameHeight;
}
else {
npc.frameCounter = 0;
}
}
}
}
What about on a mobile device?
Looking through your code, you have several different references to player. Main.player[npc.target] and player.Center. Main.player[npc.target] is a reference to a specific player in the player array, but player.Center has nothing before it to say which player is being targeted. I don't know exactly what all of your code is for, but you may want to use Main.player[npc.target].Center.This issue has been getting annoying. Error CS0103: The name 'player' does not exist in the current context. Like, how?
Apparently, the code doesn't like it when I replace 'player' with 'Player', because it gives me another error. Error CS0120: An object reference was required for the non-static field, method, or property, 'Entity.Center'C:using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.IO; using System.Linq; using System.Linq.Expressions; using System.Reflection; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader.IO; using Terraria.UI; using Terraria.Utilities; using NewJourney.Tiles; using Terraria; using Terraria.ModLoader; using static Terraria.ModLoader.ModContent; using NewJourney.Projectiles; namespace NewJourney.NPCs { public class StuffedSlime : ModNPC { public override void SetStaticDefaults() { DisplayName.SetDefault("Stuffed Slime"); } public override void SetDefaults() { npc.width = 20; npc.height = 20; npc.damage = 6; npc.defense = 4; npc.lifeMax = 60; npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; npc.value = 50f; npc.knockBackResist = 1f; npc.noGravity = false; npc.scale = 1f; npc.aiStyle = -1; npc.buffImmune[20] = true; npc.buffImmune[24] = true; Main.npcFrameCount[npc.type] = 2; animationType = 535; } public override float SpawnChance(NPCSpawnInfo spawnInfo) { if (spawnInfo.player.ZoneOverworldHeight && Main.dayTime) return SpawnCondition.OverworldDaySlime.Chance * 0.1f; return SpawnCondition.OverworldNight.Chance * 0.05f; } public override void NPCLoot() { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 23, Main.rand.Next(1, 20)); } private const int AI_State_Slot = 0; private const int AI_Timer_Slot = 1; private const int AI_Shoot_Time_Slot = 2; private const int State_Asleep = 0; private const int State_Slime = 1; private const int State_ShootSlime = 2; public float AI_State { get => npc.ai[AI_State_Slot]; set => npc.ai[AI_State_Slot] = value; } public float AI_Timer { get => npc.ai[AI_Timer_Slot]; set => npc.ai[AI_Timer_Slot] = value; } public float AI_ShootTime { get => npc.ai[AI_Shoot_Time_Slot]; set => npc.ai[AI_Shoot_Time_Slot] = value; } public override void AI() { if (AI_State == State_Asleep) { npc.TargetClosest(true); if (npc.HasValidTarget && Main.player[npc.target].Distance(npc.Center) < 500f) { AI_State = State_Slime; AI_Timer = 0; Main.PlaySound(SoundID.NPCHit1, npc.position); } } else if (AI_State == State_Slime) { if (Main.player[npc.target].Distance(npc.Center) < 750f) { AI_Timer++; if (AI_Timer == 1) { npc.TargetClosest(true); npc.velocity = new Vector2(npc.direction * 2, -2f); } else if (AI_Timer >= 360) { Vector2 velocity = player.Center - npc.Center; float magnitude = Magnitude(velocity); int type = 468; if (magnitude > 0) { velocity *= 18 / magnitude; } else { velocity = new Vector2(0f, 5f); } Projectile.NewProjectile((int)npc.position.X, (int)npc.position.Y, 0, -1, mod.ProjectileType("SlimeBall"), 30, 3f, Main.myPlayer, 1, 8); Projectile.NewProjectile((int)npc.position.X, (int)npc.position.Y, 0, -1, 605, 30, 3f, Main.myPlayer, 4, 4); AI_State = State_ShootSlime; AI_Timer = 0; Main.PlaySound(SoundID.NPCHit1, npc.position); } } } else if (AI_State == State_ShootSlime) { npc.aiStyle = -1; AI_Timer += 1; if (AI_Timer == 1 && Main.netMode != NetmodeID.MultiplayerClient) { AI_ShootTime = Main.rand.NextBool() ? 150 : 200; npc.netUpdate = true; Vector2 velocity = player.Center - npc.Center; float magnitude = Magnitude(velocity); int type = 468; if (magnitude > 0) { velocity *= 18 / magnitude; } else { velocity = new Vector2(0f, 5f); } Projectile.NewProjectile((int)npc.position.X, (int)npc.position.Y, 0, -1, mod.ProjectileType("SlimeBall"), 30, 3f, Main.myPlayer, 1, 8); Projectile.NewProjectile((int)npc.position.X, (int)npc.position.Y, 0, -1, 605, 30, 3f, Main.myPlayer, 4, 4); } if (AI_Timer > AI_ShootTime) { AI_State = State_Slime; AI_Timer = 0; Main.PlaySound(SoundID.NPCHit1, npc.position); } } } private const int Frame_Slime_1 = 0; private const int Frame_Slime_2 = 1; public override void FindFrame(int frameHeight) { npc.spriteDirection = npc.direction; npc.frameCounter++; if (npc.frameCounter < 10) { npc.frame.Y = Frame_Slime_1 * frameHeight; } else if (npc.frameCounter < 20) { npc.frame.Y = Frame_Slime_2 * frameHeight; } else { npc.frameCounter = 0; } } } }
And just in case you are asking: Yes, I have had this issue a few times before.
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using static Terraria.ModLoader.ModContent;
namespace NewJourney.Items.Placeable
{
public class Watermelon : ModItem
{
public override void SetStaticDefaults()
{
ItemID.Sets.SortingPriorityMaterials[item.type] = 58;
DisplayName.SetDefault("Watermelon");
Tooltip.SetDefault("");
}
public override void SetDefaults()
{
item.useStyle = ItemUseStyleID.SwingThrow;
item.useTurn = true;
item.useAnimation = 15;
item.useTime = 10;
item.autoReuse = true;
item.maxStack = 999;
item.consumable = true;
item.width = 12;
item.height = 12;
item.value = 3000;
item.rare = 1;
if (Main.rand.NextBool(4)) {
item.createTile = TileType<Tiles.WatermelonTile1>();
}
else if (Main.rand.NextBool(4)) {
item.createTile = TileType<Tiles.WatermelonTile2>();
}
else if (Main.rand.NextBool(4)) {
item.createTile = TileType<Tiles.WatermelonTile3>();
}
else if (Main.rand.NextBool(4)) {
item.createTile = TileType<Tiles.WatermelonTile4>();
}
}
}
}
It never said that it was updated to 1.4. Please re-read what it said.I checked the github for new releases and it says tmodloader has been updated for 1.4 on steam, but when I launch tmodloader on steam it says 1.3.5.3. Any reason why?
I checked the github for new releases and it says tmodloader has been updated for 1.4 on steam, but when I launch tmodloader on steam it says 1.3.5.3. Any reason why?