Author Topic: Internal commands  (Read 257565 times)

Dav999

  • Global Moderator
  • Captain
  • *****
  • Posts: 2173
    • View Profile
    • The Open Level Project
Re: Internal commands
« Reply #90 on: August 13, 2012, 04:23:12 PM »
That's clever, finally a way to check the version! I also wanted to point out workaround 2, but when I was finished writing, you already changed your post. This is what I was going to post:

I think the easiest workaround is to use this:

Code: [Select]
squeak(off)
say(-1)
text(1,0,0,4)
say(5)
#
[internal]
[internal]
[internal]
text(1,0,0,4)
say(5)
#
[internal]
[internal]
[internal]
text(1,0,0,4)
(et cetera)

You lose one line in the row, but the only reason of wanting four lines in a row would be if you want to use text, and if you want to use internal text, just don't turn it off because you can use that squeaking sound for the dialog!

FIQ

  • Captain
  • *****
  • Posts: 810
  • https://github.com/FredrIQ/
    • View Profile
    • FIQ
Re: Internal commands
« Reply #91 on: August 13, 2012, 04:39:16 PM »
That's clever, finally a way to check the version! I also wanted to point out workaround 2, but when I was finished writing, you already changed your post. This is what I was going to post:

I think the easiest workaround is to use this:

Code: [Select]
squeak(off)
say(-1)
text(1,0,0,4)
say(5)
#
[internal]
[internal]
[internal]
text(1,0,0,4)
say(5)
#
[internal]
[internal]
[internal]
text(1,0,0,4)
(et cetera)

You lose one line in the row, but the only reason of wanting four lines in a row would be if you want to use text, and if you want to use internal text, just don't turn it off because you can use that squeaking sound for the dialog!
Well, there's another reason, and that is that the script will become much longer.

Dav999

  • Global Moderator
  • Captain
  • *****
  • Posts: 2173
    • View Profile
    • The Open Level Project
Re: Internal commands
« Reply #92 on: August 13, 2012, 04:46:00 PM »
You will be able to type that very fast if you do it often, so most of your time will be spent thinking about the thing you want to do, and the commands you're going to need for that.

Dav999

  • Global Moderator
  • Captain
  • *****
  • Posts: 2173
    • View Profile
    • The Open Level Project
Re: Internal commands
« Reply #93 on: August 14, 2012, 03:24:38 AM »
I found another command, telesave(). It saves the game to the regular teleporter save of the actual game, not a quicksave of the level itself. If you load that save, you won't end up in your own level, but in dimension VVVVVV, and most likely you will end up in walls/somewhere you shouldn't be. So it shouldn't be used, actually. (So again, this will destroy your teleporter save). I added it to the list anyway to make it a bit more complete.

blue626

  • Captain
  • *****
  • Posts: 672
  • I changed my avatar!
    • View Profile
Re: Internal commands
« Reply #94 on: August 14, 2012, 04:20:43 AM »
EDIT: Looking at the posts above, where Dav999 and FIQ wrote examples of how to use internal scripting, and reading what Dav999 wrote about the command text, I don't see why do you have to use text(1,0,0,4) sometimes. I also don't see why you'll need say(-1) at the start. Look at the example below, specially, at the 1st line:

text(1,0,0,1)
say(5)
Internal scripting
Internal scripting
Internal scripting
Internal scripting
Internal scripting


Wouldn't it work? If not, would it work if I replaced the 1st line with text(1,0,0,4), or if I wrote say(-1) before the 1st line?

