Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 08-05-2010, 11:15 PM
Jiroxys7 Jiroxys7 is offline
Hazard to Graal
Jiroxys7's Avatar
Join Date: Apr 2009
Posts: 343
Jiroxys7 will become famous soon enough
Script hindering movement, the use of the tab key, and word input.

Okay, so I've been working on this system to show how many buffs you have. And after some trial and error (as well as plenty of Access violations ) I had finally got it working. Everything was fine for a while, but now all of a sudden I've found that I cant move unless I rapidly click the mouse on the screen while holding down a direction, I cant use the chat box unless i hit tab and click on the screen at the same time, and if i do manage to bring up the chat box, it wont let me type anything. however the other default functions seems to work just fine (sword, open inventory, grab, etc)

I narrowed down the problem to the portion of this script that I was working on.. but theres nothing in it that would normally hinder movement ( it doesnt include movement speed mods nor player.freezetimes)

So I'm kind of lost on what's causing this. I have a hunch that it might be that the icons suddenly feel like taking focus when theyre made, but I'm not totally sure. And I cant check since I dont know the commands that manipulate the focus of a GUI. But this may not even be the case.

Here's the section of the code. The function is called every 0.05 seconds by the timeout function:

PHP Code:
function doCheckBuffs(){

  
temp.buffs clientr.buffs.tokenize(",");
  
temp.count temp.buffs.tokenize(",").size();
      
      if(
temp.iconnumbers == 0){      
        for(
temp.0temp.<= 100temp.++){   
          
makevar("Test_ShowImg_" temp.a).destroy();
        }
        
temp.iconnumbers 0;        
      }
      
      for(
temp.0temp.temp.counttemp.++){        
        new 
GuiShowImgCtrl("Test_ShowImg_" temp.b) {
             
192 + (32*temp.b);
             
130;
             
width 60;
             
height 60;
             
image "j7_buff_alternate.png";
             
temp.iconnumbers += 1;
        }
      }


Any ideas what's causing my problem?
__________________
MY POSTS ARE PRONE TO EDITS!
Reply With Quote
  #2  
Old 08-05-2010, 11:24 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
How often is that being called? The problem is that it's stealing focus from the GraalControl.
__________________
Reply With Quote
  #3  
Old 08-05-2010, 11:41 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
It'd be a good idea to first create the GUI controls (in the onCreated event), and then just alter the image or whatever of it in that function. No sense in creating these controls over and over again, and it just steals focus.
Reply With Quote
  #4  
Old 08-05-2010, 11:47 PM
Jiroxys7 Jiroxys7 is offline
Hazard to Graal
Jiroxys7's Avatar
Join Date: Apr 2009
Posts: 343
Jiroxys7 will become famous soon enough
Quote:
Originally Posted by cbk1994 View Post
How often is that being called? The problem is that it's stealing focus from the GraalControl.
Is there any way to manipulate the focus? I think jerret uses such techniques on zodiac GUIs.

Quote:
Originally Posted by Crow View Post
It'd be a good idea to first create the GUI controls (in the onCreated event), and then just alter the image or whatever of it in that function. No sense in creating these controls over and over again, and it just steals focus.
Sounds like a good idea. I'll try that later, thanks
__________________
MY POSTS ARE PRONE TO EDITS!
Reply With Quote
  #5  
Old 08-05-2010, 11:54 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Instead of having a getfocus() function like any normal programming language, Graal has..

Object.makefirstresponder(true);

So if the show/hiding of a GUI grabs focus, and you want to return control back to your Graal char, you do: GraalControl.makefirstresponder(true);
__________________
Quote:
Reply With Quote
  #6  
Old 08-06-2010, 12:06 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Jiroxys7 View Post
Is there any way to manipulate the focus? I think jerret uses such techniques on zodiac GUIs.
Yes but you shouldn't be creating/destroying them except when they change.

PHP Code:
GraalControl.makeFirstResponder(true); 
__________________
Reply With Quote
Reply

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 08:52 AM.


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