Jump to content

re-spawning eggs in nests


bobrpggamer

Recommended Posts

So I have loot re-spawn very 20 days which is really not necessary and the items do not re-spawn anyway for some reason. The settings started it at 3 days automatically so i went with 20 days, to be a little fairer.

 

However the birds nest eggs re-spawn make sense in the real world as birds are always laying new eggs occasionally during their life.

 

So is there a mod (modlet) to have bird nests re-spawn feathers and eggs occasionally (outside of the built in loot re-spawn in the settings)? Say randomly every 10 days or so?

Link to comment
Share on other sites

I've seen modlets to change the chance of eggs dropping (and increasing quantities), but I don't recall seeing one that had a different loot schedule.

 

In the case of bird nests, they are setup as the class "Loot"; which based on my limited technical knowledge, handles the loot settings (so if you change the UI setting from every 7 days to never, then all containers with the class "Loot" would not respawn their loot).

 

In order to separate it from the normal loot schedule, you would need to create a new class (for example, Loot2) and then code on how the game sets that loot schedule.

 

Another approach (and this was done in Darkness Falls) is to tie something to PlantsGrowing.  Khaine did it for his chicken coops.  In theory, with a bit of code changes you can change the bird nests to behave like crops where they would change until they are harvestable.  Then when you harvest them, they return back to the beginning state like they did in Alpha 19.

 

If nobody else comes in with a modlet that does exactly what you want, I might have something in a day or two that changes bird nests to behave like crops where you can harvest them after x time.  I might even write up the code today during my break at work so I can start testing it at night.

 

 

Link to comment
Share on other sites

26 minutes ago, BFT2020 said:

I've seen modlets to change the chance of eggs dropping (and increasing quantities), but I don't recall seeing one that had a different loot schedule.

 

In the case of bird nests, they are setup as the class "Loot"; which based on my limited technical knowledge, handles the loot settings (so if you change the UI setting from every 7 days to never, then all containers with the class "Loot" would not respawn their loot).

 

In order to separate it from the normal loot schedule, you would need to create a new class (for example, Loot2) and then code on how the game sets that loot schedule.

 

Another approach (and this was done in Darkness Falls) is to tie something to PlantsGrowing.  Khaine did it for his chicken coops.  In theory, with a bit of code changes you can change the bird nests to behave like crops where they would change until they are harvestable.  Then when you harvest them, they return back to the beginning state like they did in Alpha 19.

 

If nobody else comes in with a modlet that does exactly what you want, I might have something in a day or two that changes bird nests to behave like crops where you can harvest them after x time.  I might even write up the code today during my break at work so I can start testing it at night.

 

 

Well the modlet to change the chanced of egg droppings would be nice. Can you send me a link? I searched for nests and I believe a for eggs, but could not find one.

 

I f you could come up with a code to edit I would be grateful. I am coding and scripting illiterate and cannot really do anything without complete instructions.

Link to comment
Share on other sites

Use an existing modlet as an example, copy this code into a loot.xml file

<config>
<!-- ************************************************** Changing egg loot rate in nests  ************************************************** -->

<!--  Vanilla 7D2D is medLow.  Choices are:
    veryLow (0.05)
    low (0.2)
    medLow (0.35)
    med (0.5)
    medHigh (0.63)
    High (0.75)
-->

    <set xpath="/lootcontainers/lootgroup[@name='groupBirdNest02']/item[@name='foodEgg']/@loot_prob_template">medHigh</set>

<!--  These lines guarantee an item will be pulled from lootgroup GroupBirdNest02.  Remove the comment code to enable this code  -->

<!--
    <removeattribute xpath="/lootcontainers/lootgroup[@name='groupBirdNest']/item[@group='groupBirdNest02']/@loot_prob_template"></removeattribute>
    <setattribute xpath="/lootcontainers/lootgroup[@name='groupBirdNest']/item[@group='groupBirdNest02']" name="count">1</setattribute>
-->

</config>

 

In the example above, I changed the drop rate from 0.35 to 0.63.  In addition, I put in code that goes from a 0.75 chance to pull something from groupBirdNest02 to a guaranteed pick from it.  However, that is currently commented out (remove <!-- and --> around that code - will be the two lines that start with <removeattribute and <setattribute).

 

Here is one of my previous modlets I did, you can download it and fix it.  Just open the loot file in it and replace all the text in it with the code above.  Then remove all files except the loot.xlm file in the config folder  - leave the modInfo file in the mod folder.  It will load up as NoJars but will change the nests if you copy and paste the above code into loot.xml.

 

Please note that I didn't test this code out.  Normally I write up the code, then load it up to verify no syntax errors on my part, then check it out in game to see if it works properly.

 

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

14 hours ago, BFT2020 said:

Use an existing modlet as an example, copy this code into a loot.xml file

<config>
<!-- ************************************************** Changing egg loot rate in nests  ************************************************** -->

