Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 09-27-2005, 06:40 PM
Torankusu_2002 Torankusu_2002 is offline
'been round.
Torankusu_2002's Avatar
Join Date: Nov 2001
Posts: 1,246
Torankusu_2002 is on a distinguished road
Wraptext 2?

Wraptext 2, in GS1, I understand how it works.

Instead of tokens (gs1), can it read directly from the string you are wraptext2-ing now in GS2?

I need to wrap multiple strings (text), but I don't want to use the same tokens over and over again. (I'll show an example later if people are unclear of what I am talking about.)

I've got a HUD/GUI scripted in GS1 that works pretty well, I just can't go any further because I can't wrap but one string because it reads the wrapped text as tokens.
__________________
torankusu's
Reply With Quote
  #2  
Old 09-27-2005, 07:21 PM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
Are asking if 'wraptext2' in GS2 can return to something else other than tokens?
__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.
Reply With Quote
  #3  
Old 09-28-2005, 12:14 AM
ForgottenLegacy ForgottenLegacy is offline
-Backtoscripts-
Join Date: Aug 2003
Location: California
Posts: 289
ForgottenLegacy is on a distinguished road
Send a message via AIM to ForgottenLegacy
Assign the tokens to an array. Example:
PHP Code:
this.string "value with spaces";
this.tokens this.string.tokenize();
// this.tokens[0] == "value", and so on 
I would suspect you'd do the same with wraptext and wraptext2.
__________________
"The higher you fly, the harder it is to breathe."

[Kaidenn] Maybe I will somehow take control of Lance's body when he isn't looking, have him log onto Kingdoms, update one script, and leave.
[Kaidenn] And leave him exactly where I found him, unchanged and completely unnaware of what just took place the last two minutes.
[GrowlZ] Lance: You might want to lock your bedroom door tonight
Reply With Quote
  #4  
Old 09-28-2005, 04:29 AM
Torankusu_2002 Torankusu_2002 is offline
'been round.
Torankusu_2002's Avatar
Join Date: Nov 2001
Posts: 1,246
Torankusu_2002 is on a distinguished road
Quote:
Originally Posted by ForgottenLegacy
Assign the tokens to an array. Example:
PHP Code:
this.string "value with spaces";
this.tokens this.string.tokenize();
// this.tokens[0] == "value", and so on 
I would suspect you'd do the same with wraptext and wraptext2.
Er, you're not getting what I am saying, I don't think. Either that, or I don't understand where you're getting at...

Anyways, The problem with using tokens for wraptext2 for what I am trying to script is I am doing this:

Wraptext2 this1string. (examples only)
Wraptext2 this2string.

