Jump to content

Disable/Remove an entity (without replacing it)


LordJord

Recommended Posts

I'm looking for advice on how to go about removing an entity (for example Rabbits) from the game entirely without having them be replaced by some other entity.
The reason I need to achieve this is to make the game playable for my girlfriend who has a phobia of zombies. I know that zombies can be disabled in game however I would still like there to be an element of challenge. Currently I have edited entitygroups.xml to replace all zombies with rabbits. While this is playable with mods adding survivors and bandits it's a little weird to have rabbits all over the POI's... Is there a way I can just remove the zombies for good yet still allow modded enemies to spawn?

Link to comment
Share on other sites

There is really two options as far as I can see:

 

1) Replace each individual zombie entity in entitygroups with the model you want to take its place

 

2) Remove all existing zombie entitygroups and add your own to the same file as above

 

Biggest issue is if you have other mods that add custom entities to the game.  You can still do #1 above, but you might want to put your modlet at the end so the other mod loads first especially if it references zombie entries in the vanilla file in order to execute the changes.  You would also need to swap out any custom entities that you don't like form the mods that add in.

 

That's going to be a big task as there are something like 86 zombie entries (not counting animals) in the game

Link to comment
Share on other sites

Another option, specifically to deal with sleeper spawns, would be to use a /set on the actual block of the spawner to turn it into air instead of a spawner block. That would basically remove all sleeper spawn points with one little line of code.

Untested, but this should do what i'm talking about.

<set xpath="/blocks/block[contains(@name, sleeper)]">
	<property name="Tags" value="air"/>
	<property name="Material" value="Mair"/>
	<property name="Shape" value="Invisible"/>
	<property name="Texture" value="250"/>
	<property name="FilterTags" value="MC_outdoor,SC_terrain"/>
	<property name="SortOrder1" value="d0j0"/>
	<property name="SortOrder2" value="0050"/>
</set>

 

Link to comment
Share on other sites

On 9/19/2022 at 6:54 PM, Telric said:

Another option, specifically to deal with sleeper spawns, would be to use a /set on the actual block of the spawner to turn it into air instead of a spawner block. That would basically remove all sleeper spawn points with one little line of code.

Untested, but this should do what i'm talking about.

<set xpath="/blocks/block[contains(@name, sleeper)]">
	<property name="Tags" value="air"/>
	<property name="Material" value="Mair"/>
	<property name="Shape" value="Invisible"/>
	<property name="Texture" value="250"/>
	<property name="FilterTags" value="MC_outdoor,SC_terrain"/>
	<property name="SortOrder1" value="d0j0"/>
	<property name="SortOrder2" value="0050"/>
</set>

 

 

If this does what I think it does, then it would effectively remove spawning of anything inside a POI, whether it's a zombie or not. The world would be full of very empty buildings.

 

I think a better idea would be to replace the zombies with the special "none" entity:

 

<set xpath="//entitygroup/entity[starts-with(@name,'zombie')]/@name">none</set>

 

You should only do this after you replace any zombies with other entities that you think are OK, like animals or human NPCs.

 

But, there may be "gotchas." I know that if there are no entities in an entity group, the game will throw errors, but I don't know about only having "none" entities. Also, there are notes in the entityclasses.xml files about not having "none" be the first entity in the entity group, because that determines whether the entity group is an "enemy group" or not. (See the "EnemyAnimalsDesert" entity group.)

 

Incidentally - if you are replacing zombies in sleeper volumes with human NPCs, then you might be interested in a modlet I wrote called "Variable NPC Sleepers."

 

Assuming you're using NPCs that are based on the 0-XNPCCore modlet, it adjusts their behavior so that they behave more like vanilla zombies. If you don't use that modlet, then by default they become fully active when they spawn in, and end up wandering all over the place - this is especially bad if you accept "clear" missions from traders. The modlet is part of my thread here:

https://community.7daystodie.com/topic/27333-a20-khzmusiks-modlets/

 

Also, if you are substituting zombies with human NPCs, keep in mind that most human NPCs can't be spawned into hordes (wandering hordes or blood moon hordes). The entities in hordes are required to descend from a specific C# class, and most human NPCs don't, because that class has limited functionality. (My Whisperers entities are exceptions, but you probably don't want those since they look like zombies.) I'm in the process of making more enemy human NPCs right now, and I will try to make those also able to be spawned into hordes.

Edited by khzmusik (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...