[1.4.4.9] TerrariaPatcher (plugins and more!)

I think it would be a good addition, but it's your decision on whether to add that sort of thing. The other way of doing it that I was thinking of is actually dropping the loot directly based on a Main.rand.Next() call that is different depending on the drop rate you set with O/P. That's why it would be complicated, because you'd have to do it for each drop, and it would make the code huge.

The thing is, with simply calling NPCLoot() times the drop rate factor, it could end up still being no drop. It's just the way RNG works. I could, however, increase the number of times NPCLoot() is called per drop rate factor.

If it were me, I would add the hook for NPCLoot(). It would be pretty cool to have a drop rate plugin :).
We'll see :) Maybe sometime soon.

v1.2.0.5: Added plugin support for IPluginPlayerQuickBuff.
 
I downloaded the mod, and when I try to open it a thing pops up that says this may run your computer at risk... It isn't even my antivirus program, it's Windows 8... How do I fix this?
 
I downloaded the mod, and when I try to open it a thing pops up that says this may run your computer at risk... It isn't even my antivirus program, it's Windows 8... How do I fix this?
windows 8 user here, instead of clicking ok, you click on more details, then run anyways.
 
Windows protected my PC from an unknown danger when I tried to run it. Please check for things that look evil :eek:
[DOUBLEPOST=1437404591,1437404365][/DOUBLEPOST]
windows 8 user here, instead of clicking ok, you click on more details, then run anyways.
I'm suspicious.... :redmunch:
 
Windows protected my PC from an unknown danger when I tried to run it. Please check for things that look evil :eek:
[DOUBLEPOST=1437404591,1437404365][/DOUBLEPOST]
I'm suspicious.... :redmunch:

windows likes to overreact. there are better means to check if something's actually gonna hack up your compy.
 
Windows protected my PC from an unknown danger when I tried to run it. Please check for things that look evil :eek:
[DOUBLEPOST=1437404591,1437404365][/DOUBLEPOST]
I'm suspicious.... :redmunch:
If you think about it.. your anti-virus is doing a good job because my patcher is modifying an existing executable. This could be considered very malicious if it was happening without your consent. Imagine if a malicious piece of software got on your computer and started modifying all your existing programs.. It would be very tough to deal with. But given that you know the nature of what you're downloading.. you are safe to disable your anti-virus.

Found something. By typing "/npc pinky 10", the game crashes.
I'll look into it.

Quick fix until next version comes out.. Modify NPC.cs plugin at the bottom like so:
Code:
            for (int i = 0; i < count; i++)
            {
                if (npcId < 0)
                    Main.npc[Terraria.NPC.NewNPC(x, y, 1)].netDefaults(npcId); // special slime
                else
                    Terraria.NPC.NewNPC(x, y, npcId);
            }
 
Last edited:
If you think about it.. your anti-virus is doing a good job because my patcher is modifying an existing executable. This could be considered very malicious if it was happening without your consent. Imagine if a malicious piece of software got on your computer and started modifying all your existing programs.. It would be very tough to deal with. But given that you know the nature of what you're downloading.. you are safe to disable your anti-virus.


I'll look into it.

Quick fix until next version comes out.. Modify NPC.cs plugin at the bottom like so:
Code:
            for (int i = 0; i < count; i++)
            {
                if (npcId < 0)
                    Main.npc[Terraria.NPC.NewNPC(x, y, 1)].netDefaults(npcId); // special slime
                else
                    Terraria.NPC.NewNPC(x, y, npcId);
            }

Okay, thanks for the answer!
 
This is amazing! Not to sound dumb, but I have no idea how to use this, could you make a little tutorial for it?
So far all I want to do is change the stacksize of certain things (glowsticks and bombs), so nothing big.
After adding the ItemConf.cs to Terraria/Plugins directory, it will create Terraria/Plugins/ItemConf.ini file the next time game starts (or you can make one by yourself). You can add INI "sections" to that file to create modification rules for items. For example, to change glowstick and bomb max stack sizes to 999, you would add
Code:
[item282]
maxStack=999
[item166]
maxStack=999
(282 and 166 are item IDs for glowstick and bomb accordingly)
to the file. It will recognize the changes next time the game is started.
(you can also see my other explanation)
 
Hmm... I'm having trouble compiling the source code. What exactly are the steps to doing that? I'm testing out my addition of an NPCLoot() hook xD.

More info:
It's telling me that Terraria.Map.MapHelper is inaccessible due to its protection level, but I see you've got a 'MakeTypePublic' thingy. I tried adding 'using Terraria.Map;' to the top of Teleport.cs, but that doesn't work.

Am I missing something?

Also it's telling me there are doubled Guid/ComVisible/etc attributes... Am I not supposed to include the Plugins folder in the solution?
 
Hmm... I'm having trouble compiling the source code. What exactly are the steps to doing that? I'm testing out my addition of an NPCLoot() hook xD.

More info:
It's telling me that Terraria.Map.MapHelper is inaccessible due to its protection level, but I see you've got a 'MakeTypePublic' thingy. I tried adding 'using Terraria.Map;' to the top of Teleport.cs, but that doesn't work.

Am I missing something?

Also it's telling me there are doubled Guid/ComVisible/etc attributes... Am I not supposed to include the Plugins folder in the solution?
Either unload the Plugins project so it doesn't get compiled or..
  1. Delete the existing Terraria reference in the plugins project.
  2. Patch your Terraria with plugin support.
  3. Add reference to patched Terraria.exe.
This way you get the effects of MakeTypePublic.
 
Ah, ok. It looks like I might have to install a newer version of Visual Studio as well... VS 2010 doesn't support .NET Framework 4.5 :/. Lol.
 
Back
Top Bottom