Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #16  
Old 03-15-2009, 11:50 AM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Quote:
Originally Posted by Angel_Light View Post
I don't get the problem, it works great for me and I have never had a problem with it....
Then you're just overcomplicating something that should be simple.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #17  
Old 03-15-2009, 12:14 PM
Angel_Light Angel_Light is offline
Varia Developer
Angel_Light's Avatar
Join Date: Nov 2005
Location: Knoxville, TN
Posts: 1,684
Angel_Light is on a distinguished road
Send a message via AIM to Angel_Light Send a message via MSN to Angel_Light
Quote:
Originally Posted by xXziroXx View Post
Then you're just overcomplicating something that should be simple.
lol, xD I think I understand what you mean, but it seems repetitive have several vars being set to the same value over and over, while you could just set all the values once.

Quote:
Originally Posted by Schetti View Post
umm...
I dont think so.
I made a LOOOOONG text, and it just didnt show up anymore.

how to say ...

the text goes out of the news window and wont be showen.
that means your MLText width is bigger than window width, try reducing, I usually take the gui width and - 20 for inner texts widths (compensation for the vscrollbar)
__________________
Deep into the Darkness peering...
Reply With Quote
  #18  
Old 03-15-2009, 04:30 PM
salesman salesman is offline
Finger lickin' good.
salesman's Avatar
Join Date: Nov 2008
Location: Colorado
Posts: 1,865
salesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud of
I don't think you guys are referring to the same thing.

(?)Angel_Light is referring to this as good practice:
PHP Code:
temp.foo temp.bar temp.yay 42
(?)and Ziro is referring to this as crappy styling:
PHP Code:
temp.foo     3;
temp.bar     7;
temp.yai     10;
temp.crapthisoneislongerthantherest 20;
temp.nowihavetoreadjustallofthepreviousspacing "frown"
Correct me if I'm wrong.
Reply With Quote
  #19  
Old 03-15-2009, 06:22 PM
Angel_Light Angel_Light is offline
Varia Developer
Angel_Light's Avatar
Join Date: Nov 2005
Location: Knoxville, TN
Posts: 1,684
Angel_Light is on a distinguished road
Send a message via AIM to Angel_Light Send a message via MSN to Angel_Light
Quote:
Originally Posted by salesman View Post
I don't think you guys are referring to the same thing.

(?)Angel_Light is referring to this as good practice:
PHP Code:
temp.foo temp.bar temp.yay 42
(?)and Ziro is referring to this as crappy styling:
PHP Code:
temp.foo     3;
temp.bar     7;
temp.yai     10;
temp.crapthisoneislongerthantherest 20;
temp.nowihavetoreadjustallofthepreviousspacing "frown"
Correct me if I'm wrong.
That's what I'm talking about...
__________________
Deep into the Darkness peering...
Reply With Quote
  #20  
Old 03-15-2009, 06:48 PM
Codein Codein is offline
jwd
Codein's Avatar
Join Date: Oct 2005
Location: Greater Manchester
Posts: 2,423
Codein has a spectacular aura aboutCodein has a spectacular aura about
Send a message via AIM to Codein Send a message via MSN to Codein
Either way, I prefer doing it like this:

PHP Code:
temp.var1 true;
temp.var2 true;
temp.var3 true
so then I can easily do, say, temp.var2 = false, without having to mess around.
Reply With Quote
  #21  
Old 03-15-2009, 08:10 PM
Angel_Light Angel_Light is offline
Varia Developer
Angel_Light's Avatar
Join Date: Nov 2005
Location: Knoxville, TN
Posts: 1,684
Angel_Light is on a distinguished road
Send a message via AIM to Angel_Light Send a message via MSN to Angel_Light
Quote:
Originally Posted by Codein View Post
Either way, I prefer doing it like this:

PHP Code:
temp.var1 true;
temp.var2 true;
temp.var3 true
so then I can easily do, say, temp.var2 = false, without having to mess around.
styling choice really. although they both produce the same results. =P
__________________
Deep into the Darkness peering...
Reply With Quote
  #22  
Old 03-16-2009, 11:36 PM
Codein Codein is offline
jwd
Codein's Avatar
Join Date: Oct 2005
Location: Greater Manchester
Posts: 2,423
Codein has a spectacular aura aboutCodein has a spectacular aura about
Send a message via AIM to Codein Send a message via MSN to Codein
Quote:
Originally Posted by Angel_Light View Post
styling choice really. although they both produce the same results. =P
I'd say it was a choice between "Waste time once or waste time multiple times later", but that's just my honest opinion. Only really good, in my opinion (opinion being key here), for when you're assigning multiple variables (see example), but, even still, I don't like doing that.

