Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upVehicles can now idle. Allows generators. Storage batts keep charge when removed and added. Adds floodlight, working fridge. #4665
Conversation
freezerbunny
added some commits
Nov 24, 2013
ianestrachan
reviewed
Nov 25, 2013
| if (it->is_food() && next_vehicle->part_flag(*part_index, "FRIDGE") && | ||
| next_vehicle->fridge_on) { | ||
| if (!one_in(5)) { | ||
| it->bday++; |
This comment has been minimized.
This comment has been minimized.
ianestrachan
Nov 25, 2013
Contributor
To the best of my knowledge, this won't have any effect outside of the 'reality bubble'. That is, however, very much well outside of the scope of this PR; just something you should probably be aware of.
This comment has been minimized.
This comment has been minimized.
freezerbunny
Nov 25, 2013
Author
Contributor
Good to know.
Solution would be to process active item in vehicles no matter where they are.
However that would require a new list of vehicles that have active things in them, so we don't needlessly check every single vehicle in the world.
When they no longer have active items in them, remove the vehicle.
That or, set the bday somewhere many turns in the future when we put it in, and decrement the appropriate number of turns when we take it out.
This comment has been minimized.
This comment has been minimized.
ianestrachan
Nov 25, 2013
Contributor
Those are all band-aid fixes to the bigger problem of the 'reality bubble' itself.
The only solution that doesn't involve simulating the entire world is to track when a section is unloaded, and when it is reloaded, fast-forward it to simulate all the turns that were missed. That'll fix fires and suchlike being frozen in time if you get too far from them.
Still well out of the scope of this PR though.
This comment has been minimized.
This comment has been minimized.
freezerbunny
Nov 25, 2013
Author
Contributor
I've implemented a fix, keeping a list of fridged foods and processing them accordingly.
Can't really be done this way.
Got a new solution involving calculating the difference between the current turn and the old turn and dividing it by 5.
ie. the rate of passage for turns is decreased by 5, hence making it rot less.
This comment has been minimized.
This comment has been minimized.
|
That should be it working even if we leave. |
freezerbunny
added some commits
Nov 25, 2013
yobbobanana
merged commit 02540c1
into
CleverRaven:master
Nov 25, 2013
1 check passed
This comment has been minimized.
This comment has been minimized.
|
this was awesome so i merged it. i tested it a little first. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
item.cpp line 876 (item::tname) should call |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Wow! This looks awesome! Minifridges?! |
This comment has been minimized.
This comment has been minimized.
|
working minifridges :) |
freezerbunny commentedNov 25, 2013
Vehicles will now need the engine to be powered on in order to drive.
Engines that are on will actually idle, consuming fuel and charging batteries.
Storage batteries can be removed and will keep their charge. When installed, they will add their charge to the vehicle.
The minifridge can now be powered on and will keep food fresh for five times as long.
A floodlight object was added that acts as a very powerful lightsource, for indoor lighting with the new generator.
Power generation and consumption was rebalanced around this.
Fixed light power consumption.