Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   wraptext2 is freezing players... (https://forums.graalonline.com/forums/showthread.php?t=37160)

G_yoshi 09-02-2002 12:00 PM

wraptext2 is freezing players...
 
I'm not sure what the problem is, but people get frozen during the character setup stuff on my PW. The reason is because I use wraptext2, or that is what I was told by Angel when she checked into it. There is an alternative to using wraptext2, but I want to keep my NPCs tidy and easy for me to go back and make changes on the fly.

This is a small section from part of my character setup stuff:

NPC Code:
  wraptext2 imgwidth(dk_window.png)-16,1,,@Trebuchet MS@Use the Arrow Keys to choose a JobClass. Press A to accept it. You must pick 3.;
for (i=0; i<tokenscount; i++) {
showimg 202+i,@Trebuchet MS@#t(i),(screenwidth/2)-191+16,(screenheight/2)+(i*18)-60;
showimg 302+i,@Trebuchet MS@#t(i),(screenwidth/2)-190+16,(screenheight/2)+(i*18)-59;
changeimgcolors 302+i,0,0,0,1;
changeimgzoom 202+i,1;
changeimgzoom 302+i,1;
changeimgvis 202+i,5;
changeimgvis 302+i,4;
}



Strange thing is, even on my crappy laptop, I didn't freeze...well, there were occasions where I used wraptext2 for something else and it made Graal freeze. :x But its otherwise never done that during character setup for me.

Falcor 09-02-2002 12:16 PM

perhaps its because the image hasn't loaded into the memory yet? Thus makeing your wraptext size a negitive number and making a near infinite (or negitive, just as bad) number of tokens. I would make it more defined.

like
NPC Code:

this.width = (imgwidth(dk_window.png)-16 > 0? imgwidth(dk_window.png)-16 : 128);
wraptext2 this.width,1,,@Trebuchet MS@Use the Arrow Keys...etc;



Or maybe just put in the acual width of dk_window.png, since its never gunna change anyway. (I would recommend this option over the previous)

G_yoshi 09-02-2002 12:40 PM

Quote:

Originally posted by Falcor
perhaps its because the image hasn't loaded into the memory yet? Thus makeing your wraptext size a negitive number and making a near infinite (or negitive, just as bad) number of tokens. I would make it more defined.

like
NPC Code:

this.width = (imgwidth(dk_window.png)-16 > 0? imgwidth(dk_window.png)-16 : 128);
wraptext2 this.width,1,,@Trebuchet MS@Use the Arrow Keys...etc;



Or maybe just put in the acual width of dk_window.png, since its never gunna change anyway. (I would recommend this option over the previous)

I think I'll do the later...I should know better than to use imgwidth/imgheight since I have to load the image first. Thanks :D

Falcor 09-02-2002 08:49 PM

Clean your PM box


All times are GMT +2. The time now is 09:57 AM.

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