Bridge Commander Central

BC Forums => BC Scripting => Topic started by: teleguy on June 23, 2009, 01:37:46 PM

Title: Checking Torpedo Values
Post by: teleguy 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>".



Title: Re: Checking Torpedo Values
Post by: MLeo 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.
Title: Re: Checking Torpedo Values
Post by: teleguy on June 23, 2009, 01:51:14 PM
Oh, of course.