EDIT 2: I know why you need say(-1) now (because the editor would erase the text command if this command wasn't written, am I right?). I still don't know why do you need to use text(1,0,0,4).

I also don't know why there has to be text(1,0,0,4). I can't see the logic of taking 4 lines below it, but yeah. It works. :P

You don't have to use squeak(), position(), speak_active, endtext, endcutscene(), untilbars() and loadscript(stop), if you use the say(-1) trick again for every dialog you want to have coloured:

say(-1)
text(1,0,0,4)
say(5)
text(red,0,0,4)
This can
contain
four
lines!

Will create a red text box in the middle of the screen, and instead of say(), you can also use reply() to make a text box appear above :viridian:

reply(-1)
text(1,0,0,4)
reply(3)
text(yellow,0,0,2)
This box is yellow, but will
appear above the player!

This works because position() and speak_active are already part of the say(5) command or reply(5) command, whichever you use.

And you can just use the remaining space for other internal commands, or to extend it using text(1,0,0,4) say(5). That way, not everything has to be internal code.

I don't understand how to use simplified commands with what you said in this quote. If it is possible, then, there's a way to warp :viridian: to other places with less commands than this:
Couldn't you just do it with less flashes and commands? Why do you need playef(10) twice? Also, you forgot gotoposition(x,y). Example:

say(-1)
text(1,0,0,4)
say(5)
flash(5)
playef(9)
shake(20)
delay(30)
text(1,0,0,4)
say(4)
playef(10)
hideplayer()
delay(30)
text(1,0,0,4)
say(4)
gotoroom(x,y)
gotoposition(x,y)
delay(30)
text(1,0,0,4)
say(5)
flash(5)
playef(9)
shake(20)
delay(30)
text(1,0,0,4)
say(4)
showplayer()
endcutscene()
untilbars()
loadscript(stop)

It's still long, though. Perhaps, even less flashes and commands?

Perhaps you can use simplified scripting and then use internal scripting, and then use simp. script. again by writing commands that aren't inside a say command. Example:

flash
delay(30)
say(-1)
text(1,0,0,4)

say(3)

playef(10)
hideplayer()
delay(30)

flash
delay(30)
say(-1)
text(1,0,0,4)

say(4)
showplayer()
endcutscene()
untilbars()
loadscript(stop)


The text in bold is int. scripting, while the normal text is simp. scripting. It's STILL long! I don't know why do you need the red lines. If they aren't necessary, you can have less less 3 lines. I still don't know why can't you put say(-3) instead of the orange lines. If you can do that, you can have less 3+4=7 lines.

Dav999

  • Global Moderator
  • Captain
  • *****
  • Posts: 2173
    • View Profile
    • The Open Level Project
Re: Internal commands
« Reply #95 on: August 14, 2012, 04:51:14 AM »
Let's try it out then!

Script:
Code: [Select]
say(-3)
playef(10)
hideplayer()
delay(30)
flash
delay(30)
say(-1)
text(1,0,0,4)
say
showplayer()

What happens the first time:

warpsound and an empty gray text box, player is not hidden
[waits until you press action]
delay(30), flash, delay(30), gray textbox which says:
Quote from: Textbox
position(center)
speak_active
squeak(terminal)
text(gray,0,114,1)

What happens the second time:

warpsound and a text box which says "position(center)", player is not hidden
[waits until you press action]
delay(30), flash, delay(30), gray textbox which says:
Quote from: Textbox
position(center)
speak_active
squeak(terminal)
text(gray,0,114,1)

So, it does not work. To avoid dialog rubbish you should go to a built-in script which is empty, so we choose a script which doesn't exist and use loadscript(stop). Unless you want to keep the black bars, you need to write endcutscene() to make them disappear and untilbars() to wait until they have disappeared. And not using text(1,0,0,4) and say after that will also make dialog rubbish.
« Last Edit: August 14, 2012, 04:55:58 AM by Dav999 »

Dav999

  • Global Moderator
  • Captain
  • *****
  • Posts: 2173
    • View Profile
    • The Open Level Project
Re: Internal commands
« Reply #96 on: August 14, 2012, 11:14:39 AM »
Some new commands:

befadein()
changedir(colour,direction)
createactivityzone(colour)
createrescuedcrew()
everybodysad()
trinketyellowcontrol()
trinketbluecontrol()
rollcredits()
teleportscript(levelonecomplete)

I forgot to include these:

musicfadeout()
stopmusic()

These commands turn out to be different than I thought (@FIQ: did you know about this?):

gotoposition(x,y,z) turns out to have an extra argument, the z is whether you end up flipped or not, but you can also use that command with only two arguments
playef(x,n) also turns out to have an extra argument, and I don't know what that argument does (in the real game, it's always 10, but you can also use that command with only one argument)

It looks like there are also some unused commands:

ifwarp(x) ?
clearteleportscript(x) ?

The list has been updated!

FIQ

  • Captain
  • *****
  • Posts: 810
  • https://github.com/FredrIQ/
    • View Profile
    • FIQ
Re: Internal commands
« Reply #97 on: August 14, 2012, 11:45:30 AM »
Some new commands:

