• If you have a mod, tool or prefab, please use the Resources section. Click Mods at the top of the forums.

Help with modlet codes, new zombie to entitygroups.xml

Robeloto

Refugee
I am a bit embarrassed I need help with this...

If I want new zombies added to the entitygroups.xml and I want to insert this new zombie after a specific zombiename. How would I do it the easiest way?

<insertAfter xpath="/entitygroups/entitygroup/entity[@name=zombieMaleHazmat]" />

<entity name="zombieNewZombie" prob="0.1" />

</insertAfter>

I only know this much and it is not enough. Would really appreciate some help here.

 
Don't be embarrassed, it's a great question.

You'd have to repeat it for each instance of the hazmat Zed, unless someone knows how to do it for all matches.

 
Don't be embarrassed, it's a great question.
You'd have to repeat it for each instance of the hazmat Zed, unless someone knows how to do it for all matches.
Code:
<configs>

<insertAfter xpath="/entitygroups/entitygroup[@name='ZombiesWasteland']/entity[@name='zombieMaleHazmat']">
	<entity name="zombieNewZombie" prob="0.1" />
</insertAfter>
</configs>
Like this?

And I would do it for every group, including sleepers and feralhordestages etc? There is no better way? :o

Thanks btw, I am a bit new to this modlet thingy. :) Can I add another simple question in same thread maybe? If I add this electric sound the normal way, it has sound, but if I add it using the modlet way, there is no sound. What can be the cause of that?

edit:

I tried using notepad++ code. But I guessed that does not work with xpather.

https://7daystodie.com/forums/showthread.php?75377-Notepad-tip-Insert-custom-zombies-to-all-Gamestages-Bloodmoons-easy

But there must exist a similiar way to do this using xpath?

 
Last edited by a moderator:
Yeh, every group. I use custom sounds on my vehicle mod, check it out and see how it compares to what you'e doing for sounds.

 
Yeh, every group. I use custom sounds on my vehicle mod, check it out and see how it compares to what you'e doing for sounds.
It is the same sounds from the game.

<property name="Sound_warning" value="hulkvomitwarning"/>

<property name="Sound_start" value="hulkvomitattack"/>

The first sound_warning value works, but the property Sound_start value does not work. It is just silent. Does not matter which sound I use at sound_start. It will always be silent. If I do it the normal way it does work, but not with modlet. Why is that?

 
This might get you close, if you are trying to add zombieNewZombie to each entitygroup that has a zombieMaleHazmat in it. You don't need to put a condition on the entitygroup if you are targeting them all.

Code:
<configs>

<insertAfter xpath="/entitygroups/entitygroup/entity[@name='zombieMaleHazmat']">
	<entity name="zombieNewZombie" prob="0.1" />
</insertAfter>
</configs>
 
Could we not do this using the [contains(@name='zombieMaleHazmat') ?

Code:
<insertAfter xpath="/entitygroups/entitygroup/entity[contains(@name, 'zombieMaleHazmat')]">
   <entity name="zombieNewZombie" prob="0.1" />
</insertAfter>
 
Last edited by a moderator:
Could we not do this using the [contains(@name='zombieMaleHazmat') ?

Code:
<insertAfter xpath="/entitygroups/entitygroup/entity[contains(@name, 'zombieMaleHazmat')]">
   <entity name="zombieNewZombie" prob="0.1" />
</insertAfter>
It'd be equivallent to what I wrote, with the exception of extra overhead while it tries to do a character compare with the contains, rather than just a straight string compare. It's equivalent, but I don't feel contains() is necessary here.

 
This might get you close, if you are trying to add zombieNewZombie to each entitygroup that has a zombieMaleHazmat in it. You don't need to put a condition on the entitygroup if you are targeting them all.

Code:
<configs>

<insertAfter xpath="/entitygroups/entitygroup/entity[@name='zombieMaleHazmat']">
	<entity name="zombieNewZombie" prob="0.1" />
</insertAfter>
</configs>
Cool, thanks for the tip! :)

 
Back
Top