Resource Regrow Bug?

Users who are viewing this thread

domipoppe

Knight
Old Guard
Hey,

I did copy & paste the apple tree scene object and I did basically change the fruit on it so it's a cherry tree.
I did place fishing schools on the map with a maximum of fishes and a maximum depth.

So when I start the server the fishing schools work, but as soon as all fishes are taken out of it, they won't reproduce fishes it seems like.
The other point is that the cherry trees and apple trees do not grow fruits at all.

Does anyone know why?
 
There is a quirk in the apple tree scripts that they do not regrow until they have been cut down by a player at least once since the server started: I decided not to fix it, because there seemed to be the beneficial side effect that for trees placed in locations where players didn't or couldn't go to, the server would not waste performance spawning unused apples. To make apple trees always spawn after server restart, you would just need to call script add_resource_to_regrow_list with each fruit tree instance id, similarly to how it is done at the end of script regrow_fruit_tree (which restarts the cycle after each time fruit grows or the tree is cut down).

Fish schools should eventually regenerate even if totally fished out: see the end of script move_fish_school, which does:
Code:
      (store_random_in_range, ":adjust_fish", -2, 4),
      (val_add, ":fish_count", ":adjust_fish"),
      (val_max, ":fish_count", 0),
So while the fish school might not increase every time the check is run, overall it is about 3 times as likely to increase than decrease. I remember testing the fishing scripts extensively with debugging to the server console, and I'm pretty sure the regeneration worked correctly.
 
Vornne said:
There is a quirk in the apple tree scripts that they do not regrow until they have been cut down by a player at least once since the server started: I decided not to fix it, because there seemed to be the beneficial side effect that for trees placed in locations where players didn't or couldn't go to, the server would not waste performance spawning unused apples. To make apple trees always spawn after server restart, you would just need to call script add_resource_to_regrow_list with each fruit tree instance id, similarly to how it is done at the end of script regrow_fruit_tree (which restarts the cycle after each time fruit grows or the tree is cut down).

Fish schools should eventually regenerate even if totally fished out: see the end of script move_fish_school, which does:
Code:
      (store_random_in_range, ":adjust_fish", -2, 4),
      (val_add, ":fish_count", ":adjust_fish"),
      (val_max, ":fish_count", 0),
So while the fish school might not increase every time the check is run, overall it is about 3 times as likely to increase than decrease. I remember testing the fishing scripts extensively with debugging to the server console, and I'm pretty sure the regeneration worked correctly.

Thank's for your answer Vornne.
The apple trees and cherry trees work now after I add them to the list on mission start up.

About the fish school, I'm not sure if I do something wrong.
I place the scene object like half in water and half in the air.
Then I assign 127 max. fish to it. I set 4 max. depth.

But when I go there and try to hit in it, no fish come out.
Nor with a Net. It also seems like it's not "generating" fish in it.
It is really weird.
 
Hmm: it is a very long time since I tested the fishing scripts, so I presume they still work fine, but don't know for sure.

You could test more easily if you remove sokf_invisible from the pw_fish_school scene prop flags (to identify where they are), add a dbg.vars_display(":fish_count") line to the end of script move_fish_school (to see how many fish in each), and optionally reduce the normal 30 second interval between moving fish schools in the first line of the fish_school_loop trigger in module_mission_templates to speed the movement up (to quickly see where the fish schools can travel to - maybe they are just moving away from where you expect them to be).

Also, does the troop you are using have labouring skill?
 
Vornne said:
Hmm: it is a very long time since I tested the fishing scripts, so I presume they still work fine, but don't know for sure.

You could test more easily if you remove sokf_invisible from the pw_fish_school scene prop flags (to identify where they are), add a dbg.vars_display(":fish_count") line to the end of script move_fish_school (to see how many fish in each), and optionally reduce the normal 30 second interval between moving fish schools in the first line of the fish_school_loop trigger in module_mission_templates to speed the movement up (to quickly see where the fish schools can travel to - maybe they are just moving away from where you expect them to be).

Also, does the troop you are using have labouring skill?

Thanks for your answer, after debugging and testing I recognized they are moving below the heightmap so you can't see them anymore.
I did place them more in the water and reduced the movement a bit now it's working.
 
Back
Top Bottom