Forum Thread Not Found, Sorry.

Game Development Community

Bizarre problem with skins and triggers

by Lee Latham · in Torque Game Engine · 04/02/2008 (9:18 am) · 0 replies

Ok, this is bizarre. I have a simple servercommand to change weapons:

function serverCmdMountM16 (%client)
{
     
   if (%client.getControlObject().getClassName() !$= "Player") return;
 
   
      if(%client.team.teamID == 1) 
%teamskin = addTaggedString("red");
if(%client.team.teamID == 2)
%teamskin = addTaggedString("blue"); 

   %client.player.mountImage(M16Image,0,true,%teamskin);
}

As you can see, it is designed to put an appropriate team skin on the weapon when it's mounted. It generally works fine.

Unless, that is, you have the trigger depressed when you invoke it. So you're firing some other weapon and decide to change back to the M16, and what happens is it will have the default skin and not the teamskin. Change weapons back and forth again (without the mouse button depressed) and it works fine.

I even tried putting %client.player.setImageTrigger(0,false) in there at the beginning, but it didn't seem to help. Torque's trigger system continues to baffle me!

Any input would be greatly appreciated!

edit I should mention that when I step through it in Torsion everything appears fine. It appears to be something in mountImage in the source that is the issue. But shouldn't have turning the trigger off have helped? Or is the fact that it's held down enter it into another state?