I am trying to place this1string in a certain position (there's no set# of letters/pixels it will be.)

And I am trying to place this2string at another place. The problem with this is, with the for loop, it checks tokens [ for (this.i=0;this.i<tokenscount;this.i++) ] to display the text properly as well as wrap. I can get one string to wrap, but the second string shows up the same as the first, and there is no way that I can think of to determine the separate strings' token #'s.

Understand better now?

Anyways, I was informed that in GS2 the strings are set to arrays instead of tokens, so that they could be accessed better. (strlen i think? for the array in the foor loop.) so that it would display the correct text. True?
__________________
torankusu's
Reply With Quote
  #5  
Old 09-28-2005, 05:16 AM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
Ok, I think I know where you are getting at (correct me if I am wrong). You want to wrap the text of two separate strings, but want them put into separate string arrays? If so, GS2 makes that super easy.

PHP Code:
tokens1 wraptext2(zoomwidthdelimsString1);
tokens2 wraptext2(zoomwidthdelimsString2);
//Of course, edit the arguments 
Anyways, that would take String1 and String2, wrap their text and put it into 'tokens1' and 'tokens2', respectively.
__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.
Reply With Quote
  #6  
Old 09-28-2005, 05:33 AM
Torankusu_2002 Torankusu_2002 is offline
'been round.
Torankusu_2002's Avatar
Join Date: Nov 2001
Posts: 1,246
Torankusu_2002 is on a distinguished road
Quote:
Originally Posted by napo_p2p
Ok, I think I know where you are getting at (correct me if I am wrong). You want to wrap the text of two separate strings, but want them put into separate string arrays? If so, GS2 makes that super easy.

PHP Code:
tokens1 wraptext2(zoomwidthdelimsString1);
tokens2 wraptext2(zoomwidthdelimsString2);
//Of course, edit the arguments 
Anyways, that would take String1 and String2, wrap their text and put it into 'tokens1' and 'tokens2', respectively.
Yes, this is what I was wanting confirmation on.

I had been told GS2 made it super easy because the problem had been ran into in the past.

So...now all I have to do is convert my whole GUI to GS2.
yay.
__________________
torankusu's
Reply With Quote
  #7  
Old 09-29-2005, 05:27 AM
Torankusu_2002 Torankusu_2002 is offline
'been round.
Torankusu_2002's Avatar
Join Date: Nov 2001
Posts: 1,246
Torankusu_2002 is on a distinguished road
the only problem I am having now is trying to display it in a showtext.

NPC Code:

token1.wraptext2(760,1," ",client.questtitle);
token2.wraptext2(760,1," ",client.questtitle2);



and later ->

NPC Code:

for(this.i = 0; this.i < token1.size(); this.i++){
showtext(1,screenwidth/2-210,screenheight/2-80+(this.i*15),"Arial","B",token1[this.i]);

changeimgvis(1,5);
changeimgzoom(1,.6);
}



That could be horribly wrong, but I don't know much about the whole object system and how I would access the text I've wrapped..

Also, index is set to 1 for testing purposes only. I haven't assigned it an index yet.
__________________
torankusu's
Reply With Quote
  #8  
Old 09-29-2005, 05:32 AM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
use:
PHP Code:
token1 wrapText2(zoomwidthdelimsString1); 
instead of:
PHP Code:
token1.wrapText2(zoomwidthdelimsString1); 
__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.
Reply With Quote
  #9  
Old 09-29-2005, 05:47 AM
Torankusu_2002 Torankusu_2002 is offline
'been round.
Torankusu_2002's Avatar
Join Date: Nov 2001
Posts: 1,246
Torankusu_2002 is on a distinguished road
sorry for double posting, but I was wondering if there was a max amount of characters that could be held in a string? Or displayed using wraptext2 ?

It seems like it cuts out half of the string when it wraps the text.
__________________
torankusu's
Reply With Quote
  #10  
Old 09-29-2005, 02:32 PM
Torankusu_2002 Torankusu_2002 is offline
'been round.
Torankusu_2002's Avatar
Join Date: Nov 2001
Posts: 1,246
Torankusu_2002 is on a distinguished road
Here are screenshots of my problem.

First SS:
Both strings display properly, but they aren't maxed out to where they would have to wrap and display both beginning of the string and end.
The string on top is:
client.questtitle=This is a test to see if all of the stuff is working right. aaaaaaaaaaa bbbbbbbbb

Second SS:
The bottom string is still displaying properly, but when I add more text for the wraptext2 to wrap, it WRAPS the text correctly, but it takes away the text above it.

Portion I am using to display the text:
NPC Code:

//Displaying the First String.
for(this.i = 0; this.i < token1.size(); this.i++){
showtext(216,screenwidth/2-210,screenheight/2-80+(this.i*15),"Arial","B",token1[this.i]);
changeimgvis(216,5);
changeimgzoom(216,.6);
}
//Displaying the Second String.
for(this.j = 0; this.j < token2.size(); this.j++){
showtext(217,screenwidth/2-210,screenheight/2-10+(this.j*15),"Arial","B",token2[this.j]);
changeimgvis(217,5);
changeimgzoom(217,.6);
}



Would it be anything wrong with the way I am wraping the text?
NPC Code:

token1 = wraptext2(760,1," ",client.questtitle);
token2 = wraptext2(760,1," ",client.questtitle2);

Attached Thumbnails
Click image for larger version

Name:	guiss.png
Views:	163
Size:	85.0 KB
ID:	33723   Click image for larger version

Name:	guiss2.png
Views:	139
Size:	83.5 KB
ID:	33724  
__________________
torankusu's

Last edited by Torankusu_2002; 09-29-2005 at 02:53 PM..
Reply With Quote
  #11  
Old 09-29-2005, 07:32 PM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
Quote:
Originally Posted by Torankusu_2002
NPC Code:
changeimgzoom(216,.6);


NPC Code:
token1 = wraptext2(760,1," ",client.questtitle);

The second param for wrapText2 is the zoom you are using.
(Yours isn't matching).
__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.
Reply With Quote
  #12  
Old 09-29-2005, 09:48 PM
Torankusu_2002 Torankusu_2002 is offline
'been round.
Torankusu_2002's Avatar
Join Date: Nov 2001
Posts: 1,246
Torankusu_2002 is on a distinguished road
Quote:
Originally Posted by napo_p2p
The second param for wrapText2 is the zoom you are using.
(Yours isn't matching).
What is the syntax for the GS2 wraptext2?
__________________
torankusu's
Reply With Quote
  #13  
Old 09-30-2005, 12:27 AM
ForgottenLegacy ForgottenLegacy is offline
-Backtoscripts-
Join Date: Aug 2003
Location: California
Posts: 289
ForgottenLegacy is on a distinguished road
Send a message via AIM to ForgottenLegacy
Quote:
Originally Posted by Torankusu_2002
What is the syntax for the GS2 wraptext2?
From scriptfunctions_client.txt:
PHP Code:
wraptext2(intfloatstrstr) - returns object 
I would assume it's 'width','zoom','font','text'
__________________
"The higher you fly, the harder it is to breathe."

[Kaidenn] Maybe I will somehow take control of Lance's body when he isn't looking, have him log onto Kingdoms, update one script, and leave.
[Kaidenn] And leave him exactly where I found him, unchanged and completely unnaware of what just took place the last two minutes.
[GrowlZ] Lance: You might want to lock your bedroom door tonight
Reply With Quote
  #14  
Old 09-30-2005, 02:31 AM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
Quote:
Originally Posted by Torankusu_2002
What is the syntax for the GS2 wraptext2?
I believe it's the same for old gscript....

Quote:
Originally Posted by napo_p2p
use:
PHP Code:
token1 wrapText2(zoomwidthdelimsString1); 
instead of:
PHP Code:
token1.wrapText2(zoomwidthdelimsString1); 
I put it there :P.
__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.
Reply With Quote
Reply

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 11:31 AM.


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