Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Hiding gui (https://forums.graalonline.com/forums/showthread.php?t=55507)

falco10291029 09-26-2004 03:36 PM

Hiding gui
 
Ok here's the thing. This gui is scripted just fine, but if you try lowering the timeout or having something that disrypts tiomeout loops go, the gui either flashes or hides. There is nothing in it telling it to hide, so why does it? Please look over it. Note that it works fine if nothing disrupts the timeout loop, which says that the gui hides if it isnt constantly told to show for some reason.


PHP Code:

if (actionserverside) {
setstring clientr.#s(client.element)power,#s(server.#s(client.element)power);
setstring clientr.#s(client.element)size,#s(server.#s(client.element)size);
setstring clientr.#s(client.element)allies,#s(server.#s(client.element)allies);
setstring clientr.#s(client.element)enemies,#s(server.#s(client.element)enemies);




}
//#CLIENTSIDE
if (created||playerenters||keypressed) {triggeraction 0,0,serverside,-GUI;this.alpha=1;}
//NORMAL GUI//
while (isweapon) {
  
showstats 1024;
  
showimg 250,cythusgui.gif,0,0;
    
changeimgvis 250,6;
  
changeimgcolors 250,1,1,1,this.alpha;
  
showimg 251,@TimesRoman@@#s(client.hp) / #s(client.maxhp),38.5,10;
  
changeimgvis 251,7;
  
changeimgcolors 251,0,0,0,1;
  
changeimgzoom 251,.6;
showimg 252,@TimesRoman@@#v(playermp) / 100 ,36.4,25.9;
  
changeimgvis 252,8;
  
changeimgcolors 252,0,0,0,1;
  
changeimgzoom 252,.6;
showimg 253,#W,149,5;
  
changeimgpart 253,0,0,270,160;
  
changeimgvis 253,7;
showtext 254,63,82,verdana,l,#w;
  
changeimgvis 254,8;
  
changeimgcolors 254,.1,.1,.1,1;
  
changeimgzoom 254,.55;
showimg 255,@TimesRoman@@#v(strtofloat(#s(client.tokens))),38.5,40.3;
  
changeimgvis 255,8;
  
changeimgcolors 255,.1,.1,.1,1;
  
changeimgzoom 255,.6;
showtext 259,5.4,55.3,verdana,b,Exp:   #v(strtofloat(#s(client.playerexp)));
  
changeimgvis 259,9;
  
changeimgcolors 259,0,0,0,1;
  
changeimgzoom 259,.6;
showtext 301,6,67.1,arial,bPwr#v(strtofloat(#s(client.playerpower)));
  
changeimgvis 301,9;
  
changeimgcolors 301,0,0,0,1;
  
changeimgzoom 301,.65;
showtext 8675309,79,115,timesRoman,c,x  #v(playerrupees);
changeimgvis 8675309,8;
  
changeimgcolors 8675309,0,1,0,1;
  
changeimgzoom 8675309,.9;
  
showimg 86753010,greenrupee.png,20,105;
  
changeimgvis 86753010,8;
showpoly 79999,{148,5,193,5};
  
changeimgcolors 79999,0,0,0,1;
  
changeimgvis 79999,14;
showpoly 79998,{148,5,148,45};
  
changeimgcolors 79998,0,0,0,1;
  
changeimgvis 79998,15;
showpoly 79997,{148,45,193,45};
  
changeimgcolors 79997,0,0,0,1;
  
changeimgvis 79997,16;
showpoly 79996,{193,5,193,45};
  
changeimgcolors 79996,0,0,0,1;
  
changeimgvis 79996,17;
showimg 79995,@Verdana@@Drop,160,52;
  
changeimgvis 79995,18;
  
changeimgcolors 79995,0,0,0,1;
  
changeimgzoom 79995,.5;
//bleh//
//Kingdom info//

showpoly 9999,{screenwidth-110,screenheight*0,screenwidth-1,screenheight*0,screenwidth-1,(screenheight*0)+100,screenwidth-110,(screenheight*0)+100};
changeimgvis 9999,4;
changeimgcolors 9999,.5,.5,.5,this.alpha;
showpoly 9998,{screenwidth-105,(screenheight-=1)+5,screenwidth-6,(screenheight-=1)+5,screenwidth-6,(screenheight-=1)+95,screenwidth-105,(screenheight-=1)+95};
changeimgvis 9998,6;
changeimgcolors 9998,.6,.6,.6,this.alpha;
showpoly 10009,{screenwidth-107.5,(screenheight-=1)+3,screenwidth-3.5,(screenheight-=1)+3,screenwidth-3.5,(screenheight-=1)+97.5,screenwidth-107.5,(screenheight-=1)+97.5};
changeimgvis 10009,5;
changeimgcolors 10009,.55,.55,.55,this.alpha;
showtext 9997,screenwidth-104,15,Verdana,l,Your Kingdom:#s(client.element);
changeimgvis 9997,7;
changeimgcolors 9997,0,0,0,this.alpha;
changeimgzoom 9997,.5;
showtext 9996,screenwidth-104,25,Verdana,l,Kingdom Power:#s(clientr.#s(client.element)power);
changeimgvis 9996,7;
changeimgcolors 9996,0,0,0,this.alpha;
changeimgzoom 9996,.5;
showtext 9995,screenwidth-104,35,Verdana,l,Kingdom Size:#s(clientr.#s(client.element)size);
changeimgvis 9995,7;
changeimgcolors 9995,0,0,0,this.alpha;
changeimgzoom 9995,.5;
showtext 9994,screenwidth-55,50,Verdana,c,=Allies=;
changeimgvis 9994,7;
changeimgcolors 9994,0,0,0,this.alpha;
changeimgzoom 9994,.5;
showtext 9993,screenwidth-55,60,Verdana,c,#s(clientr.#s(client.element)allies);
changeimgvis 9993,7;
changeimgcolors 9993,0,0,0,this.alpha;
changeimgzoom 9993,.5;
showtext 9992,screenwidth-55,70,Verdana,c,=Enemies=;
changeimgvis 9992,7;
changeimgcolors 9992,0,0,0,this.alpha;
changeimgzoom 9992,.5;
showtext 9991,screenwidth-55,80,Verdana,c,#s(clientr.#s(client.element)enemies);
changeimgvis 9991,7;
changeimgcolors 9991,0,0,0,this.alpha;
changeimgzoom 9991,.5;

//blah//
sleep .05;





Admins 09-26-2004 10:34 PM

I don't see problems in the concent, but in the implementation:
Bad is the usage of

screenheight-=1

That will cause problems for the compiler, I guess you meant "screenheight - 1" ?
The "triggeraction 0,0,serverside,-GUI;" should be moved outside the timeout so
that it doesn't lag the game, e.g. if (playerenters) triggeraction 0,0,serverside,-GUI;

falco10291029 09-27-2004 01:44 AM

thx i will try both of those real quick
EDIT:didnt work, updated script

falco10291029 09-27-2004 01:54 AM

il try that now i geuss....

EDIT: that didnt work either, updating code real quick

Kaimetsu 09-27-2004 02:22 AM

Advice 1: Do not listen to clueless UN managers
Advice 2: Strip your code to the bare essentials before posting it. Nobody wants to scan through pages of unrelated lines.
Advice 3: Don't just set the alpha to 0 in order to hide something.

Slash-P2P 09-27-2004 02:25 AM

I suggest since a lot of your changeimgzooms and changeimgvis's are alike, use a for () { to make them do that. another suggestion is put all your showtexts in 1 spot so it's easier to read.

Amen to Kai's Advice 1.

falco10291029 09-27-2004 02:25 AM

1. *****
2. I have no idea whats causing the problem so it culd be anywhere
3. make me!

Edit: I would use a for loop but i dont feel like changing around a bunch of numbers to do that, i didnt make all of this script and dont want to change a bunch of things.

Kaimetsu 09-27-2004 02:28 AM

Quote:

Originally Posted by falco10291029
2. I have no idea whats causing the problem so it culd be anywhere

So gradually cut stuff out and see if the problem persists.

Slash-P2P 09-27-2004 02:29 AM

Quote:

Originally Posted by falco10291029
Edit: I would use a for loop but i dont feel like changing around a bunch of numbers to do that, i didnt make all of this script and dont want to change a bunch of things.

It doesn't work. Wouldn't that mean you have to change a bunch of things?

falco10291029 09-27-2004 02:47 AM

no, it doesnt.....

xManiamaNx 09-27-2004 02:54 AM

Ive noticed that sometimes showimgs on layer 4 (and possibly up, not sure) will hide when playerhearts is changed by something such as a bed.

falco10291029 09-27-2004 02:57 AM

i dont use playerhearts at all.......

Kaimetsu 09-27-2004 03:30 AM

You request help but you ignore the advice and suggestions of those who contribute? You are fortunate that I am no longer a moderator here.

falco10291029 09-27-2004 03:37 AM

i tried several of the things suggested, waht r u talking about? i just dont want to bother putting it in a for loop is all, that's one thing! You really should read all posts before spewing such false info.

Slash-P2P 09-27-2004 05:46 AM

Maybe this will end the thread.

NPC Code:

if (actionserverside) {
setstring clientr.#s(client.element)power,#s(server.#s(clien t.element)power);
setstring clientr.#s(client.element)size,#s(server.#s(client .element)size);
setstring clientr.#s(client.element)allies,#s(server.#s(clie nt.element)allies);
setstring clientr.#s(client.element)enemies,#s(server.#s(cli ent.element)enemies);
}
//#CLIENTSIDE
// Initialize
if (created||playerenters||keypressed) {triggeraction 0,0,serverside,-GUI;this.alpha=1;}
while (isweapon) {
// Hide normal GUI
showstats 1024;
// Show stuff
showimg 250,cythusgui.gif,0,0;
changeimgcolors 250,1,1,1,this.alpha;
showimg 251,@TimesRoman@@#s(client.hp) / #s(client.maxhp),38.5,10;
showimg 252,@TimesRoman@@#v(playermp) / 100 ,36.4,25.9;
showimg 253,#W,149,5;
showtext 254,63,82,verdana,l,#w;
showimg 255,@TimesRoman@@#v(strtofloat(#s(client.tokens))) ,38.5,40.3;
showtext 259,5.4,55.3,verdana,b,Exp: #v(strtofloat(#s(client.playerexp)));
showtext 301,6,67.1,arial,b, Pwr: #v(strtofloat(#s(client.playerpower)));
// Layers
this.layers = {6,7,8,7,8,8,9};
for (i=0;i<arraylen(this.layers);i++) {
changeimgvis 250+i,this.layers[i];
}
changeimgvis 301,9;
// Zoom
this.zooms = {.6,.6,.55,.6,.6};
for (i=0;i<arraylen(this.layers);i++) {
changeimgvis 251+i,this.layers[i];
}
changeimgzoom 301,.65;
// Colors
changeimgcolors 251,0,0,0,1;
changeimgcolors 252,0,0,0,1;
changeimgcolors 254,.1,.1,.1,1;
changeimgcolors 255,.1,.1,.1,1;
changeimgcolors 259,0,0,0,1;
changeimgcolors 301,0,0,0,1;
// Part
changeimgpart 253,0,0,270,160;
// Stuff to show
showtext 8675309,79,115,timesRoman,c,x #v(playerrupees);
showimg 86753010,greenrupee.png,20,105;
showpoly 79999,{148,5,193,5};
showpoly 79998,{148,5,148,45};
showpoly 79997,{148,45,193,45};
showpoly 79996,{193,5,193,45};
showtext 79995,160,52,verdana,,Drop;
// Colors
for (i=0;i<5;i++) {
changeimgcolors 79995+i,0,0,0,1;
}
changeimgcolors 8675309,0,1,0,1;
// Vis
for (i=0;i<5;i++) {
changeimgvis 79995,(18-i);
}
changeimgvis 8675309,8;
changeimgvis 86753010,8;
// Zoom
changeimgzoom 79995,.5;
changeimgzoom 8675309,.9;

//Kingdom info

// Show the stuff
showpoly 9999,{screenwidth-110,screenheight*0,screenwidth-1,screenheight*0,screenwidth-1,(screenheight*0)+100,screenwidth-110,(screenheight*0)+100};
showpoly 9998,{screenwidth-105,(screenheight-=1)+5,screenwidth-6,(screenheight-=1)+5,screenwidth-6,(screenheight-=1)+95,screenwidth-105,(screenheight-=1)+95};
showpoly 10009,{screenwidth-107.5,(screenheight-=1)+3,screenwidth-3.5,(screenheight-=1)+3,screenwidth-3.5,(screenheight-=1)+97.5,screenwidth-107.5,(screenheight-=1)+97.5};
showtext 9997,screenwidth-104,15,Verdana,l,Your Kingdom:#s(client.element);
showtext 9996,screenwidth-104,25,Verdana,l,Kingdom Power:#s(clientr.#s(client.element)power);
showtext 9995,screenwidth-104,35,Verdana,l,Kingdom Size:#s(clientr.#s(client.element)size);
showtext 9994,screenwidth-55,50,Verdana,c,=Allies=;
showtext 9993,screenwidth-55,60,Verdana,c,#s(clientr.#s(client.element)allie s);
showtext 9992,screenwidth-55,70,Verdana,c,=Enemies=;
showtext 9991,screenwidth-55,80,Verdana,c,#s(clientr.#s(client.element)enemi es);
// Gray text
changeimgcolors 10009,.55,.55,.55,this.alpha;
changeimgcolors 9999,.5,.5,.5,this.alpha;
changeimgcolors 9998,.6,.6,.6,this.alpha;
// Change layers
changeimgvis 10009,5;
changeimgvis 9999,4;
changeimgvis 9998,6;
// Make text look alike
for (i=0;i<7;i++) {
changeimgvis 9990+i,7;
changeimgcolors 9990+i,0,0,0,this.alpha;
changeimgzoom 9990+i,.5;
}
// Stop uber lag
sleep .05;
}



Anyone else notice that one of his indexes (8675309) is a song? A bad one if I may add...


All times are GMT +2. The time now is 12:52 PM.

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