Sorry, its a bit difficult to explain, but what I meant was that at no point in the script do I directly reference an object by its object name, e.g. ship_1. Instead, I use a type of list comprehension to sift through the scene and let the code do the object identification itself.

But yes, your guess is correct. Each object has a unique integer number assigned to it, and it self checks to make sure the code generated message matches its own ID: for example:

Button is pressed
Button assigns its property values to the message, generates a message with the syntax 'End' as a subject and '1' as the body of the message
Message End1 is sent; no previous object with this integer is present
Ship_1 is assigned integer 1 at creation
Ship_weapon is assigned

Button is pressed again
Button assigns its property values to the message, generates a message with the syntax 'End' as a subject and '1' as the body of the message
Message End1 is sent; the previous Ship_1 is present, since End1 has the integer 1 it matches its ID, ends itself.
Ship_1 is assigned integer 1 at creation
Ship_weapon is assigned

.....and so on.

It means the code is pretty much modular, and I could easily reuse it for future projects.