Hi I was trying to add a Hotkey suposed to switch the animation of the weapon this is my code.
Code:
using Terraria.ModLoader;
namespace ModName
{
public class ModName : Mod
{
public static int state=0;
internal static ModHotKey Hotkey;
public ModName()
{
}
public override void Load()
{
Hotkey = RegisterHotKey("Change weapon mode", "");
}
public override void Unload()
{
Hotkey = null;
}
}
}
C#:
using Microsoft.Xna.Framework;
using System;
using System.Collections.Generic;
using System.Reflection;
using Terraria;
using Terraria.Audio;
using Terraria.GameInput;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
using Terraria.UI;
namespace ModName
{
public class Player : ModPlayer {
public override void ProcessTriggers(TriggersSet triggersSet)
{
if (ModName.Hotkey.JustPressed)
{
ModName.state = (ModName.state + 1) % 3;
}
}
}
}
C#:
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace ModName.Items
{
public class Weapon : ModItem
{
public override void SetStaticDefaults()
{
Tooltip.SetDefault("Weapon");
}
public override void SetDefaults()
{
item.damage = 10;
item.melee = true;
item.width = 80;
item.height = 80;
item.useTime = 20;
item.useAnimation = 20;
item.useStyle = 5;
item.knockBack = 0;
item.value = 10000;
item.rare = 2;
item.UseSound = SoundID.Item1;
item.autoReuse = true;
item.shootSpeed = 4.5f;
}
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
if (ModName.state == 0)
{
item.useStyle = 1;
}else{
item.useStyle = 20;
}
return true;
}
}
}
If I build my mod and start to play it I get following error twice.
Object reference not set to an instance of object (see Client.log for full trace).
Also I can't move or do anything. But I don't know weather this is because of that.
Used the "Remove Forced Minimum Zoom" option because the cursor didn't align with the visible cursor (eg. the visible cursor wasn't on top of an option yet I would get small pop up that indicated that I was on top of it) now I can't bring the cursor to the top of the screen, Steam backups my options so uninstalling doesn't work it also messes with my monitor and makes it think there no input.
I've been making a custom set of wings, but can't figure out how to change the number of frames in the animation. For example, Jim's Wings have 6 animation frames, but if I copy the texture over and use AutoLoadEquip, the texture is still divided into four frames, causing less than ideal results. How do I increase the frame count of modded wings?
I recently had a problem on opening terraria when i add tmodloader to it. The logs said something about horse banner 0. And it just says file not found
The version of tModLoader on steam is 32 bit. You can still download and install the 64bit version as usual, just using the new tModLoader installation instead of your Terraria installation.
The version of tModLoader on steam is 32 bit. You can still download and install the 64bit version as usual, just using the new tModLoader installation instead of your Terraria installation.
If you have never specifically downloaded the 64bit version you have always been using the default 32bit version. It just never told you about the ram limits until now to help with mods loaded. Since they are getting larger and larger, having multiple ones on can exceed memory capacity of the normal 32bit terraria.
Hi! I really wanted to play some modded terraria so I was really excited that steam got tModloader easy to download as DLC but problem is I cant download any mod via Mod Browser, I can play predownloaded mods but there are some tiny mods that seem to be exclusive to Browser.
Im playing on linux via steam natively (no proton)
When I click download mod the bar appears but goes away after a second or two.
Also when 1.4 rolls will it still be possible to use older version till mods update?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.