befadein()
changedir(colour,direction)
createactivityzone(colour)
createrescuedcrew()
everybodysad()
trinketyellowcontrol()
trinketbluecontrol()
rollcredits()
teleportscript(levelonecomplete)

I forgot to include these:

musicfadeout()
stopmusic()

These commands turn out to be different than I thought (@FIQ: did you know about this?):

gotoposition(x,y,z) turns out to have an extra argument, the z is whether you end up flipped or not, but you can also use that command with only two arguments
playef(x,n) also turns out to have an extra argument, and I don't know what that argument does (in the real game, it's always 10, but you can also use that command with only one argument)

It looks like there are also some unused commands:

ifwarp(x) ?
clearteleportscript(x) ?

The list has been updated!
befadein() - Instantly fades in
changedir(colour,left|right) - Changes what direction a crewmate is facing
createactivityzone(colour) - Create a "Press ACTION to talk to (Crewmate)" zone, flags will decide which line is used
createrescuedcrew() - Creates all the crewmates that's rescued at the moment (controlled by rescued(colour))
everybodysad() - Makes everybody sad (viridian + internal crewmates)
trinketyellowcontrol() - Prints the dialog by Vitellary when he found a trinket
trinketbluecontrol() - Prints the dialog by Victoria when she found a trinket
rollcredits() - Rolls the credits
teleportscript(x) - set internal script "x" as "teleportscript".
clearteleportscript(x) - removes "teleportscript"
ifwarp(x) - Huh?

Teleportscript is a script that overrides the default teleport functionality (open a map and choose destination). It's used in the maingame when you've just rescued a crewmate.

Dav999

  • Global Moderator
  • Captain
  • *****
  • Posts: 2173
    • View Profile
    • The Open Level Project
Re: Internal commands
« Reply #98 on: August 14, 2012, 12:07:53 PM »
Some new commands:

befadein()
changedir(colour,direction)
createactivityzone(colour)
createrescuedcrew()
everybodysad()
trinketyellowcontrol()
trinketbluecontrol()
rollcredits()
teleportscript(levelonecomplete)

I forgot to include these:

musicfadeout()
stopmusic()

These commands turn out to be different than I thought (@FIQ: did you know about this?):

gotoposition(x,y,z) turns out to have an extra argument, the z is whether you end up flipped or not, but you can also use that command with only two arguments
playef(x,n) also turns out to have an extra argument, and I don't know what that argument does (in the real game, it's always 10, but you can also use that command with only one argument)

It looks like there are also some unused commands:

ifwarp(x) ?
clearteleportscript(x) ?

The list has been updated!
befadein() - Instantly fades in
changedir(colour,left|right) - Changes what direction a crewmate is facing
createactivityzone(colour) - Create a "Press ACTION to talk to (Crewmate)" zone, flags will decide which line is used
createrescuedcrew() - Creates all the crewmates that's rescued at the moment (controlled by rescued(colour))
everybodysad() - Makes everybody sad (viridian + internal crewmates)
trinketyellowcontrol() - Prints the dialog by Vitellary when he found a trinket
trinketbluecontrol() - Prints the dialog by Victoria when she found a trinket
rollcredits() - Rolls the credits
teleportscript(x) - set internal script "x" as "teleportscript".
clearteleportscript(x) - removes "teleportscript"
ifwarp(x) - Huh?

Teleportscript is a script that overrides the default teleport functionality (open a map and choose destination). It's used in the maingame when you've just rescued a crewmate.

changedir doesn't support left/right, only numbers. I had already added a description of what everybodysad() and rollcredits() do, and that trinket[colour]control() had something to do with :victoria: or :vitellary: giving you a trinket. But does befadein() instantly fade in from fadeout()? clearteleportscript(x) doesn't appear in any script, so when is it used? And does createactivityzone(terminal) make "Press ENTER to activate terminal"? (and createactivityzone(terminals) "Press ENTER to activate terminals", as seen in the ship?)

FIQ

  • Captain
  • *****
  • Posts: 810
  • https://github.com/FredrIQ/
    • View Profile
    • FIQ
Re: Internal commands
« Reply #99 on: August 14, 2012, 12:32:36 PM »
Some new commands:

befadein()
changedir(colour,direction)
createactivityzone(colour)
createrescuedcrew()
everybodysad()
trinketyellowcontrol()
trinketbluecontrol()
rollcredits()
teleportscript(levelonecomplete)

I forgot to include these:

musicfadeout()
stopmusic()

