script behavior mouse down not working as hoped
by Joseph Bosch · in Torque Game Builder · 10/14/2011 (3:49 pm) · 1 replies
so I created a new image map via script
$sPlayer[%i] = new t2dStaticSprite() {
scenegraph = $sceneGraph;
imageMap = "PillsImageMap";
frame = "0";
useSourceRect = "0";
sourceRect = "0 0 0 0";
canSaveDynamicFields = "1";
Position = $player.position
size = "15.000 14.875";
mountID = "2";
PID = %i;
_behavior0 = "mouseEvent";
the call
echo ("line 40 draw to scenen cs " @ $sPlayer[%i].PID);
and all player ID are displayed as hoped but then during the mouse down event
function mouseEvent::onMouseDown(%this)
{
%this.owner.imageMap = "charImageMap";
echo (%this.owner.PID);
now for some reason here PID always equals the highest Pod, even though the image map changes fine
also no errors in logs so i am kind of LOST what I maybe doing wrong.
retesting $sPlayer[%i].PID in the same location shows that the PIDS are still set correctly but for some reason I am having trouble getting them from behavior controls
$sPlayer[%i] = new t2dStaticSprite() {
scenegraph = $sceneGraph;
imageMap = "PillsImageMap";
frame = "0";
useSourceRect = "0";
sourceRect = "0 0 0 0";
canSaveDynamicFields = "1";
Position = $player.position
size = "15.000 14.875";
mountID = "2";
PID = %i;
_behavior0 = "mouseEvent";
the call
echo ("line 40 draw to scenen cs " @ $sPlayer[%i].PID);
and all player ID are displayed as hoped but then during the mouse down event
function mouseEvent::onMouseDown(%this)
{
%this.owner.imageMap = "charImageMap";
echo (%this.owner.PID);
now for some reason here PID always equals the highest Pod, even though the image map changes fine
also no errors in logs so i am kind of LOST what I maybe doing wrong.
retesting $sPlayer[%i].PID in the same location shows that the PIDS are still set correctly but for some reason I am having trouble getting them from behavior controls
Torque Owner Joseph Bosch
Default Studio Name
$sPlayer[%i] = new t2dStaticSprite(player) {
scenegraph = $sceneGraph;
imageMap = "PillsImageMap";
frame = "0";
useSourceRect = "0";
sourceRect = "0 0 0 0";
canSaveDynamicFields = "1";
Position = $player.position
size = "15.000 14.875";
mountID = "2";
PID = %i;
_behavior0 = "mouseEvent";
(which the player didn't get copied in, but taking it out makes everything work)