jpw1991 / chebs-necromancy

Cheb's Necromancy adds Necromancy to Valheim via craftable wands and structures. Minions will follow you, guard your base, and perform menial tasks.
The Unlicense
10 stars 4 forks source link

Neckro forced 'store' timer/counter #128

Closed Kherae closed 1 year ago

Kherae commented 1 year ago

while the implementation of "deposit if nothing to pick up" is good, there's still one case that could use some attention: continuous slow production that does not fill the neckro's inventory very quickly. Thus, my suggestion: have a configuration option to make the neckro deposit after a specific amount of time.

CW-Jesse commented 1 year ago

"Minimum time between deposits"?

Kherae commented 1 year ago

more like "maximum time between deposits" was a "Bad with words" case, but the idea is to have neckros go no further than X minutes without depositing

jpw1991 commented 1 year ago

Sounds good to me. The way I typically do this is to store the value of Time.time and then compare against that in the update loop. Check the code for Guardian Wraith expiring after X seconds.

Why not use a coroutine? Because I've found that coroutines can misbehave on creatures for some reason. It works great for static structures that don't move around, like pylons, but somehow malfunctions for creatures.

CW-Jesse commented 1 year ago

All right. The timer should probably only start once it picks up the first object.

jpw1991 commented 1 year ago

@CW-Jesse you want this one?

jpw1991 commented 1 year ago

This is now working in 2.3.10. You can test this here if you wish. Attention: assumes newest Valhiem version + upgraded BepInEx and Jotunn