Game Development Community

Script help

by Howard Dortch · in Torque Game Engine · 08/08/2004 (10:30 am) · 3 replies

Trying to understand this part of script in fps demo.

This function appears to require 5 parameters (%this is a given)

function Armor::damage(%this, %obj, %sourceObject, %position, %damage, %damageType)

I THINK this is being called from radiusDamage like so

%targetObject.damage(%sourceObject, %position,
%damage * %coverage * %distScale, %damageType);

I count 4 parameters so the confusion is Armor::damage gets %this and %obj but %targetObject.damage does not send it. %this I believe is a hidden parameter sent so that leaves %obj not being sent.

Anyone explain this?

#1
08/08/2004 (10:37 am)
%this & %obj is more than likely being set and passed to the script ::damage() from the engine
#2
08/11/2004 (8:35 pm)
Have you tried calling .dump() on %targetObject?
#3
08/12/2004 (3:28 am)
Well I guess there is the confustion I can't tell what is being called from script to engine and whats being called in the script from the engine. The script damage routine looks like it's called from the script radius damage I can put echo statements in there and it shows concurrency. So the difference in the parameter count is a result of what?