Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 05-12-2010, 01:26 AM
iSlayer iSlayer is offline
Snk for manager
iSlayer's Avatar
Join Date: Feb 2010
Location: Room 7, Era Hotel, Era
Posts: 202
iSlayer will become famous soon enough
Startup GUI?

Hey guys I want to get a startup GUI and I found this in the Graal Bible

PHP Code:
//#CLIENTSIDE
function onCreated()
{
  
ExampleWindow = new GuiWindowCtrl("ExampleWindow");
  
  
with (ExampleWindow)
  {
    
profile     "GuiBlueWindowProfile";
    
position    "20 20";
    
extent      "320 240";
    
canMove     true;
    
canResize   false;
    
canMaximize false;
    
canClose    true;
    
tile        true;
    
text        "Welcome here i will display all the required information";
    
    new 
GuiControl(AppleTab)
    {
      
visible    false;
      
profile    "GuiBlueControlProfile";
      
position   "10 52";
      
extent     "222 184";
      
      new 
GuiTextCtrl(AppleTab_Label)
      {
        
profile  "GuiBlueTextProfile";
        
position "0 0";
        
extent   "222 20";
        
text     "Current Staff: Owner: iSlayer";
      };
    };
    
    new 
GuiControl(BananaTab)
    {
      
visible    false;
      
profile    "GuiBlueControlProfile";
      
position   "10 52";
      
extent     "222 184";
      
      new 
GuiTextCtrl(BananaTab_Label)
      {
        
profile  "GuiBlueTextProfile";
        
position "0 0";
        
extent   "222 20";
        
text     "We are hiring all dev positions";
      };
    };
    
    new 
GuiControl(CranberryTab)
    {
      
visible    false;
      
profile    "GuiBlueControlProfile";
      
position   "10 52";
      
extent     "222 184";
      
      new 
GuiTextCtrl(CranberryTab_Label)
      {
        
profile  "GuiBlueTextProfile";
        
position "0 0";
        
extent   "222 20";
        
text     "Forum PM to iSlayer";
      };
    };
    
    new 
GuiTabCtrl(ExampleTabs)
    {
      
profile   "GuiBlueTabProfile";
      
position  "10 28";
      
extent    "300 24";
      
      
clearRows();
      
with (addRow(0"Staff Members"))
      {
        
this.pane AppleTab;
      }
      
with (addRow(1"Hirings"))
      {
        
this.pane BananaTab;
      }
      
with (addRow(2"Contact"))
      {
        
this.pane CranberryTab;
      }
      
      
thiso.catchevent(name"onSelect""onTabSelect");
    };
  };
  
ExampleTabs.setSelectedById(0);
  
GraalControl.addControl(ExampleWindow);
}

function 
onTabSelect(tabs)
{
  for (
temp.tabtemp.tabs.rows)
  {
    if (
temp.tab.pane == null)
    {
      continue;
    }
    
    if (
temp.tab == temp.tabs.selected)
    {
      
temp.tab.pane.show();
    }
    else
    {
      
temp.tab.pane.hide();
    }
  }

Would this work? Any help would be helpful
__________________
Snk for manager




Quote:
Originally Posted by Admins View Post
Snk for manager of Era
Reply With Quote
  #2  
Old 05-12-2010, 01:35 AM
iSlayer iSlayer is offline
Snk for manager
iSlayer's Avatar
Join Date: Feb 2010
Location: Room 7, Era Hotel, Era
Posts: 202
iSlayer will become famous soon enough
Actually I found this

PHP Code:
function onActionServerSidecmd 

  if ( 
cmd == "getMessage" 
  { 
    
temp.n.loadLines"control/serverNews.txt" ); 
    
temp.h.loadLines"control/serverHirings.txt" ); 
    
temp.s.loadLines"control/serverStaff.txt" ); 
    
temp.i.loadLines"control/serverInfo.txt" ); 
    
triggerclient"gui"name"returnMessage"temp.ntemp.htemp.stemp.); 
  } 

//#CLIENTSIDE 
function onCreated() 

  
triggerserver"gui"name"getMessage" ); 

