• For issues you find with the Switch and Console releases, please follow this link and give as much detail as possible. This is the speediest way to get info to Pipeworks and get a hotfix in the works.
  • 1.4 will bring many changes to the PC version. We strongly advise making plans to back up your worlds and players prior to updating your game. More details here.
  • Begin your search for Journey's End information here and here. Please report bugs and issues for Journey's End here.
  • For issues you find with the Mobile 1.3 update, please follow this link and give as much detail as possible. This is the speediest way to get info to DR Studios to look at your issue. Also, some troubleshooting hints here.

Standalone [1.3] tModLoader - A Modding API

wch

Terrarian
Em... there seems not to be a place where I can find all my references that easily. Form the first place this is a question about experience and knowledge which I need to learn, trying my best.
So, yeah, really happy to hear that I can ask my silly little questions without limits:)
Let me ask then.

I've made myself an AWP, and it's really a huge weapon compared to the other items in the game, hence it really looks odd - it has a 107x32 size. Fortunately I got "item.scale" to solve this problem and it looks just perfect. But item.scale only defines the size of its using texture, by which I mean the size when using. The dropping texture remains surprisingly large. And the demon altar I've made actually has the same question. How should I adjust this?
 

jopojelly

Retinazer
tModLoader
Em... there seems not to be a place where I can find all my references that easily. Form the first place this is a question about experience and knowledge which I need to learn, trying my best.
So, yeah, really happy to hear that I can ask my silly little questions without limits:)
Let me ask then.

I've made myself an AWP, and it's really a huge weapon compared to the other items in the game, hence it really looks odd - it has a 107x32 size. Fortunately I got "item.scale" to solve this problem and it looks just perfect. But item.scale only defines the size of its using texture, by which I mean the size when using. The dropping texture remains surprisingly large. And the demon altar I've made actually has the same question. How should I adjust this?
Did you try this?
https://github.com/bluemagic123/tMo...alphacolor-ref-float-rotation-ref-float-scale
I think you should be able to change scale however you like. Try .5.
 

raptor722

Terrarian
jopojelly your tile help i super usefull aill use it ty and do you know how to make projectile that i gave extraupdates visible ?
someone sais something about preAI and postAI but noone helped me with that :/
 

blushiemagic

Retinazer
tModLoader
So I add it:
Code:
        public virtual bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale)
        {
            scale = 0.5f;
        }
Seems I got some usings missing, it says it can't find "SpriteBatch".
You'll need to add "using Microsoft.Xna.Framework.Graphics;" to the top.
 

wch

Terrarian
You'll need to add "using Microsoft.Xna.Framework.Graphics;" to the top.
Oh yeah. And now my AWP's dropping texture looks fine!
Another thing... when I'm making a shield, I can set like the examplemod:
Code:
        public override bool Autoload(ref string name, ref string texture, IList<EquipType> equips)
        {
            equips.Add(EquipType.Shield);
            return true;
        }
Then I'm now making a glove, what should I fill in the EquipType?
 

jopojelly

Retinazer
tModLoader
Then I'm now making a glove, what should I fill in the EquipType?
I think this will help: https://github.com/bluemagic123/tModLoader/wiki/EquipType

jopojelly your tile help i super usefull aill use it ty and do you know how to make projectile that i gave extraupdates visible ?
someone sais something about preAI and postAI but noone helped me with that :/
I don't see how changing "projectile.extraUpdates;" would make your projectile invisible. Did it work with "projectile.extraUpdates = 0;"? Chances are you set "projectile.extraUpdates" so high the projectile flies off the screen before you even see it. Just post your code and we'll see the problem.
 

wch

Terrarian
Now another questions appears agian!
I'm making a NPC, some sorta knight type NPC. So ofc. it uses melee weapon.
Then I set it up like this:
Code:
            npc.name = "Guard";
            npc.townNPC = true;
            npc.friendly = true;
            npc.width = 18;
            npc.height = 40;
            npc.aiStyle = 7;
            npc.damage = 10;
            npc.defense = 45;
            npc.lifeMax = 250;
            npc.soundHit = 1;
            npc.soundKilled = 1;
            npc.knockBackResist = 0.5f;
            Main.npcFrameCount[npc.type] = 26;
            NPCID.Sets.ExtraFramesCount[npc.type] = 9;
            NPCID.Sets.AttackFrameCount[npc.type] = 4;
            NPCID.Sets.DangerDetectRange[npc.type] = 200;
            NPCID.Sets.AttackType[npc.type] = 207;
            NPCID.Sets.AttackTime[npc.type] = 20;
            NPCID.Sets.AttackAverageChance[npc.type] = 25;
            animationType = NPCID.Guide;
        }
