So if you’re going to be looking at a variable number of workers while the construction is complete, you do it a bit differently. I’m making some assumptions about how your game works, but I’m guessing that the construction happens in the background, while the player’s out doing other things. So at some point you’re writing things like:
*fake_choice How do you defeat the kraken?
# Spear it
# Punch it
# Bribe it with Kracken-crackers
*comment TODO: progress the background construction here
And you’ll have the code to update the construction in place of that
TODO I wrote, and you’ll put it everywhere you need to update construction (or, to avoid duplication and possible errors, use a
gosub_scene to write it once and just call it everywhere appropriate).
So now, rather than figure out how many hours it’ll be until the job is complete and then counting down those hours, you instead count down the number of Man-hours left in the job. To re-use my previous example:
*create hut_construction_mh 40
*create hut_under_construction false
*create hut_complete false
*create hut_construction_remaining 40
So that mirrors your example but I’ve added the “remaining” variable. What that does is let us count down. Later, in your “update construction” code, you do this:
*set hut_construction_remaining -workers
Since each worker gives one man-hour of work, and one hour just passed, you can subtract that from the total MH remaining. That way if you add workers halfway through, their additional work is counted from that point on. Once this is less than or equal to zero, you’ve built the hut!