Author Topic: Checking Torpedo Values  (Read 1321 times)

Offline teleguy

  • Posts: 363
  • Cookies: 53
Checking Torpedo Values
« on: June 23, 2009, 01:37:46 PM »
I'm trying to create the following tech:

Code: [Select]
def OnFire(self, pEvent, pTorp):
global damage
damage = pTorp.GetDamage
print (damage)

but all I get is "<method Torpedo.Torpedo_GetDamage of Torpedo instance at 1261576c>".




Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: Checking Torpedo Values
« Reply #1 on: June 23, 2009, 01:49:26 PM »
A function/method call ends with () or some parameters between the (). Without it and you access the "field", which can be a method, or a value. Infact, each function/method is a value, namely with a function/method as a value.
I still can't read peoples minds, nor can I read peoples computers, even worse, I can't combine the two to read what is going wrong with your BC install...

"It was filed under 'B' for blackmail." - Morse, Inspector Morse - The dead of Jericho.

Offline teleguy

  • Posts: 363
  • Cookies: 53
Re: Checking Torpedo Values
« Reply #2 on: June 23, 2009, 01:51:14 PM »
Oh, of course.