<!--  Vanilla 7D2D is medLow.  Choices are:
    veryLow (0.05)
    low (0.2)
    medLow (0.35)
    med (0.5)
    medHigh (0.63)
    High (0.75)
-->

    <set xpath="/lootcontainers/lootgroup[@name='groupBirdNest02']/item[@name='foodEgg']/@loot_prob_template">medHigh</set>

<!--  These lines guarantee an item will be pulled from lootgroup GroupBirdNest02.  Remove the comment code to enable this code  -->

<!--
    <removeattribute xpath="/lootcontainers/lootgroup[@name='groupBirdNest']/item[@group='groupBirdNest02']/@loot_prob_template"></removeattribute>
    <setattribute xpath="/lootcontainers/lootgroup[@name='groupBirdNest']/item[@group='groupBirdNest02']" name="count">1</setattribute>
-->

</config>

 

In the example above, I changed the drop rate from 0.35 to 0.63.  In addition, I put in code that goes from a 0.75 chance to pull something from groupBirdNest02 to a guaranteed pick from it.  However, that is currently commented out (remove <!-- and --> around that code - will be the two lines that start with <removeattribute and <setattribute).

 

Here is one of my previous modlets I did, you can download it and fix it.  Just open the loot file in it and replace all the text in it with the code above.  Then remove all files except the loot.xlm file in the config folder  - leave the modInfo file in the mod folder.  It will load up as NoJars but will change the nests if you copy and paste the above code into loot.xml.

 

Please note that I didn't test this code out.  Normally I write up the code, then load it up to verify no syntax errors on my part, then check it out in game to see if it works properly.

 

Well I works, thank you.

 

I get a probability of 8-9 /eggs out 10 nests, rather than 2-3/ out of 10 nests.

 

I could not find a link in you post, so I copied a modlet I had and renamed it to "More Eggs" and copied your text into the config.xml.

 

You really should publish it. Its in no way an overbalancing mod, it just a small bit more convenient. There is nothing more irritating than find 6 nests in a row with no eggs.

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

10 hours ago, bobrpggamer said:

You really should publish it. Its in no way an overbalancing mod, it just a small bit more convenient. There is nothing more irritating than find 6 nests in a row with no eggs.

 

Will do once A21 drops and I confirm it still works on it.  Going to package a lot of modlets I have done over the past year for others and post them in a new A21 modlet post.

Link to comment
Share on other sites

On 12/16/2022 at 1:52 PM, RyanFaeScotland said:

I wonder if the game holds stats on how many "types" of each zombie you've killed? I know HUD Plus show total zombies kills so that's in there...

 

Just thinking it would be fun to have the chance of eggs spawning decrease with the more vultures you kill!

Well if you have loot re-spawn enabled, ask yourself, "who restocked the loot, was it the Tooth Fairy or maybe Santa Clause?" Where as, if you ask who put new eggs in the nest? "Well the birds did silly". "You know the birds and the bees".

 

So egg spawning should be maybe 3 days to 30 days, as it the only re-spawning thing that is realistic. But the idea of egg re-spawning is probably the last thing on most modders minds.

 

Bringing up bees. Why is it that there are bee farms, but no honey?

Link to comment
Share on other sites

4 hours ago, bobrpggamer said:

Bringing up bees. Why is it that there are bee farms, but no honey?

 

The apiaries are built with normal blocks. They could give the normal blocks a chance to drop honey, but then you'd be getting honey from things like house walls.

 

If they added a apiary/bee hive object, then it could be configured to drop honey. Cross your fingers for A21, which is said to have lots of new objects.

Link to comment
Share on other sites

On 12/14/2022 at 9:48 AM, BFT2020 said:

Use an existing modlet as an example, copy this code into a loot.xml file

<config>
<!-- ************************************************** Changing egg loot rate in nests  ************************************************** -->

<!--  Vanilla 7D2D is medLow.  Choices are:
    veryLow (0.05)
    low (0.2)
    medLow (0.35)
    med (0.5)
    medHigh (0.63)
    High (0.75)
-->

    <set xpath="/lootcontainers/lootgroup[@name='groupBirdNest02']/item[@name='foodEgg']/@loot_prob_template">medHigh</set>

<!--  These lines guarantee an item will be pulled from lootgroup GroupBirdNest02.  Remove the comment code to enable this code  -->

<!--
    <removeattribute xpath="/lootcontainers/lootgroup[@name='groupBirdNest']/item[@group='groupBirdNest02']/@loot_prob_template"></removeattribute>
    <setattribute xpath="/lootcontainers/lootgroup[@name='groupBirdNest']/item[@group='groupBirdNest02']" name="count">1</setattribute>
-->

</config>

 

In the example above, I changed the drop rate from 0.35 to 0.63.  In addition, I put in code that goes from a 0.75 chance to pull something from groupBirdNest02 to a guaranteed pick from it.  However, that is currently commented out (remove <!-- and --> around that code - will be the two lines that start with <removeattribute and <setattribute).

 

