Alright, so I’m creating a Python script for an inventory scene. Nothing crazy, like item stacks and items with individual stats like durability or charges or anything. It essentially just is mesh swap, where upon receiving a message from a different scene it will change a property that controls what mesh is visible. So what happens is there are four properties, Slot1, Slot2, Slot3, and Slot4. I have it designed so that when it reads:
if own[‘Slot1’] = 0 and addswordmessage.positive:
own[‘Slot1’] = 4 #This is the property number to activate the mesh swap for the sword
and then later down in the script it has the stuff for actually swapping the mesh, as controlled by the properties.
My question is, how would I create an else statement where if Slot1 isn’t zero, then it’ll change the property of Slot2 instead? And on and on, looping back to Slot1 if all slots are filled. So this way it isn’t filling all slots at once, or only filling one inventory slot and refusing to recognize the others. Like “If Slot1 is 0 fill that, else look at Slot2. If Slot2 is not 0, check Slot3. If Slot3 is not 0, check Slot4. If Slot4 is not 0, go back and check Slot1 again.”
Also if someone knows how to receive a message using only Python and without a sensor that would be extremely useful. Having tons of sensors is problematic because of clutter. It seems odd that the Python documentation shows how to send messages, but not how to receive them.