tModLoader Metroid Mod

But the reason I haven't made these unique distinctions between Missiles and Beams is because it brings into question how vanilla stuff is also handled. Are vanilla rockets also affected by Nightmare's gravity? Or maybe even bullets as well? Of course, energy or magic based stuff would ignore it. But then I'd have to extensively write specific checks for what is or isn't affected, and it's kind of a headache. I may end up doing it anyway, but it's not very high on my list of things to tweak.
Maybe check what damage type the projectile is, like say, ranged or magic? That in itself is not exactly a solid fit all solution, especially for the very few energy based ranged projectiles like flamethrower projectiles or solid magic projectiles like the Staff of Earth. But it would help give some solid ground for players to expect specific behaviors. Then again, what also isn't great about this is that it would effectively punish ranged users over magic users for no real good reason. And then there's melee projectiles like sword beams and yoyos, heck, even spears. And then minions, some who work on contact damage, others, shooting projectiles. Maybe there isn't a good one size fits all solution for this. If projectiles had tags for what "element" type they are, that would be great, but sadly, we don't have that.
As someone who also does a bit of coding I 100% understand what you feel.
That's the "fun" part about coding, overlooking something really simple. It happens and sometimes I've spent hours on code till finding simple solutions worked. And then questioning my coding skills. Often a second pair of eyes or even looking at the code another time greatly helps because you can easily become tunnel vision to your own code and look at what you think the code should be, rather than what the code actually is.
 
Hey, crumble blocks don't seem to be working. They place 9 blocks down and to the right. Aside from that they also don't seem to function at all, can't get the block it's supposed to be on or the one it appears to be on to deactivate.
 
Last edited:
so, i got curious to see how the mod could hold up against revengence mode calamity stuff.... gotta say, i have a even greater new found respect for the power this mod gives you. can't beat the mods post moon lord stuff more likely than not, but it gets you farther than i was expecting. like... i think DoG (devourer of gods) would probably hard stop you, but my god.... i might do a full run through of calamity vs the metroid mod.

great freaking job man.
 
i dont think you saw my comment asking about it about it last time.
but scoot do you have any tutorials on modding terraria that you could like to share?

i want to make fully functioning bsl security hatches
with matching switches that trigger an unlocked or locked state in all the matching doors
 
i dont think you saw my comment asking about it about it last time.
but scoot do you have any tutorials on modding terraria that you could like to share?

i want to make fully functioning bsl security hatches
with matching switches that trigger an unlocked or locked state in all the matching doors


heh i am so sorry about the double post
my internets acting up
 
i dont think you saw my comment asking about it about it last time.
but scoot do you have any tutorials on modding terraria that you could like to share?

i want to make fully functioning bsl security hatches
with matching switches that trigger an unlocked or locked state in all the matching doors
I don't have any tutorials, but I think I can help. How much programming experience do you have?

I think the best way to go about doing this is to set up a Mod World variable (kinda like a boss downed flag, except not tied to a boss), and create a simple tile that, when right clicked, toggles the variable between true and false (this would be your trigger tile for unlocking all doors).
Then for the doors themselves, just check whether that Mod World variable is true before allowing the doors to be opened.

Your code may look something like this:
This goes into your mod world file. Or into MWorld.cs, as I assume you're modifying the Metroid Mod. But I'll make this sorta generalized just in case.
Hopefully its clear as to what goes where.
Code:
using Terraria;

namespace YourModName
{
	public class YourModWorld : ModWorld
	{
		public static bool UnlockSecurityLevel1 = false;

		public override TagCompound Save()
		{
			return new TagCompound {
				{"UnlockSecurityLevel1", UnlockSecurityLevel1}
			};
		}
		public override void Load(TagCompound tag)
		{
			UnlockSecurityLevel1= tag.Get<bool>("UnlockSecurityLevel1");
		}
	}
}
This would go into your switch tile.
Code:
		public override bool NewRightClick(int i, int j)
		{
			//there's two ways you can do this. The first is to toggle it between true and false each time its right clicked, like so:
			YourModWorld.UnlockSecurityLevel1 = !YourModWorld.UnlockSecurityLevel1;

			//or you can simply set it to true, which should be obvious how to do, but I'll show it just to avoid confusion:
			YourModWorld.UnlockSecurityLevel1 = true;
			return true;
		}
Sorta similar to the switch tile, as we'll be using the same NewRightClick method. Not sure if this will work if you're making an actual door based on the ExampleDoor in the ExampleMod.
Code:
		public override bool NewRightClick(int i, int j)
		{
			if(YourModWorld.UnlockSecurityLevel1)
			{
				HitWire(i, j); // this is the function that the hatches in the Metroid Mod run normally. You may use different code if you'd prefer.
				return true;
			}
			return false;
		}
This is all pseudo code, mind you, meaning it's incomplete and you'll need to fill in the blanks. Hopefully I've explained everything well enough.
 
thats exactly how i was thinking about doing it (thanks for the examples though as those will come in handy)
my problem though is that ive got about zip in coding experience
 
oh
with the missiles thing
couldnt you add a check like how you did beam hits on hatches in MGlobalProjectile.cs?

Code:
if (projectile.Name.Contains("XXXX")) replace XXXX with things like rocket missles etc etc
    then apply the gravity effect
 
I had a strange question. I know the power beam has its own damage type (Hunter) , but is it boosted by stuff that boosts ranger damage? I noticed that it wants to roll ranger modifiers, so I was curious if boosting my ranger damage would also boost my power beam's damage, its hard to tell if it is affected or not.
 
I installed the "Various Climates" mod and a 100 km / h hurricane occurred. He was so strong that he took an entire frozen area with him, but only the ice from the missile Ice Spreader KKKK. Laughing a lot at that KKKKKKKKKKK.
Ice Spreader Bugado.gif
 
Last edited:
Back
Top Bottom