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 02-12-2007, 04:40 AM
Rapidwolve Rapidwolve is offline
Registered User
Join Date: Jul 2006
Posts: 1,241
Rapidwolve is an unknown quantity at this point
Interaction Script

I'm scripting an NPC interaction script. For example, once you first start the script the npc asks a question, and there are 2-3 answers that you can respond to, when you answer that question, there are another set of answers you can do. I'm stuck on the second set of answers. I have no idea how to get to the third dimension -_-. Help Please? PS: The last option always ends the script so I dont add into the array for the last option, and the size of the replymsg's and replyopt's must equal to the size of 'this.options'

PHP Code:
// In this example the NPC asks how are you?
this.options = {"Good","Alright","Leave me alone"};
this.replymsg = {{"Thats good to hear, I've got some business to handle ill talk to you later"},{"Only alright? Why is that?"}};
this.replyopt = {{"","","Alright then, bye."},{"I need some help","Forget it","I'm leaving"},{"Nice","","Bye"},}; 
Reply With Quote
  #2  
Old 02-12-2007, 09:38 AM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
PHP Code:
this.replymsg[0][0] = "Thats good to hear...."
this.replymsg[0][1] = "Only alright? Why is that...." 
You could do a loop too, which I think is better
HTML Code:
for (temp.curMessage: this.replymsg[0])
{
  chat @= temp.curMessage;
}
Reply With Quote
  #3  
Old 02-12-2007, 10:23 AM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Quote:
Originally Posted by Chandler View Post
PHP Code:
this.replymsg[0][0] = "Thats good to hear...."
this.replymsg[0][1] = "Only alright? Why is that...." 
You could do a loop too, which I think is better
HTML Code:
for (temp.curMessage: this.replymsg[0])
{
  chat @= temp.curMessage;
}
I am not sure that is at all helpful.
__________________
Skyld
Reply With Quote
  #4  
Old 02-14-2007, 05:22 PM
Rapidwolve Rapidwolve is offline
Registered User
Join Date: Jul 2006
Posts: 1,241
Rapidwolve is an unknown quantity at this point
I figured out a solution for my old problem. Now my problem is that, when the NPC message gets to more than 6 lines (im using tokenize). I want it to create a new page, and keep creating new pages for every 6 lines until theres no more lines. This part completely boggles me
Reply With Quote
  #5  
Old 02-14-2007, 06:29 PM
JkWhoSaysNi JkWhoSaysNi is offline
Ruler of the graalaxy
Join Date: Feb 2005
Location: Great Britain
Posts: 488
JkWhoSaysNi is on a distinguished road
Send a message via ICQ to JkWhoSaysNi
what do you mean by 'page'?
__________________

Coming soon (Hopefully:P)
Reply With Quote
  #6  
Old 02-14-2007, 08:00 PM
Rapidwolve Rapidwolve is offline
Registered User
Join Date: Jul 2006
Posts: 1,241
Rapidwolve is an unknown quantity at this point
Quote:
Originally Posted by JkWhoSaysNi View Post
what do you mean by 'page'?
Like, it shows the first 6 lines thens stops, and move ot the next page it moves on to the next 6 lines and hides the old 6 lines

6 lines = 1 page

Last edited by Rapidwolve; 02-14-2007 at 08:11 PM..
Reply With Quote
  #7  
Old 02-14-2007, 09:45 PM
Kristi Kristi is offline
Bowie's Deciple
Kristi's Avatar
Join Date: Dec 2003
Location: Boston, MA
Posts: 748
Kristi has a spectacular aura aboutKristi has a spectacular aura about
Send a message via AIM to Kristi Send a message via MSN to Kristi
That statement still seems very vague... are you displaying 6 lines and then want to display the next six?
__________________
Reply With Quote
  #8  
Old 02-14-2007, 10:07 PM
Rapidwolve Rapidwolve is offline
Registered User
Join Date: Jul 2006
Posts: 1,241
Rapidwolve is an unknown quantity at this point
Quote:
Originally Posted by Kristi View Post
That statement still seems very vague... are you displaying 6 lines and then want to display the next six?
Just never mind...ill figure it out -_-
your really slow
Reply With Quote
  #9  
Old 02-15-2007, 04:47 AM
Rapidwolve Rapidwolve is offline
Registered User
Join Date: Jul 2006
Posts: 1,241
Rapidwolve is an unknown quantity at this point
Ok, I figured out how to seperate each page by 6 lines

PHP Code:
this.page 0;
this.linesperpage 7;
for (
this.0this.tokens.size(); this.i++){
this.pages int(this.this.linesperpage);
if (
this.page this.linesperpage => this.i){
showText(300+this.i,this.mainpos[0],this.mainpos[1]-135+(this.i*15),this.stylethis.fonttokens[this.page this.linesperpage this.i]);
changeimgvis(300+this.i,8);
changeimgzoom(300+this.i,.59);

It adds a line to the current page from the page thats supposed to be the next page onto the bottom of the current page...confusing...i think it has to do with the math can anyone help fix?
}
Reply With Quote
  #10  
Old 02-15-2007, 04:54 AM
Kristi Kristi is offline
Bowie's Deciple
Kristi's Avatar
Join Date: Dec 2003
Location: Boston, MA
Posts: 748
Kristi has a spectacular aura aboutKristi has a spectacular aura about
Send a message via AIM to Kristi Send a message via MSN to Kristi
Quote:
Originally Posted by Rapidwolve View Post
Ok, I figured out how to seperate each page by 6 lines

PHP Code:
this.page 0;
this.linesperpage 7;
for (
this.0this.tokens.size(); this.i++){
this.pages int(this.this.linesperpage);
if (
this.page this.linesperpage => this.i){
showText(300+this.i,this.mainpos[0],this.mainpos[1]-135+(this.i*15),this.stylethis.fonttokens[this.page this.linesperpage this.i]);
changeimgvis(300+this.i,8);
changeimgzoom(300+this.i,.59);

It adds a line to the current page from the page thats supposed to be the next page onto the bottom of the current page...confusing...i think it has to do with the math can anyone help fix?
}
since i do not know what you are tokenizing, I am not sure if I can answer this!
__________________
Reply With Quote
  #11  
Old 02-15-2007, 05:07 AM
Rapidwolve Rapidwolve is offline
Registered User
Join Date: Jul 2006
Posts: 1,241
Rapidwolve is an unknown quantity at this point
PHP Code:
tokens wraptext2(111this.fontsize" "this.font "@" this.style "@" obj[0]);

obj[0is
TEST TEST TEST TEST
TEST TEST TEST TEST
TEST TEST TEST TEST
TEST TEST TEST TEST
TEST TEST TEST TEST 
TEST TEST TEST TEST 
TEST TEST TEST TEST
TEST TEST TEST TEST
TEST TEST TEST newb

Never mind I fixed it with
if (this.linesperpage - 1 => this.i)
Reply With Quote
  #12  
Old 02-15-2007, 04:25 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Just something.. dude, please work on your styling. Its horrible and its very hard to read for us others if you ever need help.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #13  
Old 02-15-2007, 10:34 PM
Rapidwolve Rapidwolve is offline
Registered User
Join Date: Jul 2006
Posts: 1,241
Rapidwolve is an unknown quantity at this point
Oh, thats not the actual script. I just typed it up
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 09:19 PM.


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