Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Custom Gui (https://forums.graalonline.com/forums/showthread.php?t=72420)

Angel_Light 02-24-2007 12:20 AM

Custom Gui
 
hey can someone show me how to make a custom gui (I mean with like a custom gui images border, so on and so forth.) I already know how to build them, I just want to know how to put a custom skin (I suppose thats a good term for this) on it.

xXziroXx 02-24-2007 12:25 AM

PHP Code:

with ("GuiWindowProfile"bitmap "FILENAME"

By adding that somewhere in a clientsided script, all GuiWindowCtrl would look like the new image.

Angel_Light 02-24-2007 12:32 AM

1 Attachment(s)
Nope :/
PHP Code:

 with ("Master_Gui_Niromia"bitmap "guiwood_niromia.png"

here the image file so you guys know what I mean.

godofwarares 02-24-2007 12:36 AM

PHP Code:

temp.profile = new GuiWindowProfile("NiromiaWood");

with (temp.profile)
{
     
bitmap "guiwood_niromia.png";
}

new 
GuiWindowCtrl("GuiWindow")
{
     
profile NiromiaWood;
     
     
// . . .



xXziroXx 02-24-2007 12:36 AM

*sighs*

PHP Code:

with ("GuiWindowProfile"bitmap "guiwood_niromia.png"

Only change the bitmap name itself.

Angel_Light 02-24-2007 12:38 AM

Quote:

Originally Posted by xXziroXx (Post 1281442)
*sighs*

Only change the bitmap name itself.

XD don't I feel dumb now :p, I haven't scripted in a month, give me a break. :P

EDIT : Nope neither way works, :/

Chompy 02-24-2007 12:53 AM

PHP Code:

//#CLIENTSIDE
function onCreated()
{
  new 
GuiControlProfile"gui_window")
    
bitmap "guiwood_niromia.png";

  
showGui();
}
function 
showGui()
{
  new 
GuiWindowCtrl"Main_GUI")
  {
    
profile "gui_window";
    ...
  }


Something like that?

or
PHP Code:

//#CLIENTSIDE
function onCreated()
{
  new 
GuiWindowCtrl"Main_GUI")
  {
    ...
    
useownprofile true;
    
profile.bitmap "guiwood_niromia.png";
    ...
  }


Or maybe something like that, not sure :P

xXziroXx 02-24-2007 12:58 AM

OR you do what I showed you and you wont have to set a profile on every damn GUI you make on the server.

Angel_Light 02-24-2007 03:22 AM

I tried both way and chompy I do it the first way, I tried moving the bitmap thing into the actual gui. Also the gui, background vanishes, all the other text and scroll box stays.

Chandler 02-24-2007 08:37 AM

Show what you're testing. Make sure you have the weapon, and make sure it calls the profile before it draws it.

Admins 02-24-2007 01:07 PM

Check out what godofwarares wrote please.

with ("Master_Gui_Niromia") is wrong, do with (Master_Gui_Niromia) please, also
Master_Gui_Niromia.bitmap = "guiwood_niromia.png"; would be much better :rolleyes:

Gambet 02-24-2007 05:58 PM

Quote:

Originally Posted by Stefan (Post 1281567)
Master_Gui_Niromia.bitmap = "guiwood_niromia.png"; would be much better :rolleyes:

Yeah, some of you guys do a lot of pointless stuff when you don't need to since you're working with object-oriented programming.


Instead of doing, example:

PHP Code:

with (findNPC("Blah"))
{
  
player.chat this.test;


You can just do this:

PHP Code:

player.chat Blah.test


xXziroXx 02-24-2007 07:14 PM

Quote:

Originally Posted by Gambet (Post 1281623)
Yeah, some of you guys do a lot of pointless stuff when you don't need to since you're working with object-oriented programming.


Instead of doing, example:

PHP Code:

with (findNPC("Blah"))
{
  
player.chat this.test;


You can just do this:

PHP Code:

player.chat Blah.test


The more correct way would be:

PHP Code:

player.chat findNPC("Blah").test

:blush:

Chandler 02-24-2007 07:37 PM

Quote:

Originally Posted by Gambet (Post 1281623)
Yeah, some of you guys do a lot of pointless stuff when you don't need to since you're working with object-oriented programming.


Instead of doing, example:

PHP Code:

with (findNPC("Blah"))
{
  
player.chat this.test;


You can just do this:

PHP Code:

player.chat Blah.test


I'm laughing. hahaha

Angel_Light 02-24-2007 08:13 PM

godofwarares sent me this, it didn't work at first, but when I closed graal and logged back on it worked.

PHP Code:

//#CLIENTSIDE
function onCreated()
{
     new 
GuiWindowCtrl("Window")
     {
          
useOwnProfile true;
          
profile.bitmap "whatever.png";
          
          
position = { 100100 };
          
extent = { 200300 };

          
title destroyOnHide true;
          
canMaximize canResize false;

          
text format("Hello, %s!"player.nick);
     }


just one question aswell, I've seen this
PHP Code:

position = { 100100 }; 

and this
PHP Code:

position "100 100"

which way is correct, they both do the same thing?

cbk1994 02-24-2007 08:24 PM

Quote:

Originally Posted by Angel_Light (Post 1281681)
godofwarares sent me this, it didn't work at first, but when I closed graal and logged back on it worked.

PHP Code:

//#CLIENTSIDE
function onCreated()
{
     new 
GuiWindowCtrl("Window")
     {
          
useOwnProfile true;
          
profile.bitmap "whatever.png";
          
          
position = { 100100 };
          
extent = { 200300 };

          
title destroyOnHide true;
          
canMaximize canResize false;

          
text format("Hello, %s!"player.nick);
     }


just one question aswell, I've seen this
PHP Code:

position = { 100100 }; 

and this
PHP Code:

position "100 100"

which way is correct, they both do the same thing?

Either is fine ... I just use
x = BLAH;
y = BLAH;

Admins 02-24-2007 11:24 PM

Quote:

Originally Posted by xXziroXx (Post 1281662)
The more correct way would be:

PHP Code:

player.chat findNPC("Blah").test

:blush:

I would say player.chat = Blah.test is the better way :D findnpc is mainly there for compatbility. The same goes for position = "100 100" - the preferred way is position = {100, 100} but it is accepting different ways for compatbility (so that gui creation scripts from torque work without modification in graal script).

Gambet 02-25-2007 03:06 AM

Quote:

Originally Posted by xXziroXx (Post 1281662)
The more correct way would be:

PHP Code:

player.chat findNPC("Blah").test

:blush:

Quote:

Originally Posted by Chandler (Post 1281674)
I'm laughing. hahaha


Yes, because it's logical to tell an NPC to search for information that is already accessible to it, right? :rolleyes:


Quote:

Originally Posted by Stefan (Post 1281788)
I would say player.chat = Blah.test is the better way :D


;)

Twinny 02-25-2007 03:12 AM

Quote:

Originally Posted by Gambet (Post 1281623)
PHP Code:

with (findNPC("Blah"))
{
  
player.chat this.test;


You can just do this:

PHP Code:

player.chat Blah.test


It's funny cause I've only just recently showed you that on N-Pulse Dev >_<

Gambet 02-25-2007 03:13 AM

Quote:

Originally Posted by Twinny (Post 1281891)
It's funny cause I've only just recently showed you that on N-Pulse Dev >_<


Yeah, but that's like a teacher telling a student they can't teach other people what they've taught them (regarding your hostile approach).


Thanks, though.


Oh, and it was on AIM. Sometime last week I think :P

Twinny 02-25-2007 03:17 AM

I just thought it was very quick to use this,

Quote:

Originally Posted by Gambet
Yeah, some of you guys do a lot of pointless stuff when you don't need to since you're working with object-oriented programming.

Novo taught me the concepts of Object-Orientated programming. I'm happy to show anyone the concepts. I still have the stuff Novo used to teach me ^^.

Maybe I should just finish the interactive lessons....and the website.....^^.

Gambet 02-25-2007 03:21 AM

Quote:

Originally Posted by Twinny (Post 1281893)
I just thought it was very quick to use this,



Why? That's how you taught me x-x


Turns out it worked...^^

Kristi 02-25-2007 07:28 AM

Quote:

Originally Posted by Gambet (Post 1281892)
Yeah, but that's like a teacher telling a student they can't teach other people what they've taught them (regarding your hostile approach).


Thanks, though.


Oh, and it was on AIM. Sometime last week I think :P

But you do not "teach". You act like the person who does not know what you are saying is an idiot, and you down talk them like you are superior, when Twinny just even taught you it!

Gambet 02-25-2007 08:49 AM

Quote:

Originally Posted by Kristi (Post 1281944)
But you do not "teach". You act like the person who does not know what you are saying is an idiot, and you down talk them like you are superior, when Twinny just even taught you it!


Not at all.


That's the way Twinny taught me, and I learned, so I figured it would work for others.


I simply said that some people do useless stuff and then explained why via example. I didn't make any offensive comments toward anyone.


And it doesn't matter when I learned it. Why? Because even if I learned it 5 minutes ago or 5 years ago (obviously an exaggeration since GS2 hasn't been around to the public for 5 years), I'd still know the same information, so when I learned it is irrelevant.

Chandler 02-25-2007 09:25 AM

PHP Code:

with (findNPC("Blah"))
{
  
player.chat this.test;


I was laughing at this part. ;)

Angel_Light 02-25-2007 11:12 AM

Quote:

Originally Posted by Kristi (Post 1281944)
But you do not "teach". You act like the person who does not know what you are saying is an idiot, and you down talk them like you are superior, when Twinny just even taught you it!

Sometimes unconstructive critism is the best motivator, That how Invern got me to learn GS2. :o lol

Inverness 02-26-2007 02:22 AM

What, am I famous or something?
Quote:

Originally Posted by xXziroXx (Post 1281662)
The more correct way would be:

PHP Code:

player.chat findNPC("Blah").test

:blush:

Do you use findnpc("this").variable also?
Note: That was sarcasm, it doesn't work.

zokemon 02-26-2007 10:50 PM

I use
resize(x, y, w, h);
Much more clean ;)

Angel_Light 02-26-2007 11:35 PM

Quote:

Originally Posted by Inverness (Post 1282235)
What, am I famous or something?

Yes you are. ;]

godofwarares 02-27-2007 01:44 PM

Wow what is this? This thread got a little off topic . . . Oh well.

PHP Code:

player.chat findNpc("Control-NPC").whatever

Thats how I do it.

Gambet 02-27-2007 06:59 PM

Quote:

Originally Posted by godofwarares (Post 1282682)
Wow what is this? This thread got a little off topic . . . Oh well.

PHP Code:

player.chat findNpc("Control-NPC").whatever

Thats how I do it.


Stefan already backed up my example in saying that my way was the better way of doing it.

Chandler 02-27-2007 07:45 PM

Quote:

Originally Posted by Gambet (Post 1282729)
Stefan already backed up my example in saying that my way was the better way of doing it.

So what? That's his way of doing it.

Gambet 02-27-2007 08:04 PM

Quote:

Originally Posted by Chandler (Post 1282737)
So what? That's his way of doing it.


Oh, sorry, I thought it read "Thats how u do it"

Admins 02-28-2007 12:21 AM

Well it's not necessary better, it's shorter, but to show to readers that Control-NPC is a db-npc is can be ok to use findnpc() I guess.

Angel_Light 02-28-2007 01:14 AM

shorter saves more bytes, less bytes, USUALLY the quicker the script runs.

Tolnaftate2004 02-28-2007 05:00 AM

Quote:

Originally Posted by Angel_Light (Post 1282821)
shorter saves more bytes, less bytes, USUALLY the quicker the script runs.

There's no discernable correlation between script size and execution time. A larger file just takes more time to send to the client.

Twinny 02-28-2007 07:35 AM

It's compiled into a low level language anyway isn't it?


All times are GMT +2. The time now is 03:47 AM.

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