Here is one of my previous modlets I did, you can download it and fix it.  Just open the loot file in it and replace all the text in it with the code above.  Then remove all files except the loot.xlm file in the config folder  - leave the modInfo file in the mod folder.  It will load up as NoJars but will change the nests if you copy and paste the above code into loot.xml.

 

Please note that I didn't test this code out.  Normally I write up the code, then load it up to verify no syntax errors on my part, then check it out in game to see if it works properly.

 

Unfortunately this stopped working for some reason. Can you point me to the modlet that that you mentioned that exists already?

Link to comment
Share on other sites

On 12/20/2022 at 12:11 PM, bobrpggamer said:

Unfortunately this stopped working for some reason. Can you point me to the modlet that that you mentioned that exists already?

 

I am going to start looking at it tonight, can you let me know exactly what you mean by it is not working?  What are you seeing vs what you are expecting to see?

Link to comment
Share on other sites

1 hour ago, BFT2020 said:

 

I am going to start looking at it tonight, can you let me know exactly what you mean by it is not working?  What are you seeing vs what you are expecting to see?

At first I was getting eggs in 90% of the nests. Now It is back to 30%, as it was exactly without the mod.

 

Let me show what I edited in the script:

 

Spoiler

<config>
<!-- ************************************************** Changing egg loot rate in nests  ************************************************** -->

<!--  Vanilla 7D2D is medLow.  Choices are:
    veryLow (0.05)
    low (0.2)
    medLow (0.35)
    med (0.5)
    medHigh (0.63)
    High (0.75)
-->

    <set xpath="/lootcontainers/lootgroup[@name='groupBirdNest02']/item[@name='foodEgg']/@loot_prob_template">medHigh</set>

<!--  These lines guarantee an item will be pulled from lootgroup GroupBirdNest02.  Remove the comment code to enable this code  -->


    <removeattribute xpath="/lootcontainers/lootgroup[@name='groupBirdNest']/item[@group='groupBirdNest02']/@loot_prob_template"></removeattribute>
    <setattribute xpath="/lootcontainers/lootgroup[@name='groupBirdNest']/item[@group='groupBirdNest02']" name="count">1</setattribute>
-->

</config>

 

I took out the remark lines.

Link to comment
Share on other sites

21 minutes ago, bobrpggamer said:

At first I was getting eggs in 90% of the nests. Now It is back to 30%, as it was exactly without the mod.

 

Let me show what I edited in the script:

 

I took out the remark lines.

 

I will load it up tonight and see what happens.  I did notice something right away, at the very bottom (right above </config>, you forgot to remove the --> (end of the comment).  Not sure if that will cause an issue, but I will leave it in for now to see what I see on my end.

 

For testing purposes, I will also change the resourceFeather in the second group to another item so it shows clearly what is being picked when a birdnest is looted.  That line for bird feathers has a high priority (high) compared to the egg line which is medHigh based on my code.

 

If the code is loading correctly, there just might be fine tuning that needs to be done on the probabilities (which is what I am thinking needs to be done for your purposes).  One thing I could do is change the code from:

<lootgroup name="groupBirdNest01" count="1">
    <item name="resourceFeather" count="1"/>
</lootgroup>

<lootgroup name="groupBirdNest02" count="1,2">
    <item name="foodEgg" loot_prob_template="medHigh"/>
    <item name="resourceFeather" count="1,5" loot_prob_template="high"/>
</lootgroup>

<lootgroup name="groupBirdNest" count="all">
    <item group="groupBirdNest01" count="1"/>
    <item group="groupBirdNest02" count="1"/>
</lootgroup>

 

to this:

<lootgroup name="groupBirdNest01" count="1">
    <item name="resourceFeather" count="1,3"/>
</lootgroup>

<lootgroup name="groupBirdNest02" count="1,2">
    <item name="foodEgg" loot_prob_template="med"/>
    <item name="resourceFeather" count="1,3" loot_prob_template="med"/>
</lootgroup>

<lootgroup name="groupBirdNest" count="all">
    <item group="groupBirdNest01" count="1"/>
    <item group="groupBirdNest02" count="1"/>
</lootgroup>

 

That effectively change the chances to 50/50 in the second group of getting an egg.

Link to comment
Share on other sites

  • 2 weeks later...
On 12/23/2022 at 7:29 AM, BFT2020 said:

Here is a modlet to do that.  You might have to adjust the probabilities based on your preference

 

https://github.com/BFT2020/Eggs.git

I just now remembered to check this thread, so a late thank you.

 

Another possible modlet or script would be helpful:

 

I can go through 500 trees and never get a jar of honey. It seems so much worse than the eggs in nests Thing.

 

Is there a mod or simple script to increase this?

 

Thank you.

 

Oh, and Happy New Year.

Edited by bobrpggamer (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...