PHP Code:
temp.var = 3;
temp.var2 temp.var3 temp.var1
Reply With Quote
  #23  
Old 03-17-2009, 08:21 PM
Deas_Voice Deas_Voice is offline
Deas
Deas_Voice's Avatar
Join Date: Jun 2007
Location: Sweden
Posts: 2,264
Deas_Voice is a jewel in the roughDeas_Voice is a jewel in the rough
Send a message via AIM to Deas_Voice Send a message via MSN to Deas_Voice Send a message via Yahoo to Deas_Voice
okey, we get it, stop argue about it!
__________________
.
WTF is real life, and where do I Download it?
There is no Real Life, just AFK!
since 2003~
I Support~
ღAeonღ | ღTestbedღ | ღDelteriaღ

if you are going to rep me, don't be an idiot, leave your name!
I got nothing but love for you
Reply With Quote
  #24  
Old 03-26-2009, 03:14 PM
Schetti Schetti is offline
SC2 Player
Schetti's Avatar
Join Date: Nov 2008
Location: Austria
Posts: 269
Schetti is on a distinguished road
With Scroll, FINALLY!

Now with scroll, smaller and also position = {}; extent = {}; stuff and better names(NewsTab etc.).
Also, if you want to use it(for those who didnt know)
Save it for example under -System/News
and after that, open the script for Control-NPC and add this
PHP Code:
function onActionPlayerOnline(){
  
addweapon("-System/News");

And this is the Final News-Window
PHP Code:
//#CLIENTSIDE
function onCreated()
{
  
NewsWindow = new GuiWindowCtrl("NewsWindow");
  
  
with (NewsWindow)
  {
    
profile     "GuiBlueWindowProfile"
    
position    "640 390";
    
extent      "380 380";
    
canMove     true
    
canResize   false
    
canMaximize false
    
canClose    true
    
tile        true
    
text        "News"
    
    new 
GuiControl(NewsTab)
    {
      
visible    false;
      
profile    "GuiBlueControlProfile";
      
position   "10 52";
      
extent     "360 310";
      
    new 
GuiScrollCtrl("NewsScroll") {
      
profile GuiBlueScrollProfile;
      
position = { 510};
      
extent = { 350300};
      
hscrollbar "alwaysOff";
      
vscrollbar "alwaysOn";


    new 
GuiMLTextCtrl("NewsList") { 

         
profile GuiBlueMLTextProfile;
         
extent = { 51832};   
        
horizsizing "width";
text "
Insert News here ^^
        "
;                                            

      };
    }
    };
    
    new 
GuiControl(HiringsTab)
    {
      
visible    false;
      
profile    "GuiBlueControlProfile";
      
position   "10 52";
      
extent     "360 310";
      
    new 
GuiScrollCtrl("HiringsScroll") {
      
profile GuiBlueScrollProfile;
      
position = { 510};
      
extent = { 350300};
      
hscrollbar "alwaysOff";
      
vscrollbar "alwaysOn";


    new 
GuiMLTextCtrl("HiringsList") {
        
profile GuiBlueMLTextProfile
        
horizsizing "width";
extent = { 34732};
text "
Insert Hirings stuff here ^^

        "
;    
       
      };
    }
    };
    
    new 
GuiControl(StaffTab)
    {
      
visible    false;
      
profile    "GuiBlueControlProfile";
      
position   "10 52";
      
extent     "360 310";
      
    new 
GuiScrollCtrl("StaffScroll") {
      
profile GuiBlueScrollProfile;
      
position = { 510};
      
extent = { 350300};
      
hscrollbar "alwaysOff";
      
vscrollbar "alwaysOn";


    new 
GuiMLTextCtrl("StaffList") {
        
profile GuiBlueMLTextProfile
        
horizsizing "width";
        
position = { xy};
        
extent = { 34732};
text "
Insert staff list here ^^
"
;    
       
      };
    }
    };
    
    new 
GuiTabCtrl(ExampleTabs)
    {
      
profile   "GuiBlueTabProfile";
      
position  "10 28";
      
extent    "300 24";
      
      
clearRows();
      
with (addRow(0"News"))
      {
        
this.pane NewsTab;
      }
      
with (addRow(1"Hirings"))
      {
        
this.pane HiringsTab;
      }
      
with (addRow(2"Staff"))
      {
        
this.pane StaffTab;
      }
      
      
thiso.catchevent(name"onSelect""onTabSelect");
    };
  };
  
ExampleTabs.setSelectedById(0);
  
GraalControl.addControl(NewsWindow);
}

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();
    }
  }

