tModLoader Nihilism - Empties the game

Discussion in 'Released' started by hamstar, Jul 27, 2017.

  1. hamstar

    hamstar Steampunker



    Requires Mod Helpers


    Removes item recipes, mob spawns, item drops from mobs, and items. Configurable. Meant mainly for use by custom maps or mods. Players can enable or disable the mod on a per world basis via. chat commands (type /help for options).



    Usage

    To activate for a given world, type `/nih-on` in the chat.

    To clear the current blacklists and whitelists (e.g. the default samples), type `/nih-clear`.

    To blacklist a given item (e.g. Pumpkin Pie), type `/nih-item-blacklist-set Pumpkin Pie`.

    Type `/help` and scroll with the arrow keys to see the full list of commands (also seen here in the source code).



    Modders

    To use this with your mod, simply call the API functions like so (e.g. to permit only the use of a Gold Pickaxe):
    Code:
    class MyCustomModPlayer : ModPlayer {
      ...
    
      public override void OnEnterWorld( Player player ) {
        if( player.whoAmI == Main.myPlayer && this.player.whoAmI == player.whoAmI ) {
          Mod nihMod = ModLoader.GetMod("Nihilism");
          if( nihMod != null ) {
            bool localOnly = true;
            nihMod.Call( "SetItemWhitelistEntry", "Gold Pickaxe", localOnly );
          }
        }
      }
    
      ...
    }
    Source available here. API (also setters, clearers) now available.

    Available config fields are defined here. Config file: Documents/My Games/Terraria/ModLoader/Configs/Nihilism config.json


    [​IMG]

     
    Last edited: May 27, 2019
  2. hamstar

    hamstar Steampunker

     

    Attached Files:

    Last edited: May 27, 2019
    FiveSix78 likes this.
  3. Shabidoo

    Shabidoo Terrarian

    So if I've got this right. You can make an obstacle course map then use this mod to disable enemy spawns but white list the grappling hook so players will get an intrusion free run every time?
     
  4. hamstar

    hamstar Steampunker

    Yep. But you'll have to either make a simple mod to go with this to specifically implement these rules for the given world (in the way shown up top), or else adjust the mod's config file, which will put these specific settings onto all worlds you select the in-game option to enable nihilism for.

    Next version I want an in-line method to add per-world settings, if I can figure on a way to do this non-messily...
     
    Last edited: Jul 28, 2017
  5. Zombie1Kenobi

    Zombie1Kenobi Steampunker

    This is pretty neat for custom maps, good job!
    The only sort-of problem is that most people who know how to make a custom map probably don't know how to code a mod. (unless this mod's coding is so easy a kindergartner could do it, I'm very bad at coding).
     
  6. hamstar

    hamstar Steampunker

    Modding the settings is just making a glorified config file wrapper. In fact, if you have a config file you want to make into a mod to work with a specific world, just post it here and I'll do it quickly myself. Until an in-game option becomes available, that is.

    Edit:

    v1.3.0.1
    • Added mod icon
    • Added support for Hamstar Helpers v1.2.0 issue report
    • Refactored net protocol
     

    Attached Files:

    Last edited: Nov 20, 2017
    AlexanderStarship likes this.
  7. セフィロス

    セフィロス Skeletron Prime

    I just noticed we can only activate it once per world ? not toggle it ? . -. just killed my test world now xD or what i do missing here . -.
     
    Last edited: Nov 22, 2017
  8. hamstar

    hamstar Steampunker

    Yeah, that's how it's currently set. You can adjust the blacklists/whitelists freely, however.

    I'll add some better adjustment options for this, later.
     
    セフィロス likes this.
  9. hamstar

    hamstar Steampunker

    v1.3.1
    • Fixed issue with default settings being forced to apply (major issue)
    Edit:

    v1.3.2
    • Fixed UI positioning
    • UI code refactoring
     

    Attached Files:

    Last edited: Dec 18, 2017
  10. Sumenora

    Sumenora Plantera

    How Exactly does this work in multiplayer ? can i prevent players from using certain items strictly and they cant toggle it on or off while on my server for example?
     
    セフィロス and hamstar like this.
  11. Sumenora

    Sumenora Plantera

    im still highly confused how this works... can someone give a example?
     
  12. Sumenora

    Sumenora Plantera

    Whenever i try to run this mod in multiplayer i get stuck at "Requesting World information" Is this mod not multiplayer compatible?
     
    hamstar and セフィロス like this.
  13. hamstar

    hamstar Steampunker

    It shouldn't have any effect on multiplayer, but I there may be issues with the NetSend and NetReceive that I'm not aware of. I'll make a quick patch to see if this is fixable...

    Edit:

    v1.3.2.1
    • (Hopefully) fixed multiplayer loading hang issue
     

    Attached Files:

    Last edited: Dec 23, 2017
  14. Sumenora

    Sumenora Plantera

    Ahh it seems to work and i can get into my server in multiplayer but i also found another bug.

    [​IMG]

    It seems when a banned item is put into an chest it duplicates into your inventory in multiplayer.
     
  15. hamstar

    hamstar Steampunker

    v1.3.3
    • Fixed multiplayer item duplication glitch
    • Fixed configs not setting up with default values properly
    Because of a specific change I made, be on the lookout for item blocking failing in some odd specific context or another, and be sure to report it.
     

    Attached Files:

    セフィロス likes this.
  16. Sumenora

    Sumenora Plantera

    Oh i almost forgot i finally manage to get player to join my server to see if only the item in the chest is banned when he enters my server and this was the result.

    [​IMG]

    From the looks of it every item was banned when entering my world. my banned item list don't seem apply to him and he's pretty much was completely disabled. I was expecting only the revengense potion to be effected but all of the items were... meaning their is still major issues in multiplayer

    their should be a way to block items when players enter your server and only the items the host bans should be Effected.

    but this was before your update soo im not sure if it still applies... but it probably does.
     
    Last edited: Dec 24, 2017
  17. hamstar

    hamstar Steampunker

    Post your `Nihilism Config.json` content here. The default config actually does specify for all items to be disabled (except the Copper Pickaxe).
     
  18. Sumenora

    Sumenora Plantera

    This is what i had when i was doing the test....and i also asked my friend to send his to see if they were the same...it seems his was at "Default"? ...and mines was modified...if that matters.
     

    Attached Files:

  19. hamstar

    hamstar Steampunker

    If you're running the server, your config is the only one that should matter. I'll look into this.

    Edit: I'm unable to replicate this with local dedicated server hosting. My item whitelist updates correctly for my character upon joining an existing server, even when the client changes their config.
     
    Last edited: Dec 25, 2017
    セフィロス likes this.
  20. Goblin Turncoat

    Goblin Turncoat Terrarian

    Can the configs be edited directly or do all changes have to be made in the game via commands?

    Also, would it be possible to make it so the player can add new recipes through this mod? Is that even possible to do via modding? It's been my dream feature ever since using MineTweaker for Minecraft--combined with removing recipes (and items, mob spawns, mob drops, etc.) it's a great way to force mods to play nice together if the end user is willing to put in the effort.