I think attack type is the same as the Dye Trader, who also uses melee weapon. But this Guard just won't attack whatever. What's wrong?
 

raptor722

Terrarian
I don't see how changing "projectile.extraUpdates;" would make your projectile invisible. Did it work with "projectile.extraUpdates = 0;"? Chances are you set "projectile.extraUpdates" so high the projectile flies off the screen before you even see it. Just post your code and we'll see the problem.
using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace :red:.Projectiles //that face i just named that testing mod shiit wihout one i
{
public class LaserCartrige : ModProjectile
{
public override void SetDefaults()
{
projectile.name = "LaserCartrige";
projectile.width = 10;
projectile.height = 4;
projectile.friendly = true;
projectile.penetrate = 4;
projectile.timeLeft = 99;
projectile.tileCollide = true;
projectile.ignoreWater = false;
projectile.extraUpdates = 20;
}
public override void AI()
{
projectile.velocity.Y += projectile.ai[0];
projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X);
}
}
}

This is it but someone sais that if i want to make look like laser i hae to make slow shootspeed and extraupdates about 10 or 20 and to make it look like line of laser add something to postAI or preAI
[DOUBLEPOST=1450798034,1450797485][/DOUBLEPOST]It should looks like shadowbeam staff projectile but in red
 

blushiemagic

Retinazer
tModLoader
Now another questions appears agian!
I'm making a NPC, some sorta knight type NPC. So ofc. it uses melee weapon.
Then I set it up like this:
Code:
            npc.name = "Guard";
            npc.townNPC = true;
            npc.friendly = true;
            npc.width = 18;
            npc.height = 40;
            npc.aiStyle = 7;
            npc.damage = 10;
            npc.defense = 45;
            npc.lifeMax = 250;
            npc.soundHit = 1;
            npc.soundKilled = 1;
            npc.knockBackResist = 0.5f;
            Main.npcFrameCount[npc.type] = 26;
            NPCID.Sets.ExtraFramesCount[npc.type] = 9;
            NPCID.Sets.AttackFrameCount[npc.type] = 4;
            NPCID.Sets.DangerDetectRange[npc.type] = 200;
            NPCID.Sets.AttackType[npc.type] = 207;
            NPCID.Sets.AttackTime[npc.type] = 20;
            NPCID.Sets.AttackAverageChance[npc.type] = 25;
            animationType = NPCID.Guide;
        }
I think attack type is the same as the Dye Trader, who also uses melee weapon. But this Guard just won't attack whatever. What's wrong?
AttackType is a vanilla thing; it won't let you copy stuff that already exists. For this, you'll pretty much have to take a very thorough look at the documentation (and have a good understanding of how to override methods).

using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace :red:.Projectiles //that face i just named that testing mod shiit wihout one i
{
public class LaserCartrige : ModProjectile
{
public override void SetDefaults()
{
projectile.name = "LaserCartrige";
projectile.width = 10;
projectile.height = 4;
projectile.friendly = true;
projectile.penetrate = 4;
projectile.timeLeft = 99;
projectile.tileCollide = true;
projectile.ignoreWater = false;
projectile.extraUpdates = 20;
}
public override void AI()
{
projectile.velocity.Y += projectile.ai[0];
projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X);
}
}
}

This is it but someone sais that if i want to make look like laser i hae to make slow shootspeed and extraupdates about 10 or 20 and to make it look like line of laser add something to postAI or preAI
[DOUBLEPOST=1450798034,1450797485][/DOUBLEPOST]It should looks like shadowbeam staff projectile but in red
Yeah, if you're not calling Dust.NewDust in your AI then 20 extra updates is way too fast.
 

Yxng Hxpe

Official Terrarian
What exactly will harm your computer?
The file called Terraria_v1.3.0.8 is just the vanilla executable. Renaming some files will not really harm your computer (unless you change the file type of course, which I do not recommend). If you did something wrong in the process, you can always check the file integrity from the game in question to get the 'correct' files back. Can't go wrong any way.
it said on on my download it can harm my computer
 

Yxng Hxpe

Official Terrarian
It will say that literally anything downloaded from the Internet can harm your computer. If you'll listen to that all the time, might as well not download anything from the Internet at all.
it doesnt say that every time but i wasnt sure of that site because on my tablet i always do things that can harm it
 

Yxng Hxpe

Official Terrarian
22/12/2015 16:38:14
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)
got that when i opened the new terraria
 

Epix38

Terrarian
I downloaded the Example Mod, and put the files in the folders as directed, but when I try to compile it, I get this error:

error CS0006: Metadata file 'TerrariaMac.exe' could not be found

the strange thing is... I'm running on linux! (through crossover)
What is happening???
-Doom24
 
Top Bottom