I don’t think I was clear both objects have identical property names. I was just hoping for a quick method of copying the values between the two objects. so the properties are not the issue, just copying the values in an efficient manner.
In a python dictionary, creating a new entry is the same as setting it. So the code I posted above is likely the most efficient method. At the very least, its the most efficient obvious method.
As I hinted at, properties are stored in a dictionary-like structure, so you can do:
for prop_name in obj.getPropertyNames():
print(prop_name, "has value", obj['prop_name']
Regarding the list question: python is zero indexed
a = [1, 2, 3, 4]
len(a) = 4 # see, there are four items. Count'em: 1, 2, 3, 4
a[0] # But it's zero indexed, so this is the "first item"
a[1] # second item
a[2] # third item
a[3] # fourth item
a[4] # Oops, there are only four items, and because it's zero indexed, accessing a[4] tries to get the fifth.
You can also index from the end using negative numbers, so:
a = [1, 2, 3, 4]
print(a[-1]) # 4
I just kinda plunged into the water(python) without knowing how to swim …
BGE taught me to code in python. It was my first ever programming beyond a couple lines in BASIC STAMP. It is so hilarious to look back at my old code. And learning through doing is the most fun way of learning!
I have never coded any large scale projects…not alone anyway
I’m not sure many people around here (or anywhere really) have. When you break the 2000 lines of code mark, you’re probably gone further than most other BGE users. Unfortunately this means there are very few people here I can discuss how to manage 10,000 line projects with 20-odd blend files.
I am an idiot
I disagree