'Make until you have (range)'

Started by Nopkar, November 08, 2014, 07:48:26 PM

Previous topic - Next topic

Nopkar

Quote from: Tynan on November 10, 2014, 11:32:14 AM
I actually thought of a way to do it. Just model it like this:

When checking for jobs, if the worker is right beside the work table, check the upper bound, otherwise check the lower bound.

hah! perfect! Question though, what if the bench is set to drop on floor? The items aren't ever committed to a stockpile for viewing so the pawn continues making until it detects the required amount of items in a stockpile.

Currently this is the one of the ways to get the 'range' function to work, could that be addressed?

Tynan

Quote from: Tertnes on November 10, 2014, 07:43:15 PM
Quote from: Tynan on November 10, 2014, 11:32:14 AM
I actually thought of a way to do it. Just model it like this:

When checking for jobs, if the worker is right beside the work table, check the upper bound, otherwise check the lower bound.

If the bill is set to deliver to stockpile, I assume the job is finished when the meal is dropped off. Wouldn't that cause an issue if the stockpile is too far from the stove?

You are right; I'd have to add a check-and-return step to the end of the job. Bah!
Tynan Sylvester - @TynanSylvester - Tynan's Blog

skullywag

Youre almost at the point of needing a job queue to do this. Those are never fun. Can you not have a kind of global variable where you can say weve hit max amount of meals required no more cooking. Then only set that variabke to the opposite when the min number is hit?
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

Nopkar

it's becoming complicated. of course, shouldn't have expected it to be simple in the first place. This is a quality of life feature and not something more important so waiting's not an issue :P

Pirx Danford

Actually its pretty easy to achieve this with a hidden default "make until you have X job".
So what "do between job" would do is:
- create the hidden job starting at the lower range
- when the hidden job hits the low range it is set to the max range value
- only after reaching the max the hidden job is set to the low range again

- bonus: if a chef is idle he might check if the current stock is between and start doing the job anyway, probably through a hidden "do 1 time job"