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 11-12-2006, 12:09 AM
Loakey_P2P Loakey_P2P is offline
SL Oldbie
Loakey_P2P's Avatar
Join Date: Apr 2006
Location: U.S.A
Posts: 137
Loakey_P2P is an unknown quantity at this point
Send a message via AIM to Loakey_P2P Send a message via Yahoo to Loakey_P2P
keydown in gui

so i started scripting a new inventory with the new gscript2 gui stuff but i came to a problem not far into it . it has a bar on the right side of the screen with button's in it for items,weapons,armor,spells,prizes,stats,pets, and options and another smaller bar for brief discriptions . but it wont change the discription on mouse overs . ive tryed several way's and none have worked yet , can anyone help ? im not sure if i should do it in the button or with a timeout useing "in x, y" . ill have to do mouse to do different window's later too for the window to disply all stat's , or a list of item's or weapons .

PHP Code:
//#CLIENTSIDE
function onTimeOut(){
  if(
this.mode == 1){
    
DiscriptionText.show();    
  } else {
    
DiscriptionText.hide(); 
  }
  
setTimer(0.05);
}

function 
onCreated(){
  new 
GuiTextProfile(Inventory_TextProfile){fontColor "0 0 0";}
  new 
GuiWindowCtrl(MainInventoryWindow){
    
width 150;
    
height 600;
    
profile "GuiWindowProfile";
    
screenwidth 200;
    
screenheight 650;
    
canResize false;
    
canMove false;
    
canClose false;
    
canMinimize false;
    
canMaximize false;
    
destroyonhide false;
    
visible false;
    
text "Inventory"
  }
  new 
GuiWindowCtrl(DiscriptionWindow){
    
width 400;
    
height 50;
    
profile "GuiWindowProfile";
    
screenwidth 800;
    
screenheight 70;
    
canResize false;
    
canMove false;
    
canClose false;
    
canMinimize false;
    
canMaximize false;
    
destroyonhide false;
    
visible false;
    
text "Brief Discription";     
  }
  new 
GuiTextCtrl(DiscriptionText){
      
profile "GuiTextProfile";
      
screenwidth 790;
      
screenheight 45;
      
text "*Info: " client.itemdiscription;
    }   
  new 
GuiButtonCtrl(ItemButtonWindow){
    
width 110;
    
height 40;
    
profile "GuiButtonProfile";
    
screenwidth 180;
    
screenheight 615;
    
visible false;
    
text "Items";
    
setstring client.itemdiscription,the item list;     
  }
    new 
GuiButtonCtrl(WeaponButtonWindow){
    
width 110;
    
height 40;
    
profile "GuiButtonProfile";
    
screenwidth 180;
    
screenheight 560;
    
visible false;
    
text "Weapons";
    
setstring client.itemdiscription,the weapon list;    
     
  }
  new 
GuiButtonCtrl(ArmorButtonWindow){
    
width 110;
    
height 40;
    
profile "GuiButtonProfile";
    
screenwidth 180;
    
screenheight 505;
    
visible false;
    
text "Armor";     
  }
  new 
GuiButtonCtrl(ToolButtonWindow){
    
width 110;
    
height 40;
    
profile "GuiButtonProfile";
    
screenwidth 180;
    
screenheight 450;
    
visible false;
    
text "Tools";     
  }
  new 
GuiButtonCtrl(PrizeButtonWindow){
    
width 110;
    
height 40;
    
profile "GuiButtonProfile";
    
screenwidth 180;
    
screenheight 395;
    
visible false;
    
text "Prizes";     
  }
  new 
GuiButtonCtrl(SpellButtonWindow){
    
width 110;
    
height 40;
    
profile "GuiButtonProfile";
    
screenwidth 180;
    
screenheight 340;
    
visible false;
    
text "Spell";     
  }
  new 
GuiButtonCtrl(StatButtonWindow){
    
width 110;
    
height 40;
    
profile "GuiButtonProfile";
    
screenwidth 180;
    
screenheight 285;
    
visible false;
    
text "Stats";     
  }
  new 
GuiButtonCtrl(SkillButtonWindow){
    
width 110;
    
height 40;
    
profile "GuiButtonProfile";
    
screenwidth 180;
    
screenheight 230;
    
visible false;
    
text "Skills";     
  }
  new 
GuiButtonCtrl(PetButtonWindow){
    
width 110;
    
height 40;
    
profile "GuiButtonProfile";
    
screenwidth 180;
    
screenheight 175;
    
visible false;
    
text "Pets";     
  }
  new 
GuiButtonCtrl(OptionButtonWindow){
    
width 110;
    
height 40;
    
profile "GuiButtonProfile";
    
screenwidth 180;
    
screenheight 120;
    
visible false;
    
text "Options";     
  }
  
setTimer(0.05);
}

