Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   quick question (https://forums.graalonline.com/forums/showthread.php?t=87828)

Rave_J 09-09-2009 04:56 AM

quick question
 
ok i seen this a lot and want to know what you guys think since im new to the scripting ect.

Ok the GUI Editor
i seen it a lot pretty basic to use
but cant you use particles and gani's to display on the gui ?
but lack of quality graphics

then i see Showimg()
a lot too with more quality graphics ect basically displays as a img not a bitmap boarder

so my question is what will give you less lag and give you good quality graphics to do is it better to use showimg or gui editor.

i also while i put in a bitmap using current era bitmap as a example the text on the button is slightly off where u can only read half of it how would i fix this problem ?

cbk1994 09-09-2009 05:08 AM

First, you should avoid the GUI editor like the plague. It is much easier and neater to hand-code GUIs.

Second, it depends what you want to use it for whether you should use GUIs or showimgs.

And third, can you show the code you're using to set the bitmap?

Rave_J 09-09-2009 06:48 AM

ya sorry here it is "umm the gui editor is really not that messy well i guess if you didn't make it
PHP Code:

New GuiWindowCtrl("MyGUI_Window1") {
    
profile GuiBlueWindowProfile;
    
clientrelative true;
    
clientextent "320,240";
    
profile.bitmap "guiera_window.png"
    
visible=0;
    
canclose false;
    
canmaximize false;
    
canminimize false;
    
canmove true;
    
canresize true;
    
closequery false;
    
destroyonhide false;
    
text "Baddy Quest";
    
580;
    
208;

    new 
GuiButtonCtrl("MyGUI_Button1") {
      
useownprofile true;
      
text "Accept";
      
width 80;
      
26;
      
186;
      
profile.bitmap "guiera_button.png";
    } 


cbk1994 09-09-2009 12:56 PM

PHP Code:

function showGui() {
  new 
GuiWindowCtrl("QuestControl_Window") {
    
profile GuiBlueWindowProfile;
    
    
clientrelative true;
    
clientwidth 320;
    
clientheight 240;
    
    
visible canClose canMaximize canResize canMinimize false;
    
    
text "Baddy Quest";
    
    
580;
    
208;
    
    new 
GuiButtonCtrl("QuestControl_Accept") {
      
profile "GuiEraButtonProfile";
      
      
width 80;
      
height 25;
      
      
26;
      
186;
    }
  }


Doesn't that look nicer?

Keep in mind that visible is a boolean, so you should not set it to '0'; instead use 'false'. "new" should also not be capitalized.

You would also do well to read this to avoid conflict later on.

As far as the profile, chances are there are some text offset things set in the profile. You can see more about that here.

Chompy 09-09-2009 02:15 PM

Quote:

Originally Posted by cbk1994 (Post 1521942)
PHP Code:



Doesn't that look nicer?

Personal Preference (: (How you 'categorize' variables into groups is personal preference ^^)

Quote:

Originally Posted by cbk1994 (Post 1521942)
Keep in mind that visible is a boolean, so you should not set it to '0'; instead use 'false'. "new" should also not be capitalized.

True bools do not exactly 'exist' in graal, as it's either 0 or 1. So it doesn't matter if you use true or false as the engine will read it as 0 or 1 anyways.

Reason why you can do
PHP Code:

if ((true true) == 2) {
  
// proceed


So it's basicly just easier to write 0 and 1 instead of true and false, since it's shorter

Gambet 09-09-2009 03:10 PM

And for those of you that have complained before that there is no sense in people using '0' for false and '1' for true (people like Ziro), in Discrete Mathematics '0' is applied to the false boolean value and '1' is applied to the true one. Hell, I think it's even in Finite Math for that matter, and any other logic-based mathematics.

xXziroXx 09-09-2009 03:20 PM

Quote:

Originally Posted by Gambet (Post 1521963)
And for those of you that have complained before that there is no sense in people using '0' for false and '1' for true (people like Ziro)

Low blows is all you can do, isn't it? I can't remember ever saying that there is no sense in using '0' for false and '1' for true, but it makes more sense using true/false in most cases.

Rave_J 09-09-2009 03:37 PM

See that's that i thought chompy
i was taught 0 is close AND 1 is open instead of using windowname.destroy ()
visible=0 in the gui script and on buttonOnActicon {
put visible=1 to close it they said it helps your computer run it better then destory

Gambet 09-09-2009 03:45 PM

Quote:

Originally Posted by xXziroXx (Post 1521965)
Low blows is all you can do, isn't it? I can't remember ever saying that there is no sense in using '0' for false and '1' for true, but it makes more sense using true/false in most cases.

Not intended as a low blow, just giving an example so it doesn't seem like I'm mouthing off randomly, but I can see where you would take offense. It's just rather annoying when people say that '1' and '0' shouldn't refer to true and false when they're simply showing that they have no clear sense of logical mathematics.

cbk1994 09-09-2009 10:25 PM

Quote:

Originally Posted by Chompy (Post 1521952)
Personal Preference (: (How you 'categorize' variables into groups is personal preference ^^)

:rolleyes:
Quote:

True bools do not exactly 'exist' in graal, as it's either 0 or 1. So it doesn't matter if you use true or false as the engine will read it as 0 or 1 anyways.
Are you seriously going to reply with something that useless? x_x

Of course booleans do not "exist" in Graal, but should be really be encouraging new scripters to use '0' and '1'?

Gambet 09-09-2009 10:38 PM

Quote:

Originally Posted by cbk1994 (Post 1522063)
Of course booleans do not "exist" in Graal, but should be really be encouraging new scripters to use '0' and '1'?

I always use true/false simply because it's easier to understand when quickly skimming through code but there isn't much of a difference otherwise.

WhiteDragon 09-10-2009 12:34 AM

Depending on the dynamic typing system in place, 1 and 0 (stored as integers) can easily mean different things than true and false (stored as bits).

(true + true) is only possible because it dynamically changes true to 1 when you try to perform a numerical operation (addition).

It's generally good to stick to the construct utilized for a specific purpose because of the optimizations that come along with it; and even if there aren't currently optimizations, it'll suck if the optimizer gets updated and having to edit all your scripts around to get the new optimizations.

Chompy 09-10-2009 02:22 PM

Quote:

Originally Posted by cbk1994 (Post 1522063)
Are you seriously going to reply with something that useless? x_x

Quote:

Originally Posted by Rave_J (Post 1521966)
See that's that i thought chompy

So it's useless? Nothing is useless, it just depends on how you use it. It might of been useless for you, but for others, maybe not. So don't call my posts/replies useless unless it's spam, thank you.

Rave_J 09-10-2009 05:09 PM

?? i never said it was useless i just said i got taught by using 0 and 1 instead of true and false

Chompy 09-10-2009 05:44 PM

Quote:

Originally Posted by Rave_J (Post 1522153)
?? i never said it was useless i just said i got taught by using 0 and 1 instead of true and false

I know, but Chris did.


All times are GMT +2. The time now is 06:32 AM.

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