So, I've edited the program Callimuc created, had a few ... differences in expectations of the script so I just wanted to post it like it was open-source.
PHP Code:
const layout_image = "callimuc_say3background.png";
const layout_alpha = 0.8;
const TEXT_A = "A - Close";
const TEXT_N = "Right Arrow to go to the next page.";
const TEXT_S = "Left and Right arrow to change scroll speed.";
How you can use this:
- Create a class called say3
- Put this into the NPC you want to use this on. Just touch it than
PHP Code:
//#CLIENTSIDE
function onCreated() {
this.join("say3");
}
function onPlayerTouchsMe() {
this.say3("Hello this is your new sign!");
}
- For weapons you could use this and just fire the weapon than
PHP Code:
//#CLIENTSIDE
function onCreated() {
this.join("function_say3");
}
function onPlayerEnters() {
this.read = 0;
this.say3(0,.11,"sleep","
Good evening young one.
You've been in a coma for the
past two weeks.
Someone has also been looking for
a person named"SPC tok[0] SPC tok[1]@".
Are you this person?
");
onTimeout();
}
function onTimeout(){
if (this.textStop == 0 && this.read == 1){
temp.tok = player.nick.tokenize();
this.say3(0,.1,"idle", "comment sentences here");
settimer(.05);
}
params[0]
0 is the main messages, 1 is the ending message that says press A.
params[1]
This is the sleep time per letter in the message.
When it comes to a period it stops for the sleeptime +.15
An older NPC might have a slower speak time...
Players can hold down left or right to slow down or speed up the text.
Also players can press down to skip to the end.
params[2]
Place your gani name in quotes which you want to be set on each message.
Idle might be what you want it to set, for mine it starts in bed.
params[3]
List your comment here.
Here you can find the new script:
http://pastebin.graalcenter.org/read...86866510101046
When you enter into the reading part it tells the script that you are reading with this.textStop = 1;
If you aren't reading the next message will come up after the timeout.
(I have yes or no buttons pop up to activate the next say3)
Also, each time a message is finished this.read adds by 1.
For my buttons I had the buttons pop up on 1 (starts on 0), and then do ++ so it stops everything on 2, and when a button is clicked it goes to 3, when the next say3 happens.
For the future:
As you can see I tried to have the message repeat when the up button was pressed... I had it working once but I broke it and gave up.
Also I'd like to make the external side, the actual npc be able to go back to previous messages.
Possibly have an easier way to have heads and directions show.
Additions:
Constants are capitalized - Thanks cbk.
The new script works without having to click the GUI to use the buttons, I feel it is redundant and shouldn't need to do that.
It is a great way to loop through say3s.
Cons: The button that I have is outside of the class, and the timeout that calls the different say3's are outside of the class. (But I suppose that is how it should be.)
Please let me know if there is anyway we could improve on his program.
I couldn't find Dustys script anywhere. I don't think one should come into a thread, mention they have done it but not show where, and I have searched.
Thank you Callimuc.
-edit-
I broke the down key for the ending say3's, that will have to be edited later.