• 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.
  • 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

Eldrazi

Eater of Worlds
sorry to bother you guys again
but what does this (projectile.alpha) do?
Do you know what alpha is? Alpha determines the transparancy of an image (more specifically a pixel, but...).
Now normally an alpha of 0 would result in total transparancy and an alpha of 255 would be no transparancy at all, but it's quite the other way around when you're modding Terraria.
 

Darkninja

Spazmatism
Do you know what alpha is? Alpha determines the transparancy of an image (more specifically a pixel, but...).
Now normally an alpha of 0 would result in total transparancy and an alpha of 255 would be no transparancy at all, but it's quite the other way around when you're modding Terraria.
i see now. tnx
[DOUBLEPOST=1450754706,1450754208][/DOUBLEPOST]also what determines how fast the projectile falls
i tried decreasing the item.shootSpeed but didn't work
 

Eldrazi

Eater of Worlds
i see now. tnx
[DOUBLEPOST=1450754706,1450754208][/DOUBLEPOST]also what determines how fast the projectile falls
i tried decreasing the item.shootSpeed but didn't work
This line:
Code:
float SpeedY = num17 + (float) Main.rand.Next(-40, 41) * 0.02f;
You'll want to change the '0.02f' value for a different falling speed (the higher the value, the faster it'll fall).
 

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
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/tModLoader/wiki/ModItem#public-virtual-bool-predrawinworldspritebatch-spritebatch-color-lightcolor-color-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 :/
 

wch

Terrarian
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".
 

blushiemagic

Retinazer
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
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
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.
 

psyryse

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
 

psyryse

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
 
Top Bottom