1
Programming / Re: Oh boy, adventures in rebinding variables!!! (Python)
« on: May 22, 2014, 04:07:14 AM »Wow, you were right. This is turning into an enjoyable discussion. So what does the interpreter say after you fix that line?
(i.e. when you change object.Hostile_AI.take_turn() to object.ai.take_turn() ?)
I found the problem. There were a number of errors, but the main one was that Hostile_AI was the name of the class itself, not of an instance of the class. I had forgotten to instantiate it at all.
There are a number of bugs still left, but I think I can probably fix them. I actually had a successful program and was at the step of implementing an inventory system when I decided that the roguelike tutorial's way of making almost all in game objects (the PC, monsters, items, etc) members of the same multifunctional class was better than my way of having a separate item and actor class. And then when I tried to implement that, there were a bunch of errors that popped up from the changes I made.
Anyway, thanks for the help turoturo.