Does it matter...

Only when changing the order messes up the indentation :)

If you have a class, for example, and try to place function that isn't a method for that class between two functions that are it won't work right.

So, for the most part, no order isn't important for anything more than maintaining your sanity or making it easier for other people to figure out what the heck you were doing.
 
I have another question, I get this python exception saying "Traceback (most recent call last):" what does this mean and how can I fix it? Also what is the "<string>" file that another python exception talked about?
 
The traceback normally shows the three last calls with the third one being where the error occured (handy if the error is with the data being passed and not with the function itself).

Sorry, but I'm not a Python guru so I can't help with the <sting> error, I could probably fumble my way through it if I had to. My initial guess is that the problem is with the use of a string or the (maybe unintentional) misuse of a command from the python string library.
 
I have another question, I get this python exception saying "Traceback (most recent call last):" what does this mean and how can I fix it? Also what is the "<string>" file that another python exception talked about?

The important parts of those messages are the line numbers. That's usually how you know where your mistake was made. Keep in mind that some errors will cause other errors sometimes, so always deal with the first error message first. The ones following may not be real errors.
 
If you need help with a specific exception post up the part after "Traceback (most recent call last):" and I'm sure someone can help you.
 
Thanks for all the help but what is invalid syntax in this?:
Code:
		promArcher = gc.getInfoTypeForString("PROMOTION_ARCHER")
		uctArcher = gc.getInfoTypeForString("UNITCOMBAT_ARCHER")

                if (pPlot.isCity()):
                        uct = pUnit.getUnitCombatType()
			if (uct == uctArcher)
                                pUnit.setHasPromotion(promArcher, true)
Thanks in advance :)

Edit:Stupid me, I'm missing colons :lol:
 
Back
Top Bottom