Game Development Community

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:

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

#1
08/28/2002 (2:49 am)
I know this is old but if your still having problems please post all of the functions your useing so that I may look at them.

May I also ask.. Are you trying to change the skin of the weapon, the reticle bitmap or neither?