Attached Thumbnails
Click image for larger version

Name:	News.jpg
Views:	172
Size:	17.1 KB
ID:	47843  
__________________
“Peace cannot be kept by force. It can only be achieved by understanding.” – Albert Einstein

Last edited by Schetti; 03-26-2009 at 04:57 PM..
Reply With Quote
  #25  
Old 03-31-2009, 03:39 AM
xfazex xfazex is offline
Registered User
Join Date: Feb 2009
Location: Eastern Shore, Maryland USA
Posts: 81
xfazex is an unknown quantity at this point
Send a message via AIM to xfazex Send a message via MSN to xfazex Send a message via Yahoo to xfazex
Errors from this script:

PHP Code:
ScriptCouldn't create object: type GuiWindowCtrl is not existing at line 4 in script of -System/News
Script: Couldn'
t create objecttype GuiControl is not existing at line 18 in script of -System/News
Script
Couldn't create object: type GuiScrollCtrl is not existing at line 25 in script of -System/News
Script: Couldn'
t create objecttype GuiMLTextCtrl is not existing at line 33 in script of -System/News
Script
: Function addcontrol not found at line 33 in script of -System/News
Script
: Function addcontrol not found at line 25 in script of -System/News
Script
: Function addcontrol not found at line 18 in script of -System/News
Script
Couldn't create object: type GuiControl is not existing at line 44 in script of -System/News
Script: Couldn'
t create objecttype GuiScrollCtrl is not existing at line 51 in script of -System/News
Script
Couldn't create object: type GuiMLTextCtrl is not existing at line 59 in script of -System/News
Script: Function addcontrol not found at line 59 in script of -System/News
Script: Function addcontrol not found at line 51 in script of -System/News
Script: Function addcontrol not found at line 44 in script of -System/News
Script: Couldn'
t create objecttype GuiControl is not existing at line 70 in script of -System/News
Script
Couldn't create object: type GuiScrollCtrl is not existing at line 77 in script of -System/News
Script: Couldn'
t create objecttype GuiMLTextCtrl is not existing at line 85 in script of -System/News
Script
: Function addcontrol not found at line 85 in script of -System/News
Script
: Function addcontrol not found at line 77 in script of -System/News
Script
: Function addcontrol not found at line 70 in script of -System/News
Script
Couldn't create object: type GuiTabCtrl is not existing at line 96 in script of -System/News 
Reply With Quote
  #26  
Old 04-09-2009, 06:45 PM
Schetti Schetti is offline
SC2 Player
Schetti's Avatar
Join Date: Nov 2008
Location: Austria
Posts: 269
Schetti is on a distinguished road
lawl, maybe I shouldnt "edit" the script and just post the one I use:


If this doesnt work, I should stop scripting
PHP Code:
//Made by Schetti
/* useful Codes:
<b>text</b>
<u>text</u>
<i>text</i>
<center>text</center>
*/

