Game Development Community

Modifying image states

by Darkfire Games · in Torque Game Engine Advanced · 03/19/2007 (11:15 pm) · 2 replies

I have 2 modes of fire for my weapon, and i want to change the fire states timeout value, so changing the fire rate.

if (!%this.fireMode)
    {
        %this.stateTimeoutValue[3] = 0.1;
        %projectile = %this.projectile;
    } else {
        %this.stateTimeoutValue[3] = 1.0;
        %projectile = %this.projectileAlt;
    }
    echo(%this.stateTimeoutValue[3]);

It echos correctly but there is no change in fire rate. Im new so no doubt its something stupid, or it just cant be done.

#1
03/20/2007 (3:38 pm)
This is in the server code, right?
#2
03/20/2007 (3:47 pm)
You need to do some research on datablocks and how they work. You can not change a datablock on the server and expect the simulation to continue properly. I am also not sure if you can change the timeout values directly without calling onAdd ().