scripts methods questions
by Gabe Zingaretti · in General Discussion · 01/28/2003 (9:01 pm) · 3 replies
hi all,
here is my question:
"function ShapeBase::damage(%this, %sourceObject, %position, %damage, %damageType)
{
// All damage applied by one object to another should go through this
// method. This function is provided to allow objects some chance of
// overriding or processing damage values and types. As opposed to
// having weapons call ShapeBase::applyDamage directly.
// Damage is redirected to the datablock, this is standard proceedure
// for many built in callbacks.
%this.getDataBlock().damage(%this, %sourceObject, %position, %damage, %damageType);
}"
shapebase is a class in C++. damage is a method. How and where does the code know that it needs to be called?
thanks a bunch
here is my question:
"function ShapeBase::damage(%this, %sourceObject, %position, %damage, %damageType)
{
// All damage applied by one object to another should go through this
// method. This function is provided to allow objects some chance of
// overriding or processing damage values and types. As opposed to
// having weapons call ShapeBase::applyDamage directly.
// Damage is redirected to the datablock, this is standard proceedure
// for many built in callbacks.
%this.getDataBlock().damage(%this, %sourceObject, %position, %damage, %damageType);
}"
shapebase is a class in C++. damage is a method. How and where does the code know that it needs to be called?
thanks a bunch
About the author
#2
thanks,
Gabe
01/29/2003 (8:09 am)
could you give me an example? I looked for stuff but the entries I found have a different parameters than what the script uses.thanks,
Gabe
#3
(code)
virtual void onCollision(const Point3F& p, const Point3F& n, SceneObject*);
(script)
function CrossbowProjectile::onCollision(%this,%obj,%col,%fade,%pos,%normal)
Gabe
01/29/2003 (8:10 am)
for instance on the projectile:(code)
virtual void onCollision(const Point3F& p, const Point3F& n, SceneObject*);
(script)
function CrossbowProjectile::onCollision(%this,%obj,%col,%fade,%pos,%normal)
Gabe
Associate Kyle Carter