//#CLIENTSIDE
function onCreated()
{
  
NewsWindow = new GuiWindowCtrl("NewsWindow");
  
  
with (NewsWindow)
  {
    
profile     "GuiBlueWindowProfile"
    
position    "640 390";
    
extent      "380 380";
    
canMove     true
    
canResize   false
    
canMaximize false
    
canClose    true
    
tile        true
    
text        "Supernova-News"
    
    new 
GuiControl(NewsTab)
    {
      
visible    false;
      
profile    "GuiBlueControlProfile";
      
position   "10 52";
      
extent     "360 310";
      
    new 
GuiScrollCtrl("NewsScroll") {
      
profile GuiBlueScrollProfile;
      
position = { 510};
      
extent = { 350300};
      
hscrollbar "alwaysOff";
      
vscrollbar "alwaysOn";


    new 
GuiMLTextCtrl("NewsList") { 

         
profile GuiBlueMLTextProfile;
         
extent = { 51832};   
        
horizsizing "width";
text "
<u><b>Schetti:</b></u>
I am working on our mine system,
but it needs GFX!

<u><b>Lucas:</b></u>
Finally we got tailor (Schetti
made it,much thanks to he for that) 
to open it say /tailor.

<u><b>Schetti:</b></u>
The newswindow is fixed now.
We are working on some quests now.

<u><b>Schetti:</b></u>
I am is working on a new Event. 
I hope it works
"
;                                            

      };
    }
    };
    
    new 
GuiControl(HiringsTab)
    {
      
visible    false;
      
profile    "GuiBlueControlProfile";
      
position   "10 52";
      
extent     "360 310";
      
    new 
GuiScrollCtrl("HiringsScroll") {
      
profile GuiBlueScrollProfile;
      
position = { 510};
      
extent = { 350300};
      
hscrollbar "alwaysOff";
      
vscrollbar "alwaysOn";


    new 
GuiMLTextCtrl("HiringsList") {
        
profile GuiBlueMLTextProfile
        
horizsizing "width";
extent = { 34732};
text "
We are currently under construction and we hire every kind of staff 
exept FAQ/GP and ET.

<b>WE HARDLY NEED SCRIPTERS(NAT)!
Just send us 2-3 of your best scripts.</b>

If you're interested write an E-Mail to:
                                         
[email protected]
or  [email protected]
                                                                                                       
with some of your levels, ganis or what ever you make at your job                 
and some personal stuff like: 
your experience on other servers, 
why you want to be staff here, 
and why do you think we should take you 
instead of another applicant.

LATs can contact Schetti or Lucas3 if they are online.
We might give you OnlineEditor so you can show us what you can.

You also can say 
/latapply  or
/gfxapply



<b>IMPORTAND!</b>
Please dont write an apply, if you aren't Gold.
        "
;    
       
      };
    }
    };
    
    new 
GuiControl(StaffTab)
    {
      
visible    false;
      
profile    "GuiBlueControlProfile";
      
position   "10 52";
      
extent     "360 310";
      
    new 
GuiScrollCtrl("StaffScroll") {
      
profile GuiBlueScrollProfile;
      
position = { 510};
      
extent = { 350300};
      
hscrollbar "alwaysOff";
      
vscrollbar "alwaysOn";


    new 
GuiMLTextCtrl("StaffList") {
        
profile GuiBlueMLTextProfile
        
horizsizing "width";
        
position = { xy};
        
extent = { 34732};
text "
*Owner*
Lucas3

*CO-Owner*
<b>needed</b>  

*Manager*
<b>needed</b> 
                                                                                                                                                                
*Developer*
PowerProNL
tstre

*GFX*
<b>needed</b>

*LAT*
Schetti
Valtor
sonnfel"
;    
       
      };
    }
    };
    
    new 
GuiTabCtrl(ExampleTabs)
    {
      
profile   "GuiBlueTabProfile";
      
position  "10 28";
      
extent    "300 24";
      
      
clearRows();
      
with (addRow(0"News"))
      {
        
this.pane NewsTab;
      }
      
with (addRow(1"Hirings"))
      {
        
this.pane HiringsTab;
      }
      
with (addRow(2"Staff"))
      {
        
this.pane StaffTab;
      }
      
      
thiso.catchevent(name"onSelect""onTabSelect");
    };
  };
  
ExampleTabs.setSelectedById(0);
  
GraalControl.addControl(NewsWindow);
}

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();
    }
  }

__________________
“Peace cannot be kept by force. It can only be achieved by understanding.” – Albert Einstein
Reply With Quote
  #27  
Old 04-09-2009, 08:55 PM
devilsknite1 devilsknite1 is offline
C:
devilsknite1's Avatar
Join Date: Jul 2006
Location: Florida, USA
Posts: 269
devilsknite1 has a spectacular aura about
Send a message via AIM to devilsknite1 Send a message via MSN to devilsknite1 Send a message via Yahoo to devilsknite1
I'd suggest using
PHP Code:
NL 
on your text = ""; line. NL means Next Line.

It would look something like this:
PHP Code:
text "hi" NL "<b><u><font color=000000>black font that's bold and underlined!</font></u></b>" NL "weee"
Not sure if I'm right, but just doing enter's won't create new lines. If it does, then cool, you can keep doing it that way and ignore what I said
I guess it's personal preference, though. It just might free up some space in that script.
Reply With Quote
  #28  
Old 04-09-2009, 09:06 PM
[email protected] sid.gottlieb@googlemail.com is offline
Banned
Join Date: Mar 2008
Posts: 861
sid.gottlieb@googlemail.com will become famous soon enough
Or you can use
HTML Code:
text = "hi\n lol hi new line\n again";
Reply With Quote
  #29  
Old 04-09-2009, 09:13 PM
fragman85 fragman85 is offline
Banned
Join Date: Mar 2009
Location: Switzerland
Posts: 261
fragman85 is on a distinguished road
Quote:
Originally Posted by [email protected] View Post
Or you can use
HTML Code:
text = "hi\n lol hi new line\n again";
That's also how linebreaks get saved in DBs btw. :o
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 01:41 PM.


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