(Solved) Npc empty seat detection

I’ve been playing around with the concept but time 100. This is a bit crazy. I’m amazed it works. It took some re-writing. I’m not sure if I’m going to continue playing around. I would like to optimize it instead of using infinite servers. One server should be able to handle a few tables in each direction.

Try me (there is no interaction, people come in, they go to a table and get a glass a water)
https://gd.games/keith_13579/unaccountable-arithmetic

Project (click the green [code] and select [download zip]
https://github.com/doug13579/gdevelop—restaurant-pathfinder-tables

I used a bunch of state variables and I linked everything. I added different size tables. I wasn’t sure at first how to pick a table to fit the number of guests. Then I realized that I had it backwards. It picks a table and then using a min and max object variable it picks the number of guests. So, the small table can have 1 or 2 NPCs. The 4-person table can have 1 to 4. The 6-person table 4 to 6 and the 8-person table can have 7 or 8. That way, I don’t have to find a table to fit the party. It creates a party to fit the table.

Events - click to open

There are also object variables but I didn’t feel like screenshotting everything.

Table is a tiled sprite so it can be resized. NPC and Service have the pathfinder.