I think you need to look at your architecture with a different perspective.
At one level you know you switch between scenes. That mean everytime you swith, you work with a different set of game objects. The previous set is gone at that time.
At the scene level, you know that it contains an object ( or more ) that have a specific purpose e.g. act as archer.
Know you connect these knowledge:
Everytime you switch the scene … you search the game objects for the puposes you are looking for. To be efficient, you store the search result in a way that you can have fast access. When you switch the scene again, the stored data gets invalid and must be refreshed.
Now your question makes sense, if your assumption is there is only one archer in the scene. According to your question you identify the object(s) by prefix.
def findByPrefix(prefix):
return [object for object in bge.logic.getCurrentScene().objects
if object.name.startswith(prefix)]
Example to store in an property
def refreshArcher(objectProvider):
archers = findByPrefix("Archer")
if len(archers)!=1:
... Whatever you want to do in this case e.g raise an error
objectProvider["archer"] = archers[0]
Remember, you do nit search all the time. You search after you switched scene. By your contention, the prefixes of the objects need to match. Other options are suffix, property names, property values, positions, parent child relationships …
I hope it helps