Welcome, Guest. Please login or register.

Author Topic: Internal Dialogue  (Read 908 times)

CreepiXTopic starter

  • Doctor
  • ***
  • Posts: 64
  • Learning internal.
    • View Profile
Internal Dialogue
« on: July 9, 2016, 04:19:30 AM »
Can anyone make a tutorial "How to make dialogues in internal scripting", or something like that? I don't know how to make internal dialogues. Please?  :victoria:

:shiny: :shiny: :shiny:                                :viridian: I want trinkets!

Kiwi Alexia ♡

  • tOLP Contributor
  • Hyper Captain
  • *******
  • Posts: 1352
  • Wii Homebrew and 3ds CFW is easy.
    • View Profile
    • VVVVVV Resource
Re: Internal Dialogue
« Reply #1 on: July 9, 2016, 05:29:42 AM »
Code: [Select]
squeak(color)
text(color,x,y,lines)
[The text]
position(x[,x])
speak_active

squeak(colour) - makes a crewmate squeak (or makes a terminal sound)
text(colour,x,y,lines) - creates a text box (which doesn't appear until you use speak_active or speak)
position(center/centerx/centery/colour,above/colour,below) - overrides the x,y of the text command (sets the position of the text box)
endtext - makes a text box disappear (fade out)
endtextfast - makes a text box disappear immediately (without fading out)
speak - shows a text box, without removing old text boxes. Also pauses the script until you press action (unless there's a backgroundtext command above it, see below)
speak_active - shows a text box, and removes any old text box. Also pauses the script until you press action (unless there's a backgroundtext command above it, see below)
backgroundtext - if you put this command on the line above speak or speak_active, the game will not wait until you press action after creating the text box. This can be used to create multiple text boxes at the same time, like this:


Code: [Select]
squeak(player)
text(gray,0,0,1)
This is text box one.
backgroundtext
speak_active
text(gray,0,50,1)
This is text box two!
backgroundtext
speak
text(gray,0,100,1)
They will appear all at once!
speak
endtext


(Copy and pasted from Dav999)

CreepiXTopic starter

  • Doctor
  • ***
  • Posts: 64
  • Learning internal.
    • View Profile
Re: Internal Dialogue
« Reply #2 on: July 9, 2016, 05:38:24 AM »
Code: [Select]
squeak(color)
text(color,x,y,lines)
[The text]
position(x[,x])
speak_active

squeak(colour) - makes a crewmate squeak (or makes a terminal sound)
text(colour,x,y,lines) - creates a text box (which doesn't appear until you use speak_active or speak)
position(center/centerx/centery/colour,above/colour,below) - overrides the x,y of the text command (sets the position of the text box)
endtext - makes a text box disappear (fade out)
endtextfast - makes a text box disappear immediately (without fading out)
speak - shows a text box, without removing old text boxes. Also pauses the script until you press action (unless there's a backgroundtext command above it, see below)
speak_active - shows a text box, and removes any old text box. Also pauses the script until you press action (unless there's a backgroundtext command above it, see below)
backgroundtext - if you put this command on the line above speak or speak_active, the game will not wait until you press action after creating the text box. This can be used to create multiple text boxes at the same time, like this:


Code: [Select]
squeak(player)
text(gray,0,0,1)
This is text box one.
backgroundtext
speak_active
text(gray,0,50,1)
This is text box two!
backgroundtext
speak
text(gray,0,100,1)
They will appear all at once!
speak
endtext


(Copy and pasted from Dav999)

Thank you!

Dav999

  • Administrator
  • Hyper Captain
  • *
  • Posts: 1594
    • View Profile
Re: Internal Dialogue
« Reply #3 on: July 9, 2016, 05:40:59 AM »
I've been making a new, complete guide. :viridian:

This is the most basic version of a text box:
Code: [Select]
text(player,50,50,1)
This is some text!
speak_active
This creates a cyan text box 50 pixels from the left and 50 pixels from the top, with 1 line. The text command just stores the text and position in memory, but doesn't display it yet; when you're finished, use speak_active to actually display it. The color can be player/cyan (it doesn't matter which of the two you use), gray (or anything that doesn't exist), red, blue, purple, yellow or green.

But it'd be nice if we could position it above the player or in the center or something, instead of at some coordinates...
Code: [Select]
text(player,0,0,1)
This is some text!
position(player,above)
speak_active

text(gray,0,0,1)
This is a terminal text box!
position(center)
speak_active
The position command replaces the coordinates that are given in the text command, and there are different combinations possible, such as position(center), position(player,above), position(red,below), et cetera. There are also position(centerx) and position(centery), for only centering on the X and Y axis respectively.

How about the sound that someone/a terminal makes when a text box appears? There's the squeak command for that:
Code: [Select]
squeak(player)
text(player,0,0,1)
This is some text!
position(player,above)
speak_active

squeak(terminal)
text(gray,0,0,1)
This is a terminal text box!
position(center)
speak_active
This combination of commands is by far the most commonly used for text boxes.

But the last text box will not go away!
Code: [Select]
squeak(player)
text(player,0,0,1)
This is some text!
position(player,above)
speak_active

squeak(terminal)
text(gray,0,0,1)
This is a terminal text box!
position(center)
speak_active

endtext
The endtext command should be used to dismiss text boxes before any kind of delay and before ending the script, basically whenever it isn't followed by another text box.

That's basically everything you need to know to get started, but there's more advanced stuff that you can use, which I'll list here for completeness.

speak_active removes old text boxes that were already on the screen, but you can avoid that by using speak instead of speak_active:
Code: [Select]
squeak(player)
text(player,0,0,1)
This is some text!
position(player,above)
speak_active

squeak(terminal)
text(gray,0,0,2)
The previous text box
is still on the screen now!
position(center)
speak

endtext

You can even make multiple text boxes appear at once. Normally speak and speak_active wait until you press the action key before the script continues, but not if you put backgroundtext before it:
Code: [Select]
squeak(player)
text(player,0,0,1)
This is some text!
position(player,above)
backgroundtext
speak_active

squeak(terminal)
text(gray,0,0,2)
Two text boxes
at the same time!
position(center)
speak

endtext

The same example with three text boxes that will appear at the same time:
Code: [Select]
squeak(player)
text(player,0,0,1)
This is some text!
position(player,above)
backgroundtext
speak_active

squeak(player)
text(player,0,0,1)
This is more text!
position(player,below)
backgroundtext
speak

squeak(terminal)
text(gray,0,0,2)
Three text boxes
at the same time!
position(center)
speak

endtext

Sometimes you may want to remove a text box immediately without fading it out. For that, endtextfast exists, you can just use it instead of endtext.

There's a command flipme that's supposed to correct text box positions in flip mode (for if you have a terminal that puts multiple text boxes on the screen), but it doesn't work properly.

There's also a command textboxactive, which removes all text boxes from the screen except for the last one. speak_active is actually a combination of speak and textboxactive, so textboxactive doesn't really have much use.

There's also a hidden way of centering a text box without using position(center)/position(centerx)/position(centery) that was especially useful when needing to maintain compatibility with 2.0, which is to write -500 for x and/or y coordinates. It saves a line, but it makes the script a bit less readable.

And there's a trick that allows you to access a couple more colors for text boxes.

Apart from the specialline(x) command (which probably doesn't have a use in player levels at all), that should be everything there is to know about text boxes in internal scripting!

EDIT: Corrected a small mistake
« Last Edit: July 9, 2016, 12:00:02 PM by Dav999 »

Kiwi Alexia ♡

  • tOLP Contributor
  • Hyper Captain
  • *******
  • Posts: 1352
  • Wii Homebrew and 3ds CFW is easy.
    • View Profile
    • VVVVVV Resource
Re: Internal Dialogue
« Reply #4 on: July 9, 2016, 05:41:23 AM »
goddavvit

Shiny K

  • tOLP Contributor
  • Hyper Captain
  • *******
  • Posts: 1088
    • View Profile
Re: Internal Dialogue
« Reply #5 on: July 9, 2016, 08:22:46 AM »
the best part is you can copy paste this in to ved to test it out

CreepiXTopic starter

  • Doctor
  • ***
  • Posts: 64
  • Learning internal.
    • View Profile
Re: Internal Dialogue
« Reply #6 on: July 9, 2016, 08:23:08 AM »
I've been making a new, complete guide. :viridian:

This is the most basic version of a text box:
Code: [Select]
text(player,50,50,1)
This is some text!
speak_active
This creates a cyan text box 50 pixels from the left and 50 pixels from the top, with 1 line. The text command just stores the text and position in memory, but doesn't display it yet; when you're finished, use speak_active to actually display it. The color can be player/cyan (it doesn't matter which of the two you use), gray (or anything that doesn't exist), red, blue, purple, yellow or green.

But it'd be nice if we could position it above the player or in the center or something, instead of at some coordinates...
Code: [Select]
text(player,0,0,1)
This is some text!
position(player,above)
speak_active

text(gray,0,0,1)
This is a terminal text box!
position(center)
speak_active
The position command replaces the coordinates that are given in the text command, and there are different combinations possible, such as position(center), position(player,above), position(red,below), et cetera. There are also position(centerx) and position(centery), for only centering on the X and Y axis respectively.

How about the sound that someone/a terminal makes when a text box appears? There's the squeak command for that:
Code: [Select]
squeak(player)
text(player,0,0,1)
This is some text!
position(player,above)
speak_active

squeak(terminal)
text(gray,0,0,1)
This is a terminal text box!
position(center)
speak_active
This combination of commands is by far the most commonly used for text boxes.

But the last text box will not go away!
Code: [Select]
squeak(player)
text(player,0,0,1)
This is some text!
position(player,above)
speak_active

squeak(terminal)
text(gray,0,0,1)
This is a terminal text box!
position(center)
speak_active

endtext
The endtext command should be used to dismiss text boxes before any kind of delay and before ending the script, basically whenever it isn't followed by another text box.

That's basically everything you need to know to get started, but there's more advanced stuff that you can use, which I'll list here for completeness.

speak_active removes old text boxes that were already on the screen, but you can avoid that by using speak instead of speak_active:
Code: [Select]
squeak(player)
text(player,0,0,1)
This is some text!
position(player,above)
speak_active

squeak(terminal)
text(gray,0,0,2)
The previous text box
is still on the screen now!
position(center)
speak

endtext

You can even make multiple text boxes appear at once. Normally speak and speak_active wait until you press the action key before the script continues, but not if you put backgroundtext before it:
Code: [Select]
squeak(player)
text(player,0,0,1)
This is some text!
position(player,above)
backgroundtext
speak_active

squeak(terminal)
text(gray,0,0,2)
Two text boxes
at the same time!
position(center)
speak

endtext

The same example with three text boxes that will appear at the same time:
Code: [Select]
squeak(player)
text(player,0,0,1)
This is some text!
position(player,above)
backgroundtext
speak_active

[code]squeak(player)
text(player,0,0,1)
This is more text!
position(player,below)
backgroundtext
speak

squeak(terminal)
text(gray,0,0,2)
Three text boxes
at the same time!
position(center)
speak

endtext

Sometimes you may want to remove a text box immediately without fading it out. For that, endtextfast exists, you can just use it instead of endtext.

There's a command flipme that's supposed to correct text box positions in flip mode (for if you have a terminal that puts multiple text boxes on the screen), but it doesn't work properly.

There's also a command textboxactive, which removes all text boxes from the screen except for the last one. speak_active is actually a combination of speak and textboxactive, so textboxactive doesn't really have much use.

There's also a hidden way of centering a text box without using position(center)/position(centerx)/position(centery) that was especially useful when needing to maintain compatibility with 2.0, which is to write -500 for x and/or y coordinates. It saves a line, but it makes the script a bit less readable.

And there's a trick that allows you to access a couple more colors for text boxes.

Apart from the specialline(x) command (which probably doesn't have a use in player levels at all), that should be everything there is to know about text boxes in internal scripting!
Thank you too!

f̛̞̺̞͍͍̯̱̜͋͊̚r̸͈̜̝̯̉͂͌̾̿ͯ̚͟͡a̐̍҉͖̖͍̘̹̩Z̥̠͊̋͡0̛͈͔ͧ̀ͫ̍̍ͦ͋̽͋Rͤ

  • tOLP2 Tester
  • Captain
  • *****
  • Posts: 451
  • HITTING A BLOCK FOR 416 YEARS CRASHES fraZ0R?!
    • View Profile
Re: Internal Dialogue
« Reply #7 on: July 10, 2016, 05:03:57 AM »
TL;DR nice work. I hardly understand any of this but good job.