I came back to around 3500 errors on my mod when tModLoader updated to 1.4. I gave up on it and let it sit for a long time. Then, you posted a new tutorial. I had subscribed to you months before when I had started my mod, and forgot about it. I watched this tutorial, and it gave me the courage to join the tModLoader discord and ask about migration. My mod went from 3500ish errors to 500, and because of that, I’ve had the determination to keep working on it. Currently at 237 errors, I’m whittling away at them, but wouldn’t have ever picked this project back up if it wasn’t for you, Lynx. Please, don’t ever stop making these awesome tutorials, and remember that these videos effect people in amazing ways!!! P.S. if you end up reading this, then I really liked your terraria play through. Just saying, I wouldn’t mind seeing more…
The 1.3 to 1.4 changes caused so many problems with mods. It is good that you are gradually getting the errors down. Glad that my videos have been able to motivate you to reopen the project. As for the Terraria playthrough. I have been thinking about doing one for a while. Just haven't had time to try.
Hey, i just wanted to say, you're a life savior. I'm an artist and i was looking to do some simple vanity items for fun, and to experiment with basic modding in Terraria, but i couldn't for the longest time understand the code or just find a tutorial that explains things properly for the common folks who just started touching to mods. So thank you really, because i managed to do my first items pretty quick with your help! 😊
I sincerely hope you enjoy making these videos as much as we enjoy watching them! There truly is no other channel quite like yours, really informative and helpful for those that only just began coding. Keep up the amazing work!
Hi, your videos are so SO good. As someone who has never coded in C#, you made it very easy for me to create a simple, functional mod. I have been thinking of ideas lately and I was wondering if you could make a video about advanced swords such as the Murasama from the Calamity mod or how to implement new gameplay elements to the game like RPG elements? My main message is keep up the amazing work and thank you for growing the Terraria modding community!
Do you know the code to increase the positioning range of the blocks in the terrarium? Or to reduce the damage suffered? I'd also like to know the code to increase the maximum number of sentries? And the mana regeneration code?
I think you do blockRange or tileRange += X defence += X minionsMax += X Mana regen I can't remember of top of head I think it is statMana2 or something like that
Great content, best and most informative help out there. Is there any chance you could show us how to make a placed block that can change, like something that interacts with wires or even a plant?
@@FoolsLynx i feel like tutorials like this should be generic so people have something to start with, instead of giving them a finished product which might not be what they want (im not sure if were talking about the same thing my english is not great)
While I try to keep most things generic, Damage Classes sort of don't fit. I might just make a hybrid class maybe hybrid of melee and magic as it isn't specific and can be worked with
Adding thid to my other comments, i've been dying to know how to do some some housing furnitures. Do you think you're going to make a tutorial about that at some point? Thank you for your hard work again!
I'm covering crafting stations and stuff next episode. The stuff in that video is required for furniture anyway. Don't know if I'm doing a dedicated video on furniture. Maybe some items. Can't remember if it is on my list of videos.
First off, I want to say thank you so much for making these! It's definitely a pipe dream since I don't really know anything about coding, but these videos make me want to attempt making a content addition mod someday-- something akin to thorium or cal (though probably not nearly as big lmao). I did want to ask though, since I couldn't find any info anywhere about it... is it possible to make the game read the actual in-game sprite as something bigger than the default 'template size'? For example, I'm wanting to make a shark tail; and I'm struggling to fit the sprite into the space that back accessories have by default. Is there lines of code that I could implement to make it read the sprite size as something wider? I imagine you can, but I have a feeling it's a lot more complicated than just typing a [value] x [value] scaling...
amazing tutorial, vary easy to follow. I am have trouble making a debuff like on fire that effects npc and players the tmodloader's example was for players only I tried combing it and there wipe debuff but I can't seem to figure out the syntax. any ideas or know where I can find a example?
you can do something like this public override void SetDefaults() { // normal code... Item.buffType = BuffID; Item.buffTime = 30 * 60; // 30 seconds } public override void OnConsumeItem(Player player) { player.AddBuff(BUFFID2, Item.buffTime); // Repeat above for multiple } That should work.
@@FoolsLynx Thanks for your reply. Unfortunately it didn't work - it's only granting the first one in SetDefaults. Do you have a discord where we could discuss the issue easier?
@@FoolsLynx Edit: Actually it worked, thanks. I was just using fargos mutant mod which gives infinite buffs and apparently messes up the OnConsumeItem function. Once I disabled the mod and consumed the potion manually it was fine. Thank you! now I'll figure out how to make it work with mutant mod
Do you plan on covering how to make a custom pet? If not, do you have any resources or advice on how to code the pet projectile or whatever is needed for it? I cant seem to find any clear examples on how to make one from scratch.
It's on my list but it is not for ages. But you can use the example mod for reference: github.com/tModLoader/tModLoader/tree/1.4/ExampleMod/Content/Pets
will there be a sprite sheet and custom animation tutorial? I get custom animations seem to be harder so I plan on messing around with that, but I've been having sprite animation issues, for example, like the soul of sight or somtin
Is there going to be another video in this series? you seem to be quite busy but it would rlly help! maybe you could cover how to make a modded workbench or something.
I made a community post about this not long ago. I will have videos out soon. And good news, the next video will literally be custom crafting stations with one being a custom workbench.
Do you know how to replicate the Hallowed Plate Mail? It has a built in cape and I’m not quite sure how to mimic. I’ve made a chest piece sprite and cape sprite, I just don’t know how to combine the two. Thanks!
I have been trying to work this out for a long time but nothing i am doing is working. How do you add audio to the accessorie of heremes boots? Any help much appreciated.
Lynx I have a very big question that i would like to ask, And for you to respond I don't know what the content folder is and never had it in my mod Folder i only have items folder and properties, and i'm very confused.
Is there a way to make a custom accessory that can be equipped multiple times? I tried overriding CanAccessoryBeEquippedWith but I can't get it to work.
I am not sure, its been a while since I last played terraria, does normal terraria allow multiple of the same item to be equipped? Even if it is a specific accessory. If no, then it might not be possible. might be worth asking on the tmodloader discord. I will try and search but I cannot think where to look.
@@FoolsLynx in vanilla terraria you can't equip identical accessories. However, I think you can use CanAccessoryBeEquipped to determine what accessories can't be equipped with it, so I figured there might be a way to use it to allow itself to be equipped instead. I'm not sure though.
I was just wondering how do you get accessories to have "special" effects like the Brain of Confusion's confuse effect or the Star Cloaks star fall effect. I knew how to do it in 1.3 but now in 1.4 it's different and weird
I think you need to create a class extending GlobalNPC and in that override the OnHitPlayer method. Check if the player has the accessory equipped and if it does, apply the effect to the NPC.
In your item code, you will want to override the CanUseItem method and check that the number of projectiles of that type is less than 1. You can see this done on the example spear: github.com/tModLoader/tModLoader/blob/1.4/ExampleMod/Content/Items/Weapons/ExampleSpear.cs
What do you mean it isn't displaying stats? If you mean it doesn't show the "Increases Melee by 50%" or whatever, that is because that was a custom tooltip.
If you check in the wiki on the examplemod github, there is open source mods too. There might be something for 1.4, I haven't looked. If not you can try and adapt 1.3 stuff
English: Range I don't believe can be changed with an accessory, this is handled by the Whip item itself. I might be wrong. Speed and Damage can be modified by doing player.GetDamage(DamageClass.Summon) += additive damage / 100f or player.GetAttackSpeed(DamageClass.Summon) += speed bonus / 100f I cannot remember for sure if the DamageClass is Magic, Summon or Melee. Google Translated Spanish: No creo que el alcance se pueda cambiar con un accesorio, esto lo maneja el propio elemento Whip. Podría estar equivocado. La velocidad y el daño se pueden modificar haciendo player.GetDamage(DamageClass.Summon) += daño aditivo / 100f o player.GetAttackSpeed(DamageClass.Summon) += bonificación de velocidad / 100f No puedo recordar con seguridad si la clase de daño es mágica, de invocación o cuerpo a cuerpo.
I'm not 100% sure. I'd ask on the tmodloader discord server for methods to do it. The only way I can think is to create a counter that increases on hit.
Cuando uso tu mod de ejemplo o tambien al usar el de examplemod del tmodloader me slata error, no se si tenga que ver que estoy en vercion beta de la 1.4.4 y deva crear mi mod en la 1.4.3 estable.
English: Not much should have changed between 1.4.4 preview and 1.4.3 (you'd have to check the change notes) so there shouldn't be an issue. A general rule of thumb. Don't use ExampleMod as an actual mod. Only use it as a reference because it can have outdated and buggy code. Google Translated Spanish: No debería haber cambiado mucho entre la vista previa 1.4.4 y 1.4.3 (tendría que verificar las notas de cambio), por lo que no debería haber ningún problema. Una regla general. No utilices EjemploMod como un mod real. Úselo sólo como referencia porque puede tener código desactualizado y con errores.
This is unrelated to this video but I figured I'd put it here since it is the most recent. I've been trying to add dust to a sword and no matter what I do I just can't figure it out, I've scoured everywhere on youtube and github to find an example of it but there is no such thing anywhere that I looked. If you could respond or make a video on implementing dusts that would be greatly appreciated. Edit: Wait a minute I might've found something. Edit 2: Okay yeah I finally figured it out
If you are using a custom boss, you need to use a downed system to track the boss downed. github.com/tModLoader/tModLoader/blob/1.4/ExampleMod/Common/Systems/DownedBossSystem.cs Then in your worldgen system you will want a bool that is set to false by default then in the postupdate method check if the boss is downed and that the ore hasn't been spawned already. Spawn the new ore. Set the variable to true to prevent it from spawning again. If you want multiple you will need to create a method in your worldgen that will create your ore then when a boss is downed, this method is called. You will either do this when your custom boss is defeated or you have to do it with GlobalNPCs and i am not sure which method you use for that
I notice the description for the tutorial stat accessory is lying about the damage boost. It says it gives 50% extra damage, when it only gives 25% extra damage. What's going on here?
This was because I recorded the video multiple times and in the final version I didn't update my tooltip from a previous recording so the tooltip is wrong
Hey, I don't know if you're still responding to comments, but I was wondering how to make an accessory give a buff instead of just modifying stats. I'd appreciate any help!
Just took a look. I spawned both the goblin tinkerer and using heros mod. they both gave prefix modifiers to the accessories. Vanity items cant have prefixes so make sure you have Item.accessory = true
ive been searching all over and i cant find visual studio code for jack shit. all i wanna know is if i can change the base max minions without the need to an item
You create a class that extends modplayer it might be something different and override the reset method and one other method and then change the max minions that way. Look at examplemod under the common folder for player class stuff
The methods you want to override are: Intialize, ResetEffects and ResetDead Then in this you will set the minion summons to the minimum you want to be able to summon.
So I noticed in your WorldGen tutorial you showed how to set ore tiles to generate in your world at creation. I am in trouble right now because I am wanting to create a new structure to generate in a specific location. I cannot seem to find a resource to guide me into the process to implement a new structure, so I am unable to continue in the development of my mod; On the other hand the other things I have to do with modding have adequate documentation on the api's purpose and usage. In the long term I want to completely replace the dungeon generation in place of a similar structure for the use of shrinking the size of generated structures in game and apply them with usage of SubWorld Library; which as I said has plenty of adequate documentation. I eventually intend to adapt this for other mods that add massive structures/biomes that greatly interfere with other mods worldgen to increase compatibility for as many mods as possible. Of course I intend to make the creators aware of the changes I make but I want to avoid looking into their source code if at all possible. Thanks in advance!
1.4 changed the way that tiles are generated. First you need to get the current tile at the X and y coord and turn it to air. Then you use WorldGen.PlaceTile to... Well place tile
I am struggling with rotation problem, code below: Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; Projectile.ai[0] += 1f; // Use a timer to wait 15 ticks before applying gravity. Projectile.velocity.X = Projectile.velocity.X * 0.99f; if (Projectile.ai[0] >= 30f) { Projectile.ai[0] = 30f; Projectile.velocity.Y += 0.4f; Projectile.rotation = 1.1f * Projectile.velocity.Y; } if (Projectile.velocity.Y > 16f) { Projectile.velocity.Y = 16f; } this is throwing knife ai, when velocity.Y equals 16f projectile stops rotating. I don't know the reason of this. Maybe you will se smth.
Because of the line: Projectile.rotation = 1.1f * Projectile.velocity.Y; Your rotation value is ALWAYS going to be 1.1f * y which 1.1f * 16 isn't ever going to change. This line: Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; Is completely redundant because every tick you are setting the Projectile rotation to 1.1 * 16 For the first if statement just do: if(Projectile.ai[0] == 30) this way you will only call it once as you are incrementing the ai[0] by 1 each tick. After that, your rotation will be based on the x and y velocity to a rotation value. What you might want to do is instead of setting the Rotation value equal to velocity to rotation, you increment rotation instead so Projectile.rotation += Projectile.velocity.ToRotation() + MathHelper.PiOver2; Hopefully that makes sense.
@@FoolsLynx Hello, I tried to follow this tips and I did some experiments, this line: Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2 is a must have because before 30f this proj moves straight, incrementing this line is not good and don't work this line: if(Projectile.ai[0] == 30) just doesn't work, greater or eqal work i moved rotation line in if like this: if (Projectile.ai[0] < 30f) { Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; } in previous if i increment rotation by 0.5f now it works correct still thanks for help🙂
I came back to around 3500 errors on my mod when tModLoader updated to 1.4. I gave up on it and let it sit for a long time. Then, you posted a new tutorial. I had subscribed to you months before when I had started my mod, and forgot about it. I watched this tutorial, and it gave me the courage to join the tModLoader discord and ask about migration. My mod went from 3500ish errors to 500, and because of that, I’ve had the determination to keep working on it. Currently at 237 errors, I’m whittling away at them, but wouldn’t have ever picked this project back up if it wasn’t for you, Lynx. Please, don’t ever stop making these awesome tutorials, and remember that these videos effect people in amazing ways!!!
P.S. if you end up reading this, then I really liked your terraria play through. Just saying, I wouldn’t mind seeing more…
The 1.3 to 1.4 changes caused so many problems with mods. It is good that you are gradually getting the errors down. Glad that my videos have been able to motivate you to reopen the project. As for the Terraria playthrough. I have been thinking about doing one for a while. Just haven't had time to try.
this is pretty nice as there is almost no tutorials on this, but now I can add accessorys!
The way to add stat on accessories is very helpful, it is one of the greatest help that a starting modder could get.
Hey, i just wanted to say, you're a life savior. I'm an artist and i was looking to do some simple vanity items for fun, and to experiment with basic modding in Terraria, but i couldn't for the longest time understand the code or just find a tutorial that explains things properly for the common folks who just started touching to mods. So thank you really, because i managed to do my first items pretty quick with your help! 😊
I sincerely hope you enjoy making these videos as much as we enjoy watching them! There truly is no other channel quite like yours, really informative and helpful for those that only just began coding. Keep up the amazing work!
It's funny, I was just looking at how to make accessories, thanks for the tutorial! >w
Hi, your videos are so SO good. As someone who has never coded in C#, you made it very easy for me to create a simple, functional mod. I have been thinking of ideas lately and I was wondering if you could make a video about advanced swords such as the Murasama from the Calamity mod or how to implement new gameplay elements to the game like RPG elements? My main message is keep up the amazing work and thank you for growing the Terraria modding community!
Lynx, it's time to wear a crown you king.
Fun behind the scenes fact. If the video was like the previous. I would have done a crown vanity item.
Do you know the code to increase the positioning range of the blocks in the terrarium?
Or to reduce the damage suffered?
I'd also like to know the code to increase the maximum number of sentries?
And the mana regeneration code?
I think you do blockRange or tileRange += X
defence += X
minionsMax += X
Mana regen I can't remember of top of head I think it is statMana2 or something like that
Your tutorials are so helpful, don't stop making them. (your mic sounds so much better!)
Great content, best and most informative help out there. Is there any chance you could show us how to make a placed block that can change, like something that interacts with wires or even a plant?
I'll do something which involves wiring in the future, it is something I constantly forget about.
Are you planning on doing a tutorial for custom damaga classes soon?
I need to think of a way to make it not feel completely generic.
@@FoolsLynx i feel like tutorials like this should be generic so people have something to start with, instead of giving them a finished product which might not be what they want (im not sure if were talking about the same thing my english is not great)
While I try to keep most things generic, Damage Classes sort of don't fit. I might just make a hybrid class maybe hybrid of melee and magic as it isn't specific and can be worked with
Thx for this tutoriales you're the best
Adding thid to my other comments, i've been dying to know how to do some some housing furnitures. Do you think you're going to make a tutorial about that at some point? Thank you for your hard work again!
I'm covering crafting stations and stuff next episode. The stuff in that video is required for furniture anyway. Don't know if I'm doing a dedicated video on furniture. Maybe some items. Can't remember if it is on my list of videos.
First off, I want to say thank you so much for making these! It's definitely a pipe dream since I don't really know anything about coding, but these videos make me want to attempt making a content addition mod someday-- something akin to thorium or cal (though probably not nearly as big lmao).
I did want to ask though, since I couldn't find any info anywhere about it... is it possible to make the game read the actual in-game sprite as something bigger than the default 'template size'? For example, I'm wanting to make a shark tail; and I'm struggling to fit the sprite into the space that back accessories have by default. Is there lines of code that I could implement to make it read the sprite size as something wider? I imagine you can, but I have a feeling it's a lot more complicated than just typing a [value] x [value] scaling...
Unfortunately the frame size you have for each frame is the maximum size you can have. As far as I know there is no easy way to do it
@@FoolsLynx Well dang. Thank you for letting me know!
amazing tutorial, vary easy to follow. I am have trouble making a debuff like on fire that effects npc and players the tmodloader's example was for players only I tried combing it and there wipe debuff but I can't seem to figure out the syntax. any ideas or know where I can find a example?
Hi,
How do you make a buff potion that gives multiple vanilla buffs on use?
you can do something like this
public override void SetDefaults() {
// normal code...
Item.buffType = BuffID;
Item.buffTime = 30 * 60; // 30 seconds
}
public override void OnConsumeItem(Player player) {
player.AddBuff(BUFFID2, Item.buffTime);
// Repeat above for multiple
}
That should work.
@@FoolsLynx Thanks for your reply. Unfortunately it didn't work - it's only granting the first one in SetDefaults. Do you have a discord where we could discuss the issue easier?
@@FoolsLynx Edit: Actually it worked, thanks. I was just using fargos mutant mod which gives infinite buffs and apparently messes up the OnConsumeItem function. Once I disabled the mod and consumed the potion manually it was fine. Thank you!
now I'll figure out how to make it work with mutant mod
Do you plan on covering how to make a custom pet? If not, do you have any resources or advice on how to code the pet projectile or whatever is needed for it? I cant seem to find any clear examples on how to make one from scratch.
It's on my list but it is not for ages. But you can use the example mod for reference: github.com/tModLoader/tModLoader/tree/1.4/ExampleMod/Content/Pets
Do you plan on covering making keybindings, if not then could I get some kind of page where the 1.4 new keybinding classes and methods are explained?
You can look at the examplemod on GitHub. That has an example
Thanks I couldn't find it before. Sorry for bothering you!
Are you planning on ever making a Custom Class tutorial? I can't seem to figure it out myself.
Eventually. Stuff changed since 1.3 and I am trying to understand it better
@@FoolsLynx oh
will there be a sprite sheet and custom animation tutorial?
I get custom animations seem to be harder so I plan on messing around with that, but I've been having sprite animation issues, for example, like the soul of sight or somtin
It's on my list to do
Do you know how to make an accessory cause melee weapons apply a debuff when they hit something, similar to what Magma Stone does?
Is there going to be another video in this series? you seem to be quite busy but it would rlly help! maybe you could cover how to make a modded workbench or something.
I made a community post about this not long ago. I will have videos out soon. And good news, the next video will literally be custom crafting stations with one being a custom workbench.
Well that’s handy
Hi lynx!
I was wondering how I would add a piece of code that would increase the velocity of an arrow or bullet.
Thanks!
For vanilla AI, override the Pre or Post AI method and do Projectile.Velocity += or *=
@@FoolsLynx Ok, thanks!
Do you know how to replicate the Hallowed Plate Mail? It has a built in cape and I’m not quite sure how to mimic. I’ve made a chest piece sprite and cape sprite, I just don’t know how to combine the two. Thanks!
You would use similar logic as the robe shown in this video but instead of leg slot you use maybe back? Not 100% sure on that one
Will you make a tutorial on how to make a custom damage class?
In the future
I have been trying to work this out for a long time but nothing i am doing is working. How do you add audio to the accessorie of heremes boots? Any help much appreciated.
github.com/tModLoader/tModLoader/wiki/Basic-Sounds
Take a look at this. It might help.
question: how do you attach gun handle sprite to the player hands?
There are offset values you can set. Take a look at the examplemod which has an example gun on it that I think shows how
Lynx I have a very big question that i would like to ask, And for you to respond
I don't know what the content folder is and never had it in my mod Folder i only have items folder and properties, and i'm very confused.
You create the folders yourself.
Is there a way to make a custom accessory that can be equipped multiple times? I tried overriding CanAccessoryBeEquippedWith but I can't get it to work.
I am not sure, its been a while since I last played terraria, does normal terraria allow multiple of the same item to be equipped? Even if it is a specific accessory. If no, then it might not be possible. might be worth asking on the tmodloader discord. I will try and search but I cannot think where to look.
@@FoolsLynx in vanilla terraria you can't equip identical accessories. However, I think you can use CanAccessoryBeEquipped to determine what accessories can't be equipped with it, so I figured there might be a way to use it to allow itself to be equipped instead. I'm not sure though.
I can't even find any information on that function. I will keep looking however.
I was just wondering how do you get accessories to have "special" effects like the Brain of Confusion's confuse effect or the Star Cloaks star fall effect. I knew how to do it in 1.3 but now in 1.4 it's different and weird
I think you need to create a class extending GlobalNPC and in that override the OnHitPlayer method. Check if the player has the accessory equipped and if it does, apply the effect to the NPC.
there is a function that let do some actions when weapon will crit?
override the OnHitNPC method and then do if(crit) to run code when crit.
@@FoolsLynx can I do NewProjectile in OnHitNPC (in item file) ?
If i want to do smth like boomerang, how to prevent shoot another projectile until first will die?
In your item code, you will want to override the CanUseItem method and check that the number of projectiles of that type is less than 1.
You can see this done on the example spear:
github.com/tModLoader/tModLoader/blob/1.4/ExampleMod/Content/Items/Weapons/ExampleSpear.cs
My stat accessory works but it's not displaying its stats. Any idea why that might be?
What do you mean it isn't displaying stats? If you mean it doesn't show the "Increases Melee by 50%" or whatever, that is because that was a custom tooltip.
hey, are you planning to do summoner items?
I have it down at Episode 17. You can use the examplemod for references
@@FoolsLynx thank you, the content of summoners weapons is very scarce after 1.4, feels good to have good content creators teaching it
If you check in the wiki on the examplemod github, there is open source mods too. There might be something for 1.4, I haven't looked. If not you can try and adapt 1.3 stuff
Can you make a mod to equip a lot more accessories than the game allows!?
The player method has a public int called extraAccessorySlots. You can adjust that to give more accessory slots. I think
@@FoolsLynx Can you make a video showing it please 🥺
Maybe when I cover something that requires the player class
@@FoolsLynx Ok, I will be waiting...⚘❤
Hola, Necesito agregar accesorios que aumenten el alcance , velocidad y daño solo para el latigo , no para el minion , como podria hacerlo?
English:
Range I don't believe can be changed with an accessory, this is handled by the Whip item itself. I might be wrong. Speed and Damage can be modified by doing
player.GetDamage(DamageClass.Summon) += additive damage / 100f
or
player.GetAttackSpeed(DamageClass.Summon) += speed bonus / 100f
I cannot remember for sure if the DamageClass is Magic, Summon or Melee.
Google Translated Spanish:
No creo que el alcance se pueda cambiar con un accesorio, esto lo maneja el propio elemento Whip. Podría estar equivocado. La velocidad y el daño se pueden modificar haciendo
player.GetDamage(DamageClass.Summon) += daño aditivo / 100f
o
player.GetAttackSpeed(DamageClass.Summon) += bonificación de velocidad / 100f
No puedo recordar con seguridad si la clase de daño es mágica, de invocación o cuerpo a cuerpo.
how to make it possible to equip several identical accessories
Hi, what is the part of the image on the right-most of breastplate.png used for?
sorry, the breastplate_body.png
I beleive it is the back arm.
Is there a way to make a Custom sword shoot a custom projectile only once every a couple of hits?
I'm not 100% sure. I'd ask on the tmodloader discord server for methods to do it. The only way I can think is to create a counter that increases on hit.
@@FoolsLynx ok thanks
Cuando uso tu mod de ejemplo o tambien al usar el de examplemod del tmodloader me slata error, no se si tenga que ver que estoy en vercion beta de la 1.4.4 y deva crear mi mod en la 1.4.3 estable.
English:
Not much should have changed between 1.4.4 preview and 1.4.3 (you'd have to check the change notes) so there shouldn't be an issue. A general rule of thumb. Don't use ExampleMod as an actual mod. Only use it as a reference because it can have outdated and buggy code.
Google Translated Spanish:
No debería haber cambiado mucho entre la vista previa 1.4.4 y 1.4.3 (tendría que verificar las notas de cambio), por lo que no debería haber ningún problema. Una regla general. No utilices EjemploMod como un mod real. Úselo sólo como referencia porque puede tener código desactualizado y con errores.
Can you do a tutorial on custom sword effects ?something like the effects that re-logic added in the new update ?
I'll need some context on what specifically
@@FoolsLynx these new swords effects thta they added,I’ve seen some mods with them like murasama from calamity or the new Excalibur swing effects.
In the case of true excalibur is that the yellow and pink swing effect animation (as seen on the wiki?)
@@FoolsLynx yes
This is unrelated to this video but I figured I'd put it here since it is the most recent. I've been trying to add dust to a sword and no matter what I do I just can't figure it out, I've scoured everywhere on youtube and github to find an example of it but there is no such thing anywhere that I looked. If you could respond or make a video on implementing dusts that would be greatly appreciated. Edit: Wait a minute I might've found something. Edit 2: Okay yeah I finally figured it out
how do you make ores spawn after an event? Like defeating a boss
If you are using a custom boss, you need to use a downed system to track the boss downed. github.com/tModLoader/tModLoader/blob/1.4/ExampleMod/Common/Systems/DownedBossSystem.cs
Then in your worldgen system you will want a bool that is set to false by default then in the postupdate method check if the boss is downed and that the ore hasn't been spawned already. Spawn the new ore. Set the variable to true to prevent it from spawning again. If you want multiple you will need to create a method in your worldgen that will create your ore then when a boss is downed, this method is called. You will either do this when your custom boss is defeated or you have to do it with GlobalNPCs and i am not sure which method you use for that
@@FoolsLynx k
I notice the description for the tutorial stat accessory is lying about the damage boost. It says it gives 50% extra damage, when it only gives 25% extra damage.
What's going on here?
This was because I recorded the video multiple times and in the final version I didn't update my tooltip from a previous recording so the tooltip is wrong
Bro I love you like im gay for you like you saved my life now I will do anything for you like bro 🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏
how do you create the tooltips and display names?
nvm i figured it out
Localisation files
@@FoolsLynx thx
im trying to figure out how to make a debuff but i cant find anything about it would anyone know something about that
Look at the examplemod for references
ty
Is there a way to directly modify a vanilla item?
Create a class that extends GlobalItem and then you can modify values.
@@FoolsLynx thx
Hey, I don't know if you're still responding to comments, but I was wondering how to make an accessory give a buff instead of just modifying stats. I'd appreciate any help!
What you can do is player.AddBuff(buffID) in the UpdateAccessory.
@@FoolsLynx Thank you!
how do i make the accessory increase luck?
I will need to look it up as I constantly forget luck exists in terraria
dude i follow every step here and works but my items not get modifier when i craft them , how i fix it?
Does the goblin tinkerer not do it? If not I will take a look as I didn't think about modifiers
@@FoolsLynx with goblin dont work too
Ok I will take a look as I might have messed up something
Just took a look. I spawned both the goblin tinkerer and using heros mod. they both gave prefix modifiers to the accessories. Vanity items cant have prefixes so make sure you have Item.accessory = true
@@FoolsLynx and for weapons what i do?
ive been searching all over and i cant find visual studio code for jack shit.
all i wanna know is if i can change the base max minions without the need to an item
You create a class that extends modplayer it might be something different and override the reset method and one other method and then change the max minions that way. Look at examplemod under the common folder for player class stuff
The methods you want to override are:
Intialize, ResetEffects and ResetDead
Then in this you will set the minion summons to the minimum you want to be able to summon.
@@FoolsLynx oh ok
what engine does it use?
Terraria is programmed in Xna
i think if this video gets 50k likes her should make a "ghouly gosties come out to play" song
How to add a minion slot to an accessory?
player.maxMinions += x
When will there be a guide to the pursuers' pets, for example, like Chester? NOT FLYING MASS
I have no idea what the Pursuers pets is.
Do you just mean pets..?
how do you make a hat vanity item'
Apply the information from one of the others but change the equip type to head. Also look at the tutorial helmet.
pls made tutorial how to create boss
It's coming in the future. I am doing 3 back to back videos on NPCs
you are god
Too bad I wasn't able to continue trying to create a mod, my pc is really not the best for any of this...
Well I mean that's a weird excuse, even an old office computer is built for programming and the like
👍
So I noticed in your WorldGen tutorial you showed how to set ore tiles to generate in your world at creation. I am in trouble right now because I am wanting to create a new structure to generate in a specific location. I cannot seem to find a resource to guide me into the process to implement a new structure, so I am unable to continue in the development of my mod;
On the other hand the other things I have to do with modding have adequate documentation on the api's purpose and usage. In the long term I want to completely replace the dungeon generation in place of a similar structure for the use of shrinking the size of generated structures in game and apply them with usage of SubWorld Library; which as I said has plenty of adequate documentation. I eventually intend to adapt this for other mods that add massive structures/biomes that greatly interfere with other mods worldgen to increase compatibility for as many mods as possible. Of course I intend to make the creators aware of the changes I make but I want to avoid looking into their source code if at all possible.
Thanks in advance!
1.4 changed the way that tiles are generated. First you need to get the current tile at the X and y coord and turn it to air. Then you use WorldGen.PlaceTile to... Well place tile
I am struggling with rotation problem, code below:
Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2;
Projectile.ai[0] += 1f; // Use a timer to wait 15 ticks before applying gravity.
Projectile.velocity.X = Projectile.velocity.X * 0.99f;
if (Projectile.ai[0] >= 30f)
{
Projectile.ai[0] = 30f;
Projectile.velocity.Y += 0.4f;
Projectile.rotation = 1.1f * Projectile.velocity.Y;
}
if (Projectile.velocity.Y > 16f)
{
Projectile.velocity.Y = 16f;
}
this is throwing knife ai, when velocity.Y equals 16f projectile stops rotating. I don't know the reason of this. Maybe you will se smth.
Because of the line:
Projectile.rotation = 1.1f * Projectile.velocity.Y;
Your rotation value is ALWAYS going to be 1.1f * y which 1.1f * 16 isn't ever going to change.
This line:
Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2;
Is completely redundant because every tick you are setting the Projectile rotation to 1.1 * 16
For the first if statement just do:
if(Projectile.ai[0] == 30)
this way you will only call it once as you are incrementing the ai[0] by 1 each tick.
After that, your rotation will be based on the x and y velocity to a rotation value. What you might want to do is instead of setting the Rotation value equal to velocity to rotation, you increment rotation instead
so
Projectile.rotation += Projectile.velocity.ToRotation() + MathHelper.PiOver2;
Hopefully that makes sense.
@@FoolsLynx Hello, I tried to follow this tips and I did some experiments,
this line: Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2
is a must have because before 30f this proj moves straight, incrementing this line is not good and don't work
this line: if(Projectile.ai[0] == 30) just doesn't work, greater or eqal work
i moved rotation line in if like this:
if (Projectile.ai[0] < 30f)
{
Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2;
}
in previous if i increment rotation by 0.5f
now it works correct
still thanks for help🙂
I am glad it got working, I forgot my own code that I wrote in this video and that that line is need before the before any timer stuff
How do you make accessories give damage reduction, like the worm scarf