Industry Brief (Dryer, Washing Machine etc)


My goal here was to work on Hayden’s washer and dryer to implement a player interact system to deposit washing, as well as a random Dryer breakdown.

Washing Machine

Firstly, the event checks if either the player is holding nothing or if the washing machine’s “contents” are not empty.
If either is true, then the length of the “contents” derived array is checked. If the length is of the appropriate size and the player isn’t holding anything then: a switch checks that the washing is clean, holding is set as the contents and the contents of the machine are reset (washing is taken out).
If the player has an item or the contents are empty, then the type of washing the player is holding is checked, and if it is “DirtyLaundry”, then the washing machine minigame starts.
Once the minigames conclude, the value of “contents” is set to the value of “holding” and “holding” is reset (washing is placed in). Then a timer is started, with the time “TimeToWash” (this is affected by your performance in the minigames)
Once the timer elapses, the “contents” are updated to “WetLaundry”, followed by the customer number and the temperature selected in the minigame.

Dryer

Here, the breakdown event is set to a timer with a randomly generated time between 0 and 120 seconds.
During the interact, the status of “BreakdownBool” is checked, if it is true then the cleaning minigame will start.
If false, then this code functions similarly to the washing machine interact (washing is placed in or taken out)
This is fundamentally the same as the washer but without the minigame (washing is placed in)
(Washing is taken out)

Recycling Bin

Code simply resets “Holding”.

Areas of Development throughout

“CheckDestroyed” was originally checked every tick. It would check if the player had got rid of the washing (indicated by replacing the first “Holding” array value with “destroyed”). If this was the case, then the “LinePosition” was checked to see if it was the same as the monster and the monster would “LeaveAngrily”, also resetting the value of “Holding”.

However, I had to abandon this system as if the customer left and the player tried to dispose of the washing after, the value of “Holding” would never be reset as the monster that run the reset didn’t exist anymore. The new system simply resets “Holding” via bin overlap events and allows the player to pickup the washing from the monster to try again.

Conclusion

This code functions mostly as expected; the washing can be cleaned and dried with the appropriate machines and the breakdown is random. However, I had to add a bin to discard of erroneous washing, and adapt my original model for it due to casting issues.


Leave a Reply

Your email address will not be published.