Mini Albert
Eye of Cthulhu
Calm down. Just have some patience like the moderator said...Can you give a spammer some warning points too? ... He was spamming.. Don't just ask.. you know spammers won't stop when you just ask them.. (my experience)
Delete the .tmod file. It shouldn't crash though, what mistake was it (that you made)?Edit:
1. I fix the mistakes yesterday and after it i got again error messenges with crash.
Last edited:
1. Can you show me the error message? All of those kinds of bugs should have been fixed by now.1. Yesterday i have some mistakes in my pngs and terria crashed at build. After a fix and restart it shows me the errormessage. Today after a try with the example pngs and again with my pngs (the same files from yesterday) it works. So i don't know why. I don't change anything from the code.
2. I know this, but i don't want to use all mods everytime and if i want only some mods i have to disable all other by hand. A Example: when i have a group of 11 mods to make the game easy and a secound group with 12 mods to make the game harder then i don't want both at the same time.
3. Oh is a example anywhere or somehing else?
Edit:
1. I fix the mistakes yesterday and after it i got again error messenges with crash.
2. Oh, I see. So basically you want to be able to enable/disable groups of mods at once. We will consider that for the future.
3. There isn't an example. Basically, Terraria doesn't actually have strict biomes; it just has blocks that makes some NPCs valid for spawning, etc., and enough of those blocks changes the music and background, makes items drop, etc. All of those are possible except the music and background right now.
It shouldn't be necessary to delete the file (there's a modName.enabled file whose text you can set to false, and if it doesn't exist you can create it).Delete the .tmod file. It shouldn't crash though, what mistake was it (that you made)?
Manny-mammut
Terrarian
Über das Ende des Datenstroms hinaus kann nicht gelesen werden.
bei System.IO.BinaryReader.ReadByte()
bei System.IO.BinaryReader.Read7BitEncodedInt()
bei System.IO.BinaryReader.ReadString()
bei Terraria.ModLoader.ModLoader.LoadMod(String modFile, BuildProperties properties)
bei Terraria.ModLoader.ModLoader.LoadMods()
bei System.IO.BinaryReader.ReadByte()
bei System.IO.BinaryReader.Read7BitEncodedInt()
bei System.IO.BinaryReader.ReadString()
bei Terraria.ModLoader.ModLoader.LoadMod(String modFile, BuildProperties properties)
bei Terraria.ModLoader.ModLoader.LoadMods()
2. Yes
3. So i need only a start Trigger, a method for changing a block, and a repeate Trigger?
Fabsol
The Destroyer
One more thing. My only error with all my current items (around 35 or so) is this:
c:\Users\MountainDrew\Documents\my games\Terraria\ModLoader\Mod Sources\CalamityMod\Items\Weapons\Galeforce.cs(37,37) : error CS0117: 'Terraria.ID.ProjectileID' does not contain a definition for 'Arrows'
No definition for Arrows? What? I've tried "Arrows, Arrow, arrows, and arrow", none of them worked. I'm sorry if this is a stupid question, but I have no idea what the projectile ID for arrows is.
c:\Users\MountainDrew\Documents\my games\Terraria\ModLoader\Mod Sources\CalamityMod\Items\Weapons\Galeforce.cs(37,37) : error CS0117: 'Terraria.ID.ProjectileID' does not contain a definition for 'Arrows'
No definition for Arrows? What? I've tried "Arrows, Arrow, arrows, and arrow", none of them worked. I'm sorry if this is a stupid question, but I have no idea what the projectile ID for arrows is.
Eldrazi
Eater of Worlds
There is no such thing as a normal arrow in the ProjectileID class. The most basic would be 'ProjectileID.WoodenArrowFriendly'...One more thing. My only error with all my current items (around 35 or so) is this:
c:\Users\MountainDrew\Documents\my games\Terraria\ModLoader\Mod Sources\CalamityMod\Items\Weapons\Galeforce.cs(37,37) : error CS0117: 'Terraria.ID.ProjectileID' does not contain a definition for 'Arrows'
No definition for Arrows? What? I've tried "Arrows, Arrow, arrows, and arrow", none of them worked. I'm sorry if this is a stupid question, but I have no idea what the projectile ID for arrows is.
Starblaster11
Golem
Lol you beat me to it. I think this is the second time too lol.There is no such thing as a normal arrow in the ProjectileID class. The most basic would be 'ProjectileID.WoodenArrowFriendly'...
Eldrazi
Eater of Worlds
They call me 'The Ninja' for a reason... WHATAAAA!Lol you beat me to it. I think this is the second time too lol.
But seriously, @MountainDrew why would you try to access an ProjectileID arrow in 35 item scripts?
Fabsol
The Destroyer
They call me 'The Ninja' for a reason... WHATAAAA!
But seriously, @MountainDrew why would you try to access an ProjectileID arrow in 35 item scripts?
I dunno, I was probably drunk when I wrote that
And it was just one item/weapon that was having that issue, and I'm still trying to learn how to code this stuff (I started my first C# coding course this semester). But I've fixed it now, thanks
Using Visual Studios and referencing the exe or looking here for reference (https://github.com/bluemagic123/tModLoader/wiki/Vanilla-Projectile-IDs) will be of help for you.I dunno, I was probably drunk when I wrote that
And it was just one item/weapon that was having that issue, and I'm still trying to learn how to code this stuff (I started my first C# coding course this semester). But I've fixed it now, thanks![]()
1. Hm, that's pretty weird. It's hard to tell why that would be happening. What do you mean by the png not being correct?1. Ok normaly it works (with code errors), but if the png isn't correct Terraria chrashed (texture errors). When im start Terraria again it's show me the errormessage.Über das Ende des Datenstroms hinaus kann nicht gelesen werden.
bei System.IO.BinaryReader.ReadByte()
bei System.IO.BinaryReader.Read7BitEncodedInt()
bei System.IO.BinaryReader.ReadString()
bei Terraria.ModLoader.ModLoader.LoadMod(String modFile, BuildProperties properties)
bei Terraria.ModLoader.ModLoader.LoadMods()
2. Yes
3. So i need only a start Trigger, a method for changing a block, and a repeate Trigger?
3. What do you mean? All you need at the moment is to check for the block's type during NPC spawning, check how many blocks of that type are near the player when an item drops (optional), and the ModTile.RandomUpdate hook for spreading (optional).
Fabsol
The Destroyer
Using Visual Studios and referencing the exe or looking here for reference (https://github.com/bluemagic123/tModLoader/wiki/Vanilla-Projectile-IDs) will be of help for you.
Oh wow...I really should've found that page a long time ago. I've been using bluemagic's other guides but I never found that one.
Thanks
selectivemadcop
Official Terrarian
I'm just looking at one place and copying I have no idea how to C# code lol
The Mythical Dagger
Skeletron
Not quite a good thing to do. Copy and pasting doesn't help somebody when they want a unique item! I would recommend taking a look at Microsoft Virtual Academy (The site appears to be a bit buggy at times, but it should work). From what I saw of the site, it is free to use, and even comes with a skills assessment or task for each unit. I'd highly recommend that you (Or anyone else who needs to learn C#) take a peek at it!I'm just looking at one place and copying I have no idea how to C# code lol
Also, my reasoning for saying the above: Coding from an API may be easier in the short-game (Even without knowing about programming), but if you want to expand functionality beyond the basics, and create much more complex objects, such as a well done, innovative AI, or unique functionality, you should learn the language. By copy-pasting things, you lose all originality, and that is just plain boring when done ad infinitum.
Also, from my experiences, C# is not that difficult to learn - It's modern, it's syntax is very refreshing and simple, and is fairly easy to access (Unless you run OS X, like me); and think about it, nothing hurts anyone from learning something new (As a matter in fact, I'm an avid supporter of making Computer Science a required credit for both High School and College
___________________________
NOT REGARDING ANYBODY IN PARTICULAR, JUST A BIT OF INSPIRATION FOR ANYBODY!
And a note (And a bit of inspiration for any other young programmers) regarding any chances of "Age discrepancies": AGE DOES NOT MATTER (Except for legal obligations). For example, I started learning Java when I was 10, and over the course of five years (Up to this very day, of 15 years of age), I've managed to learn HTML/CSS, PhP, JavaScript, jQuery, C#, C++, Python, Lua, and, my personal favorite, Swift, and can program in these rather fluently. So as you can see, age means nothing. It is just a number. Don't let something with no real limitations halt you from something so empowering! Do not let anybody else stand in your way either; and the converse, let others help and support you (And expand your friend base perhaps)! For example, I have had a real fortunate set of friends over the years - especially in High school. They have been supportive of me, and have truly pushed myself to where I am today. I must say, I really do owe it all to them. As a result, I can say that, getting to know others is one of the most important parts of programming. So I say this as if fact, the true catalysts for becoming an efficient programmer: strong relationships and bonds, and having an imagination. At times you may fail, but get back up, and, try and try again!
zadum4ivii
Official Terrarian
I have 2 questions:
1. How to change the spawn postion of the NPC in this code?
With this code it spawns in random location.
2. I have 2 bosses that spawn at the same time. How to make the items drop from the boss that was killed last (Like Twins)?
1. How to change the spawn postion of the NPC in this code?
Code:
public override bool UseItem(Player player)
{
NPC.SpawnOnPlayer(player.whoAmI, mod.NPCType("mob"));
Main.PlaySound(15, (int)player.position.X, (int)player.position.Y, 0);
return true;
}
2. I have 2 bosses that spawn at the same time. How to make the items drop from the boss that was killed last (Like Twins)?
Starblaster11
Golem
Another thing I used (and I'm using again to relearn the syntax) is the tutorials point C# tutorial. http://www.tutorialspoint.com/csharp/index.htmI'm just looking at one place and copying I have no idea how to C# code lol
Eldrazi
Eater of Worlds
Dude (I don't often use that term), if I didn't already know how to program, I'd look some tuts up right now! Really Nice motivational speach and ever so true. I starten when I was 11-12 but was so enthousiastic about the whole programming that I soon searched for some tuts as to how to go about it.Not quite a good thing to do. Copy and pasting doesn't help somebody when they want a unique item! I would recommend taking a look at Microsoft Virtual Academy (The site appears to be a bit buggy at times, but it should work). From what I saw of the site, it is free to use, and even comes with a skills assessment or task for each unit. I'd highly recommend that you (Or anyone else who needs to learn C#) take a peek at it!
Also, my reasoning for saying the above: Coding from an API may be easier in the short-game (Even without knowing about programming), but if you want to expand functionality beyond the basics, and create much more complex objects, such as a well done, innovative AI, or unique functionality, you should learn the language. By copy-pasting things, you lose all originality, and that is just plain boring when done ad infinitum.
Also, from my experiences, C# is not that difficult to learn - It's modern, it's syntax is very refreshing and simple, and is fairly easy to access (Unless you run OS X, like me); and think about it, nothing hurts anyone from learning something new (As a matter in fact, I'm an avid supporter of making Computer Science a required credit for both High School and College). A skill such as programming is also extremely vital in the Information Age - and that is unlikely to change.
___________________________
NOT REGARDING ANYBODY IN PARTICULAR, JUST A BIT OF INSPIRATION FOR ANYBODY!
And a note (And a bit of inspiration for any other young programmers) regarding any chances of "Age discrepancies": AGE DOES NOT MATTER (Except for legal obligations). For example, I started learning Java when I was 10, and over the course of five years (Up to this very day, of 15 years of age), I've managed to learn HTML/CSS, PhP, JavaScript, jQuery, C#, C++, Python, Lua, and, my personal favorite, Swift, and can program in these rather fluently. So as you can see, age means nothing. It is just a number. Don't let something with no real limitations halt you from something so empowering! Do not let anybody else stand in your way either; and the converse, let others help and support you (And expand your friend base perhaps)! For example, I have had a real fortunate set of friends over the years - especially in High school. They have been supportive of me, and have truly pushed myself to where I am today. I must say, I really do owe it all to them. As a result, I can say that, getting to know others is one of the most important parts of programming. So I say this as if fact, the true catalysts for becoming an efficient programmer: strong relationships and bonds, and having an imagination. At times you may fail, but get back up, and, try and try again!
Anyway, to get to the point: very good post!
bafo
Terrarian
I have 2 questions:
1. How to change the spawn postion of the NPC in this code?
2. I have 2 bosses that spawn at the same time. How to make the items drop from the boss that was killed last (Like Twins)?
1. That code spawns them in random positions intended for boss fights. If you want to be more specific about where you spawn them, use a different method that uses the x and y positions, and put these positions relative to the player.
2. Use a conditional to check whether the other boss is dead before spawning any loot, and do the same for the other boss.
I have a few questions.
- Is there a way to load a custom (mp3) sound for the firing of a weapon? if not, is there a place I can look at a list of all the sounds and their ids?
- What usestyle should I use to get a gun to be held under the arm, and if possible from about halfway?
- How would I get a custom projectile to rotate, depending on the angle it's fired from the gun?
- How do I control how long the burst of shooting is?
Last edited:
zadum4ivii
Official Terrarian
Can you give me an example for a second answer please?1. That code spawns them in random positions intended for boss fights. If you want to be more specific about where you spawn them, use a different method that uses the x and y positions, and put these positions relative to the player.
2. Use a conditional to check whether the other boss is dead before spawning any loot, and do the same for the other boss.
Similar threads
- Replies
- 39
- Views
- 21K
- Replies
- 5
- Views
- 1K
- Replies
- 893
- Views
- 888K
- Replies
- 0
- Views
- 456
- Sticky
- Replies
- 270
- Views
- 257K
-
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.