function 
onActionClientSidecmdnhs

  if ( 
cmd == "returnMessage" 
  { 
    for ( 
temp.
    { 
      
temp.ne @= temp."\n"
    } 
     
    for ( 
temp.
    { 
      
temp.hi @= temp."\n"
    } 
     
    for ( 
temp.
    { 
      
temp.st @= temp."\n"
    } 
     
    for ( 
temp.
    { 
      
temp.inf @= temp."\n"
    } 
     
    
showMessagetemp.netemp.hitemp.sttemp.inf ); 
  } 

function 
showMessagenewshiringsstaffinfo 

  new 
GuiWindowCtrl"LoginMessage_Window" 
  { 
    
profile "GuiBlueWindowProfile"
     
    
width 440
    
height 368
     
    
screenwidth - ( width ); 
    
screenheight - ( height ); 
     
    
canMaximize canResize false
    
canClose canMinimize visible title true
     
    
text "Welcome to" SPC servername "!"
     
    new 
GuiScrollCtrl"LoginMessage_NewsScroll" 
    { 
      
profile "GuiBlueScrollProfile"
       
      
15
      
54
       
      
width 410
      
height 300
       
      
vScrollBar "dynamic"
      
hScrollBar "alwaysOff"
       
      
visible false
       
      new 
GuiMLTextCtrl"LoginMessage_NewsText" 
      { 
        
profile "GuiBlueTextProfile"
         
        
3
        
0
         
        
width 390
        
height 300
         
        
text news
      } 
    } 
     
    new 
GuiScrollCtrl"LoginMessage_HiringsScroll" 
    { 
      
profile "GuiBlueScrollProfile"
       
      
15
      
54
       
      
width 410
      
height 300
       
      
vScrollBar "dynamic"
      
hScrollBar "alwaysOff"
       
      
visible false
       
      new 
GuiMLTextCtrl"LoginMessage_HiringsText" 
      { 
        
profile "GuiBlueTextProfile"
         
        
3
        
0
         
        
width 390
        
height 300
         
        
text hirings
      } 
    } 
     
    new 
GuiScrollCtrl"LoginMessage_StaffScroll" 
    { 
      
profile "GuiBlueScrollProfile"
       
      
15
      
54
       
      
width 410
      
height 300
       
      
vScrollBar "dynamic"
      
hScrollBar "alwaysOff"
       
      
visible false
       
      new 
GuiMLTextCtrl"LoginMessage_StaffText" 
      { 
        
profile "GuiBlueTextProfile"
         
        
3
        
0
         
        
width 390
        
height 300
         
        
text staff
      } 
    } 
     
    new 
GuiScrollCtrl"LoginMessage_InfoScroll" 
    { 
      
profile "GuiBlueScrollProfile"
       
      
15
      
54
       
      
width 410
      
height 300
       
      
vScrollBar "dynamic"
      
hScrollBar "alwaysOff"
       
      
visible false
       
      new 
GuiMLTextCtrl"LoginMessage_InfoText" 
      { 
        
profile "GuiBlueTextProfile"
         
        
3
        
0
         
        
width 390
        
height 300
         
        
text info
      } 
    } 
    new 
GuiTabCtrl"LoginMessage_Tab" 
    { 
      
profile "GuiBlueTabProfile"
       
      
35
      
30
       
      
width 450
      
height 24
       
      
tabwidth 90
       
      
clearRows(); 
       
      
temp.= { 
                 { 
"News""LoginMessage_NewsScroll" }, 
                 { 
"Hirings""LoginMessage_HiringsScroll" }, 
                 { 
"Staff""LoginMessage_StaffScroll" }, 
                 { 
"Info""LoginMessage_InfoScroll" 
               }; 
       
      for ( 
temp.temp.
      { 
        
with addRow0temp.a[0] ) ) 
        { 
          
this.iPane temp.a[1]; 
        } 
      } 
      
thiso.catcheventname"onSelect""onTabSelected" ); 
      
setSelectedRow); 
    } 
  } 

function 
onTabSelectedtabs 

  for ( 
temp.tabs.rows 
  { 
    if ( 
temp.== tabs.selected 
    { 
      ( @ 
temp.t.iPane[0] ).visible true
    } 
    else 
    { 
      ( @ 
temp.t.iPane[0] ).visible false
    } 
  } 

Then if I give (npcserver)
r control/*.txt

And uploaded the TXT files, added as an NPC to my server would it work?
__________________
Snk for manager




Quote:
Originally Posted by Admins View Post
Snk for manager of Era
Reply With Quote
  #3  
Old 05-12-2010, 01:41 AM
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
Your second post's script should work, but the NPC Scripting forum isn't always going to give you a copy-paste solution all-the-time, so cry scripter-wolf carefully and make an effort to learn the GS2 Language.
__________________
Quote:
Reply With Quote
  #4  
Old 05-12-2010, 02:41 AM
iSlayer iSlayer is offline
Snk for manager
iSlayer's Avatar
Join Date: Feb 2010
Location: Room 7, Era Hotel, Era
Posts: 202
iSlayer will become famous soon enough
Quote:
Originally Posted by fowlplay4 View Post
Your second post's script should work, but the NPC Scripting forum isn't always going to give you a copy-paste solution all-the-time, so cry scripter-wolf carefully and make an effort to learn the GS2 Language.
OK, I will learn
__________________
Snk for manager




Quote:
Originally Posted by Admins View Post
Snk for manager of Era
Reply With Quote
  #5  
Old 05-12-2010, 02: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
Hm, where'd you find that script anyways, can you link me?
__________________

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
  #6  
Old 05-12-2010, 02:59 AM
iSlayer iSlayer is offline
Snk for manager
iSlayer's Avatar
Join Date: Feb 2010
Location: Room 7, Era Hotel, Era
Posts: 202
iSlayer will become famous soon enough
First was on Graal Bible cant remmember where and second was on code gallery
__________________
Snk for manager




Quote:
Originally Posted by Admins View Post
Snk for manager of Era
Reply With Quote
  #7  
Old 05-12-2010, 05:35 AM
DeCeaseD DeCeaseD is offline
Registered User
Join Date: Jan 2008
Posts: 247
DeCeaseD will become famous soon enough
Quote:
Originally Posted by coreys View Post
Hm, where'd you find that script anyways, can you link me?
Abjorn, I just posted in that thread actually, it should be the number 1 thread in the Code Gallery labeled "Login Message" or so, if you could also answer my question that would be appreciated.
Reply With Quote
Reply


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 06:02 PM.


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