function 
onKeypressed(){
  switch(
params[1]){
    case 
"q":
      
this.mode this.mode;
      if(
this.mode == 1){
        
MainInventoryWindow.show();
        
DiscriptionWindow.show();
        
ItemButtonWindow.show();
        
WeaponButtonWindow.show();
        
ArmorButtonWindow.show();
        
ToolButtonWindow.show();
        
PrizeButtonWindow.show();
        
SpellButtonWindow.show();
        
StatButtonWindow.show();
        
SkillButtonWindow.show();
        
PetButtonWindow.show(); 
        
OptionButtonWindow.show();        
      } else {
        
MainInventoryWindow.hide();
        
DiscriptionWindow.hide();   
        
DiscriptionText.hide(); 
        
ItemButtonWindow.hide();
        
WeaponButtonWindow.hide();
        
ArmorButtonWindow.hide();
        
ToolButtonWindow.hide();
        
PrizeButtonWindow.hide();
        
SpellButtonWindow.hide();
        
StatButtonWindow.hide();
        
SkillButtonWindow.hide();        
        
PetButtonWindow.hide(); 
        
OptionButtonWindow.hide();        
      }
    break;
  }

__________________
Shaded Legend Playerworld
-Past accounts - LoakeyTheElf - Loakey_P2P
-Past Servers - Rune - Sparitoria - Shaded Legends
-Past Sl Jobs * ET/LAT/NAT/LAT Admin/Developer/Admin/Head Admin/Asst. Manager/Manager
-Current Job - Retired

*Sorry you must have mistaken me for someone that cares .

Last edited by Loakey_P2P; 11-12-2006 at 12:26 AM..
Reply With Quote
  #2  
Old 11-12-2006, 12:48 AM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
okay..first of all you don't have to do that many hide and shows...o___o

just hide or show the parent.
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
  #3  
Old 11-12-2006, 01:03 AM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
in that script, there are no parent as I see..
__________________
Reply With Quote
  #4  
Old 11-12-2006, 04:01 PM
Loakey_P2P Loakey_P2P is offline
SL Oldbie
Loakey_P2P's Avatar
Join Date: Apr 2006
Location: U.S.A
Posts: 137
Loakey_P2P is an unknown quantity at this point
Send a message via AIM to Loakey_P2P Send a message via Yahoo to Loakey_P2P
Quote:
Originally Posted by coreys View Post
okay..first of all you don't have to do that many hide and shows...o___o

just hide or show the parent.
yea , i can understand that but i wasnt sure if it would still be able to tell a different set of height or width or other part's to each button . but that wasnt my question . my question concerned the clicking of each button to set a string or open a different window for each on . i remmber seeing some command on the wikipidia site several day's ago but im not sure if it's the one im looking for . it was some kind of action command . i noticed it already has a built in if clicked , highlight button command but i need to figure out how to make it do thing's when the button is pressed . ill add an image to show what it look's like thus far .

__________________
Shaded Legend Playerworld
-Past accounts - LoakeyTheElf - Loakey_P2P
-Past Servers - Rune - Sparitoria - Shaded Legends
-Past Sl Jobs * ET/LAT/NAT/LAT Admin/Developer/Admin/Head Admin/Asst. Manager/Manager
-Current Job - Retired

*Sorry you must have mistaken me for someone that cares .
Reply With Quote
  #5  
Old 11-12-2006, 04:40 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Loakey, if you made a bitmap for the GUIs it would look realy cool
(So they fit the GUI displaying HP, MP etc..)
__________________
Reply With Quote
  #6  
Old 11-12-2006, 05:16 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
Add the buttons to the window, then you just need to show/hide the window instead of showing/hiding each individual button:
PHP Code:
new GuiWindowCtrl(DiscriptionWindow){
  new 
GuiButtonCtrl(ItemButtonWindow){ 
  }
  ...

To display the description of the button when you move the mouse over it, use the hint-attribute, like
PHP Code:
new GuiButtonCtrl(ItemButtonWindow){ 
  
hint "This is the item button"

To react to the button click, use the onAction-event:
PHP Code:
function ItemButtonWindow.onAction() {
  ...

Reply With Quote
  #7  
Old 11-12-2006, 06:55 PM
Loakey_P2P Loakey_P2P is offline
SL Oldbie
Loakey_P2P's Avatar
Join Date: Apr 2006
Location: U.S.A
Posts: 137
Loakey_P2P is an unknown quantity at this point
Send a message via AIM to Loakey_P2P Send a message via Yahoo to Loakey_P2P
ight , sounds simple enough . thank's stefan
__________________
Shaded Legend Playerworld
-Past accounts - LoakeyTheElf - Loakey_P2P
-Past Servers - Rune - Sparitoria - Shaded Legends
-Past Sl Jobs * ET/LAT/NAT/LAT Admin/Developer/Admin/Head Admin/Asst. Manager/Manager
-Current Job - Retired

*Sorry you must have mistaken me for someone that cares .
Reply With Quote
  #8  
Old 11-12-2006, 07:03 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
PHP Code:
new GuiControlProfile(profile_name){
  ...
  
bitmap "imagename.png";
}
new 
GuiWindowCtrl(window_gui){
  
profile profile_name;
  ...

too make a new profile with an bitmap :]
also, check out http://wiki.graal.net/index.php/Crea...ControlProfile
for use of GuiControlProfile()
__________________
Reply With Quote
  #9  
Old 11-13-2006, 03:00 PM
Loakey_P2P Loakey_P2P is offline
SL Oldbie
Loakey_P2P's Avatar
Join Date: Apr 2006
Location: U.S.A
Posts: 137
Loakey_P2P is an unknown quantity at this point
Send a message via AIM to Loakey_P2P Send a message via Yahoo to Loakey_P2P
well for the longest time sl has had some kind of personal made gui or inventory . what im attempting to do is to make a inventory and gui from the basic image's stefan and graal so graciously provided in the "graal/levels3d/gui" folder . its just my opion but there realy isnt anything gained in person images and out or the ordinary scripting . sometimes something really good looking and well working comes out , but not too often .

this last atempt to restore sl was not just to finish but to also upgrade everything and try to simplify it at the same time . to reconstuct the server and better organize it , make it all work at it's best but also make it so nothing takes a rocket scientist to figure out and do . also we talked to some oldbies to get a better understanding of what sl was ment to be in the begining . which isnt where sl was going . so were gona try to make sl more what it was intended to be while incorperateing what everone spent so long on .

i got the actions to work but now i have a new issue , when they click a button a window open's display the weapon's or item's they have . but if they go to a different section i need to make the last place opened close before the new section open's . here's what i tryed just off the top of my head so yes i know its wrong .

function ItemButtonWindow.onAction(){
@ client.lastclicked @ ListWindow.hide();
sleep("0.01");
ItemListWindow.show();
DiscriptionWindow.show();
DiscriptionText.show();
client.lastclicked = "Item";
}

i just need to know how to make the hide command use a client string to define the prefix of the command . but im not even sure if it's possable .
__________________
Shaded Legend Playerworld
-Past accounts - LoakeyTheElf - Loakey_P2P
-Past Servers - Rune - Sparitoria - Shaded Legends
-Past Sl Jobs * ET/LAT/NAT/LAT Admin/Developer/Admin/Head Admin/Asst. Manager/Manager
-Current Job - Retired

*Sorry you must have mistaken me for someone that cares .

Last edited by Loakey_P2P; 11-13-2006 at 03:36 PM..
Reply With Quote
  #10  
Old 11-13-2006, 06:15 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
PHP Code:
(@ client.lastclicked "ListWindow").hide();
or
(@ 
client.lastclicked "ListWindow").destroy(); 
something like that?
__________________
Reply With Quote
  #11  
Old 06-04-2009, 11:11 PM
Loakey_P2P Loakey_P2P is offline
SL Oldbie
Loakey_P2P's Avatar
Join Date: Apr 2006
Location: U.S.A
Posts: 137
Loakey_P2P is an unknown quantity at this point
Send a message via AIM to Loakey_P2P Send a message via Yahoo to Loakey_P2P
Quote:
Originally Posted by Loakey_P2P View Post
well for the longest time sl has had some kind of personal made gui or inventory . what im attempting to do is to make a inventory and gui from the basic image's stefan and graal so graciously provided in the "graal/levels3d/gui" folder . its just my opion but there realy isnt anything gained in person images and out or the ordinary scripting . sometimes something really good looking and well working comes out , but not too often .

this last atempt to restore sl was not just to finish but to also upgrade everything and try to simplify it at the same time . to reconstuct the server and better organize it , make it all work at it's best but also make it so nothing takes a rocket scientist to figure out and do . also we talked to some oldbies to get a better understanding of what sl was ment to be in the begining . which isnt where sl was going . so were gona try to make sl more what it was intended to be while incorperateing what everone spent so long on .

i got the actions to work but now i have a new issue , when they click a button a window open's display the weapon's or item's they have . but if they go to a different section i need to make the last place opened close before the new section open's . here's what i tryed just off the top of my head so yes i know its wrong .

function ItemButtonWindow.onAction(){
@ client.lastclicked @ ListWindow.hide();
sleep("0.01");
ItemListWindow.show();
DiscriptionWindow.show();
DiscriptionText.show();
client.lastclicked = "Item";
}

i just need to know how to make the hide command use a client string to define the prefix of the command . but im not even sure if it's possable .
holy s*** . i have no idea what i was talking about back then .
__________________
Shaded Legend Playerworld
-Past accounts - LoakeyTheElf - Loakey_P2P
-Past Servers - Rune - Sparitoria - Shaded Legends
-Past Sl Jobs * ET/LAT/NAT/LAT Admin/Developer/Admin/Head Admin/Asst. Manager/Manager
-Current Job - Retired

*Sorry you must have mistaken me for someone that cares .
Reply With Quote
  #12  
Old 06-05-2009, 12:03 AM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
Quote:
Originally Posted by Loakey_P2P View Post
holy s*** . i have no idea what i was talking about back then .

Did that honestly warrant you reviving a thread that is nearly 3 years old?
Reply With Quote
  #13  
Old 06-05-2009, 07:03 PM
Pelikano Pelikano is offline
Registered User
Pelikano's Avatar
Join Date: Oct 2008
Posts: 1,133
Pelikano can only hope to improve
Quote:
Originally Posted by Gambet View Post
Did that honestly warrant you reviving a thread that is nearly 3 years old?
I really don't think so
Reply With Quote
  #14  
Old 06-05-2009, 07:04 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
Quote:
Originally Posted by Pelikano View Post
I really don't think so
Then again, you weren't asked.
__________________
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 05:53 PM.


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