Accessing weapon datablock on the client
by Mike Stoddart · in Torque Game Engine · 08/06/2002 (4:36 pm) · 1 replies
I want to add a variable into the datablock for the weapons. So far I've tried to add it into the RifleImage and Rifle datablocks.
What I'm trying to do is store a bitmap filename inside the weapon datablock. Then when the weapon is activated, it tells the client to display the bitmap pointed to by this filename. So I figured that I could send the ID of the datablock across to the client, and let it pull out the filename. But I've had no success with either of these datablocks.
Is there something fundamental I'm doing wrong? Am I way off the mark with what I'm trying to do?
In WaltherImage::onActivate()I'm doing this:
I have the following setup in both the RifleImage and Rifle datablocks:
Edit: Sorry forgot to say that the weaponBitmap variable doesn't appear to be part of the datablock on the client. If that makes sense!
Thanks
What I'm trying to do is store a bitmap filename inside the weapon datablock. Then when the weapon is activated, it tells the client to display the bitmap pointed to by this filename. So I figured that I could send the ID of the datablock across to the client, and let it pull out the filename. But I've had no success with either of these datablocks.
Is there something fundamental I'm doing wrong? Am I way off the mark with what I'm trying to do?
In WaltherImage::onActivate()I'm doing this:
function RifleImage::onActivate(%this, %obj)
{
CommandToClient(%obj.client,'SetWeaponBitmap', %this);
}I have the following setup in both the RifleImage and Rifle datablocks:
weaponBitmap = "~/data/weapons/rifle/weapon.jpg";
Edit: Sorry forgot to say that the weaponBitmap variable doesn't appear to be part of the datablock on the client. If that makes sense!
Thanks
Torque Owner Sam Guffey
May I also ask.. Are you trying to change the skin of the weapon, the reticle bitmap or neither?