tModLoader Official tModLoader Help Thread

How can I make dusts that spawn orbit around the player? And is it possible to have wings with more than 4 frames?
That'd be in the dusts' Update() hook. Then, you have to make AI for it. I can't really explain more.
For the wings, I think I've heard that's with PreDraw() and return false and code the wings' animation. I don't have an example, though.
 
You don't need to put it in Sounds/Music, you can put it anywhere you like :)
And if you don't know, put that in the SetDefaults of the NPC.
You can't put it anywhere you like, you should put it in Sounds/Music since that's the slot it'll be using and where tML will look if you are using the default autoloading properties.
That'd be in the dusts' Update() hook. Then, you have to make AI for it. I can't really explain more.
For the wings, I think I've heard that's with PreDraw() and return false and code the wings' animation. I don't have an example, though.
How can I make dusts that spawn orbit around the player? And is it possible to have wings with more than 4 frames?
Currently, custom framing for wings isn't supported. *sad face* Possibly in the future.
You can look at how ExampleMod's Example Shield rotates around the player for similar effects for the dusts. It might give you a clue anyway.
[doublepost=1470833211,1470833156][/doublepost]
Yeah I fixed it!
Now is it possible to make wings semi transparent?
Yes. But currently I still need to test myself if I've done it right. If you can send or pm me the texture I could try my method out for you, if it works I'll share it.
 
You can't put it anywhere you like, you should put it in Sounds/Music since that's the slot it'll be using and where tML will look if you are using the default autoloading properties.


Currently, custom framing for wings isn't supported. *sad face* Possibly in the future.
You can look at how ExampleMod's Example Shield rotates around the player for similar effects for the dusts. It might give you a clue anyway.
[doublepost=1470833211,1470833156][/doublepost]
Yes. But currently I still need to test myself if I've done it right. If you can send or pm me the texture I could try my method out for you, if it works I'll share it.
I'm not on my laptop right now so I can't send you the wings.png. You can use some of the vanilla textures instead.
Also, is this the part that makes it orbit?
Code:
            if (projectile.ai[0] > 0f)
            {
                float offset = (projectile.ai[0] - 1f) / (modPlayer.elementShields - 1);
                float rotation = modPlayer.elementShieldPos / 300f + offset;
                rotation = (rotation % 1f) * 2f * (float)Math.PI;
                projectile.position += 160f * new Vector2((float)Math.Cos(rotation), (float)Math.Sin(rotation));
                projectile.rotation = -rotation;
            }
 
I'm not on my laptop right now so I can't send you the wings.png. You can use some of the vanilla textures instead.
Also, is this the part that makes it orbit?
Code:
            if (projectile.ai[0] > 0f)
            {
                float offset = (projectile.ai[0] - 1f) / (modPlayer.elementShields - 1);
                float rotation = modPlayer.elementShieldPos / 300f + offset;
                rotation = (rotation % 1f) * 2f * (float)Math.PI;
                projectile.position += 160f * new Vector2((float)Math.Cos(rotation), (float)Math.Sin(rotation));
                projectile.rotation = -rotation;
            }
Yes.
 
Guys, I have a question, do you know if there is a way to add "air acceleration" while in the air ? I would like my character to be able to accelerate to ground max speed ( 102 mph in my case ) while in the air, similarly to Sun wings.
 
can anyone give me the code for a weapon like the clockwork assault rifle? But not fully auto.

I am trying to make a glock(like in CS:GO)

If possible also how could I have it switch between firing types?
Thx <3
 
Does anyone know how to find code from vanilla items, like sniper scopes zoom, or vampire knives lifesteal? If i knew how, I wouldn't have to rely on forums so much.
 
Can someone answer my question? How would I make an item with Cthulhu dash deal more than 30 damage? And what would I do to make the dash inflict a buff on enemies?
How do you remake the effects of the Shield of Cthulhu.
player.canDash2 = true gives you the ability to Cthulhu dash, I think. I can't check, as I'm on mobile right now.
 
Last edited:
@Eldrazi :
do you know if there is a way to add "air acceleration" while in the air ? I would like my character to be able to accelerate to ground max speed ( 102 mph in my case ) while in the air, similarly to Sun wings.
 
What would be the item ID for "Any Iron Bar"?

EDIT: As in, how to make something crafted with iron or lead, like a trapdoor or a mech boss summoning item, for example.
 
Guys small question, how do you make a weapon animation like the arkhalis ? from what I understood, it's like a static melee staff with a bigger hitbox and an animation.
I really would love to know how to do that...

Second question, I tried all sorts of things, is there even a way to "accelerate" and modify "air top speed" ? I want my char to be able to fluidly change directions in midair and accelerate at high speeds..

Lastly, what do I exactly need for a minion, the example minion isn't really clear about which class I need, in my case I want to do a melee minion, but there is a catch, it generates an electro shield every n amount of time around it, which is what will actually damage the enemy ( to avoid piercing cooldown ) and will launch homing projectiles.
What I need to know is how do I do a "homing" npc + buff combo in the first place and how to make a projectile follow the minion ( the shield ).

Other useful things I would like to know how it works :
-disabling piercing cool down
-passive mana regen ( doesn't seem to work, while code is correct and literally is a copy of my health regen code )
-Weapon burst fire
 
Guys small question, how do you make a weapon animation like the arkhalis ? from what I understood, it's like a static melee staff with a bigger hitbox and an animation.
I really would love to know how to do that...

Second question, I tried all sorts of things, is there even a way to "accelerate" and modify "air top speed" ? I want my char to be able to fluidly change directions in midair and accelerate at high speeds..

Lastly, what do I exactly need for a minion, the example minion isn't really clear about which class I need, in my case I want to do a melee minion, but there is a catch, it generates an electro shield every n amount of time around it, which is what will actually damage the enemy ( to avoid piercing cooldown ) and will launch homing projectiles.
What I need to know is how do I do a "homing" npc + buff combo in the first place and how to make a projectile follow the minion ( the shield ).

Other useful things I would like to know how it works :
-disabling piercing cool down
-passive mana regen ( doesn't seem to work, while code is correct and literally is a copy of my health regen code )
-Weapon burst fire
You should honestly just decompile or at least look into the source code with ILSpy or whatever.
 
I have seen the source code once but never used it as a reference..
Though any helpful advises / tips / help to give please ^^ ?
The first 2 questions are REALLY important in my case ^^''
 
Back
Top Bottom