Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 11-29-2010, 10:54 PM
MrOmega MrOmega is offline
One More Time
MrOmega's Avatar
Join Date: Aug 2010
Location: TN, USA
Posts: 631
MrOmega is an unknown quantity at this point
Send a message via AIM to MrOmega Send a message via MSN to MrOmega Send a message via Yahoo to MrOmega
Lost at an Unexpected Action

Here's the script

PHP Code:
//#CLIENTSIDE

function onCreated()
{

  
client.targetCoor NULL;
  
client.targetMode 7;
  
  new 
GuiWindowCtrl"Varia_Targetting")
  {
  
    
clearControls();
    
    
extent = { 256128};
    
position = { screenwidth this.width0};
    
    
text "Targetting Control";
    
profile "GuiWindowProfile";
    
profile.bitmap "guivaria_window.png";
    
    
visible =
    
canMove =
    
canClose =
    
canResize =
    
canMinimize =
    
canMaximise false;
    
    for ( 
temp.0temp.8temp.++)
    {
 
      new 
GuiRadioCtrl"Varia_Targetting_" temp.i
      { 
       
        
extent = { 12822};
        
position = { 10 + ( temp.3this.width0), 25 this.height * ( temp.4)};
        
profile "GuiRadioProfile";
        
profile.bitmap "guivaria_radio.png";
        
profile.fontcolor = { 4717732255};
        
profile.fillcolor = { 477732255};
        
profile.fontcolorhl = { 02000255};
        
profile.fillcolorhl = { 0900255};
        
groupnum 1;
        
text 
          
temp.== 0"Move To Here"
          
temp.== 1"Look/Study":  
          
temp.== 2"Open":  
          
temp.== 3"Read"
          
temp.== 4"Speak to"
          
temp.== 5"Attack"
          
temp.== 6"Close"
          
"Do Nothing";
         
        
checked temp.== 7truefalse;
          
        
thiso.catcheventname"onAction""onChangeAction");
      
      }
    }
  }
}

function 
GraalControl.onMouseDown()
{

  
client.targetCoor = { intmousex), intmousey)};
  
Varia_Targetting.visible true;

  
showimg0"varia_targetting.gif",  client.targetCoor0] - 2client.targetCoor1] - 2).layer 3;

  
TargetAction();

}

function 
GraalControl.onRightMouseDown()
{

  if ( 
client.targetCoor != NULL)
  {
  
    
Varia_Targetting.visible false;
    
hideimg0);
    
client.targetCoor NULL;

  }
}

function 
onChangeAction()
{

  
client.targetMode params0].substring171);
  
TargetAction();
  
}

function 
TargetAction()
{

  switch ( 
client.targetMode)
  {

    case 
0:

      
temp.dist getDistplayer.xplayer.yclient.targetCoor0], client.targetCoor1]);

    break;
    
    case 
1:
    break;
    
    case 
2:
    break;
    
    case 
3:
    break;
    
    case 
4:
    break;
    
    case 
5:
    break;
    
    case 
6:
    break;
    
    case 
7:
    break;

  }
}


function 
getDisttemp.x1temp.y1temp.x2tempy2)
{

  
temp.dist int(((( temp.x2 temp.x1) ^ 2) + (( temp.y2 temp.y1) ^ 2)) ^ 0.5);
  echo( 
temp.dist SPC params);
  return 
temp.dist;


Here's the issue. on the getDist function it's not getting the correct params that I am sending it's getting the params of whatever last function was used.

So when I click the first radio button it echoes " 33 Varia_Targetting_0, "
If I just click around after that I get the params of onMouseDown(). and the dist always seems to be 33. What the hell am I doing wrong?
__________________
Time is the fire in which we burn...
Up, Up, Down, Down, Left, Right, Left, Right, B, A, Select, Start! Now I got 99 LIVES!!!
Reply With Quote
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 05:37 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.