These commands turn out to be different than I thought (@FIQ: did you know about this?):

gotoposition(x,y,z) turns out to have an extra argument, the z is whether you end up flipped or not, but you can also use that command with only two arguments
playef(x,n) also turns out to have an extra argument, and I don't know what that argument does (in the real game, it's always 10, but you can also use that command with only one argument)

It looks like there are also some unused commands:

ifwarp(x) ?
clearteleportscript(x) ?

The list has been updated!
befadein() - Instantly fades in
changedir(colour,left|right) - Changes what direction a crewmate is facing
createactivityzone(colour) - Create a "Press ACTION to talk to (Crewmate)" zone, flags will decide which line is used
createrescuedcrew() - Creates all the crewmates that's rescued at the moment (controlled by rescued(colour))
everybodysad() - Makes everybody sad (viridian + internal crewmates)
trinketyellowcontrol() - Prints the dialog by Vitellary when he found a trinket
trinketbluecontrol() - Prints the dialog by Victoria when she found a trinket
rollcredits() - Rolls the credits
teleportscript(x) - set internal script "x" as "teleportscript".
clearteleportscript(x) - removes "teleportscript"
ifwarp(x) - Huh?

Teleportscript is a script that overrides the default teleport functionality (open a map and choose destination). It's used in the maingame when you've just rescued a crewmate.

changedir doesn't support left/right, only numbers. I had already added a description of what everybodysad() and rollcredits() do, and that trinket[colour]control() had something to do with :victoria: or :vitellary: giving you a trinket. But does befadein() instantly fade in from fadeout()? clearteleportscript(x) doesn't appear in any script, so when is it used? And does createactivityzone(terminal) make "Press ENTER to activate terminal"? (and createactivityzone(terminals) "Press ENTER to activate terminals", as seen in the ship?)
Didn't see your descriptions, sorry (and yes, I meant 0|1).
befadein() fades in instantly from a black screen (from fadeout()), yes.
createactivityzone() will only support the crewmate colors (and "terminal", not "terminals"). It will default to "terminal", which will output the one at the Laboratory ("?SYNTAX ERROR").

clearteleportscript(x) isn't used, but it does remove the teleportscript that is set.

Dav999

  • Global Moderator
  • Captain
  • *****
  • Posts: 2173
    • View Profile
    • The Open Level Project
Re: Internal commands
« Reply #100 on: August 14, 2012, 01:15:17 PM »
But how is that teleport script cleared if the command is not used? Wouldn't that script just repeat each time you get to a teleporter or is this done with flags?

EDIT: createactivityzone(terminal) will create a zone with 'Press ENTER to explode'. :vermillion: If you press enter, you get the first part of the cutscene in the beginning.

'Press ENTER to explode' ??? I'm pretty sure it's used nowhere in the game...
« Last Edit: August 14, 2012, 01:19:27 PM by Dav999 »

ToasterApocalypse

  • Captain
  • *****
  • Posts: 1010
  • le lenny face
    • View Profile
Re: Internal commands
« Reply #101 on: August 14, 2012, 01:16:15 PM »
Question: How to stop all music with play()?

Dav999

  • Global Moderator
  • Captain
  • *****
  • Posts: 2173
    • View Profile
    • The Open Level Project
Re: Internal commands
« Reply #102 on: August 14, 2012, 01:20:10 PM »
Question: How to stop all music with play()?

musicfadeout() if you want it to fadeout, and stopmusic() if you want it to stop instantly.

ToasterApocalypse

  • Captain
  • *****
  • Posts: 1010
  • le lenny face
    • View Profile
Re: Internal commands
« Reply #103 on: August 14, 2012, 01:22:13 PM »
Question: How to stop all music with play()?

musicfadeout() if you want it to fadeout, and stopmusic() if you want it to stop instantly.

Thanks. I was just working on the end script for switchback and I wanted to stop the music for some sort of dramatic effect of sorts.

Dav999

  • Global Moderator
  • Captain
  • *****
  • Posts: 2173
    • View Profile
    • The Open Level Project
Re: Internal commands
« Reply #104 on: August 14, 2012, 01:37:14 PM »
If you use clearteleportscript, which of the following is correct:
-clearteleportscript
-clearteleportscript()
-clearteleportscript(the script which was set earlier)

Which brings me to another question that just needs to be asked. Why do some commands have () after them? (Question for Terry, maybe)