Graal Forums  

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

Closed Thread
 
Thread Tools Search this Thread Display Modes
  #1  
Old 09-27-2004, 03:37 AM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
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.
__________________
BEst Insult ever: If I had a dollar for every brain you DIDNT have, i'd have one dollar!
  #2  
Old 09-27-2004, 05:46 AM
Slash-P2P Slash-P2P is offline
Banned
Join Date: May 2004
Location: Burning Blade
Posts: 941
Slash-P2P is on a distinguished road
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...

Last edited by Slash-P2P; 09-27-2004 at 05:58 AM..
  #3  
Old 09-27-2004, 05:56 PM
Dach Dach is offline
call me Chad, it's cooler
Dach's Avatar
Join Date: Aug 2002
Posts: 1,899
Dach is on a distinguished road
Quote:
Originally Posted by Slash-P2P
Maybe this will end the thread.
-long code here-
Anyone else notice that one of his indexes (8675309) is a song? A bad one if I may add...
That's not quite a complete optimization, I must say. Not to mention I do believe your taste in music is a whee bit poor

on-topic, I was messing with this script this morning and duplicated your problem easily, but when I got back just now I wasn't getting any blinking... I'd just suggest making your code a bit more eloquent. I.E.
  • use showtext index,x,y,font,style,text; instead of showimg index,@font@style@text,x,y;
  • Add static text to the menu image instead of wasting cpu by using showtext.
  • Don't draw static images or borders with showpoly. Put it on the menu image.
  • Put all initiating code in a created block (triggeraction, showstats, local variable definitions) and the rest in a timeout (no freaking while+sleep loops!).
__________________
Scripting Documents:Old Script Documentation-Movement Tutorial
  #4  
Old 09-27-2004, 08:43 PM
Slash-P2P Slash-P2P is offline
Banned
Join Date: May 2004
Location: Burning Blade
Posts: 941
Slash-P2P is on a distinguished road
Quote:
Originally Posted by Dach
That's not quite a complete optimization, I must say. Not to mention I do believe your taste in music is a whee bit poor
The song gets very annoying

He needs to learn on his own so I didn't try to make it completely optimized.
  #5  
Old 09-27-2004, 03:04 PM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally Posted by falco10291029
i tried several of the things suggested, waht r u talking about?
I gave three suggestions. Did you pay heed to any of them?

Quote:
Originally Posted by NeoJenova
How can you complain? You're the one polluting the thread with bad advice.
__________________
  #6  
Old 09-27-2004, 06:08 PM
NeoJenova NeoJenova is offline
my name isn't bold, HA!
NeoJenova's Avatar
Join Date: Jun 2003
Location: 0H10
Posts: 668
NeoJenova will become famous soon enough
Send a message via AIM to NeoJenova Send a message via Yahoo to NeoJenova
Quote:
Originally Posted by Kaimetsu
How can you complain? You're the one polluting the thread with bad advice.
I don't remember contributing any advice to this thread, I only expressed my opinion on your comments.
__________________
[helpfulthreads] | advertising
[server] | unholynation

  #7  
Old 09-27-2004, 07:26 PM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally Posted by NeoJenova
I don't remember contributing any advice to this thread
I apologise. The original post had been deleted and I couldn't remember the name of the person who posted it. Since you were objecting, I assumed you were he.

Still, I cannot see how you could complain about my advice. Xecutor/DIABLO2099 was doing the thread a great disservice by forcing his ignorance upon it.
__________________
  #8  
Old 09-27-2004, 09:09 PM
NeoJenova NeoJenova is offline
my name isn't bold, HA!
NeoJenova's Avatar
Join Date: Jun 2003
Location: 0H10
Posts: 668
NeoJenova will become famous soon enough
Send a message via AIM to NeoJenova Send a message via Yahoo to NeoJenova
Quote:
Originally Posted by Kaimetsu
Xecutor/DIABLO2099 was doing the thread a great disservice by forcing his ignorance upon it.
Oh. Didn't see his post.
__________________
[helpfulthreads] | advertising
[server] | unholynation

  #9  
Old 09-27-2004, 09:07 PM
Zero Hour Zero Hour is offline
Stiff Upper Lip
Zero Hour's Avatar
Join Date: Oct 2006
Location: Nova Scotia, Canada
Posts: 0
Zero Hour is on a distinguished road
Send a message via AIM to Zero Hour
I'm not sure, but isn't there a way draw a GUI on a certain screen level so that it doesn't actually timeout, etc. (Although I suppose you would need them to draw the health bars, etc.)

*shrug* Maybe it was already mentioned.
__________________
  #10  
Old 09-27-2004, 09:09 PM
Slash-P2P Slash-P2P is offline
Banned
Join Date: May 2004
Location: Burning Blade
Posts: 941
Slash-P2P is on a distinguished road
Quote:
Originally Posted by Zero Hour
I'm not sure, but isn't there a way draw a GUI on a certain screen level so that it doesn't actually timeout, etc. (Although I suppose you would need them to draw the health bars, etc.)

*shrug* Maybe it was already mentioned.
I think you can just do showimg/showtext with layer 4+ and it stays shown on the screen.

NPC Code:

if (playerenters) {
showtext 200,screenwidth-2,screenheight-16,r,verdana,hello;
changeimgvis 200,4;
changeimgzoom 200,.7;
}



I believe thats what I did.
  #11  
Old 09-27-2004, 10:19 PM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
Quote:
use showtext index,x,y,font,style,text; instead of showimg index,@font@style@text,x,y;
Add static text to the menu image instead of wasting cpu by using showtext.
Don't draw static images or borders with showpoly. Put it on the menu image.
Put all initiating code in a created block (triggeraction, showstats, local variable definitions) and the rest in a timeout (no freaking while+sleep loops!).
All good suggestions but not verywell needed ones.

Quote:
Maybe this will end the thread
-code-
Didn't help and you left some stuff out. I'd fill it in but i would rather just use my old one. No point in using a slightly better broken object :/
__________________
BEst Insult ever: If I had a dollar for every brain you DIDNT have, i'd have one dollar!
  #12  
Old 09-27-2004, 10:25 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
Just try to remove all showimgs except one, so that the code gets very small and easy to analyze
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 04:44 AM.


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