Author Topic: Internal commands  (Read 257191 times)

FIQ

  • Captain
  • *****
  • Posts: 810
  • https://github.com/FredrIQ/
    • View Profile
    • FIQ
Re: Internal commands
« Reply #435 on: December 14, 2012, 07:05:59 AM »
Guys, lets discuss backgroundtext. I don't get that one.  :victoria:
Backgroundtext can be used to make several textboxes appear on the screen at the same time. For example, terminals with a headline and a textbox.

It's used like this (in case you wonder, -1 in text(...) means "at the center"):

text(gray,-1,50,1)
Test
backgroundtext
speak
text(gray,-1,70,1)
More testing!
speak
endtext

How would that fit in a say(5) thing then?
Well, by adjusting the script to place the needed things together and split otherwise.

say(-1)
text(1,0,0,4)
say(5)
text(gray,-1,50,1)
Test
backgroundtext
speak
text(1,0,0,4)
say(5)
text(gray,-1,70,1)
More testing!
speak
endtext
text(1,0,0,4)
say(3)
endcutscene
untilbars
loadscript(stop)

And no, you can't background dialogs with several lines (more than 1), unless you like to break compatibility with 2.0 (please don't).

ToasterApocalypse

  • Captain
  • *****
  • Posts: 1010
  • le lenny face
    • View Profile
Re: Internal commands
« Reply #436 on: December 14, 2012, 07:07:10 AM »
Guys, lets discuss backgroundtext. I don't get that one.  :victoria:
Backgroundtext can be used to make several textboxes appear on the screen at the same time. For example, terminals with a headline and a textbox.

It's used like this (in case you wonder, -1 in text(...) means "at the center"):

text(gray,-1,50,1)
Test
backgroundtext
speak
text(gray,-1,70,1)
More testing!
speak
endtext

How would that fit in a say(5) thing then?
Well, by adjusting the script to place the needed things together and split otherwise.

say(-1)
text(1,0,0,4)
say(5)
text(gray,-1,50,1)
Test
backgroundtext
speak
text(1,0,0,4)
say(5)
text(gray,-1,70,1)
More testing!
speak
endtext
text(1,0,0,4)
say(3)
endcutscene
untilbars
loadscript(stop)

And no, you can't background dialogs with several lines (more than 1), unless you like to break compatibility with 2.0 (please don't).

I won't.

Also, it's pretty neat that -1 is the center.

FIQ

  • Captain
  • *****
  • Posts: 810
  • https://github.com/FredrIQ/
    • View Profile
    • FIQ
Re: Internal commands
« Reply #437 on: December 14, 2012, 07:09:04 AM »
Guys, lets discuss backgroundtext. I don't get that one.  :victoria:
Backgroundtext can be used to make several textboxes appear on the screen at the same time. For example, terminals with a headline and a textbox.

It's used like this (in case you wonder, -1 in text(...) means "at the center"):

text(gray,-1,50,1)
Test
backgroundtext
speak
text(gray,-1,70,1)
More testing!
speak
endtext

How would that fit in a say(5) thing then?
Well, by adjusting the script to place the needed things together and split otherwise.

say(-1)
text(1,0,0,4)
say(5)
text(gray,-1,50,1)
Test
backgroundtext
speak
text(1,0,0,4)
say(5)
text(gray,-1,70,1)
More testing!
speak
endtext
text(1,0,0,4)
say(3)
endcutscene
untilbars
loadscript(stop)

And no, you can't background dialogs with several lines (more than 1), unless you like to break compatibility with 2.0 (please don't).

I won't.

Also, it's pretty neat that -1 is the center.
Only works in the X axis though, you cannot mimic position(center) w/o using it by using text(C,-1,-1,N). You can only mimic position(centerx) w/o using it (with the example above).

ToasterApocalypse

  • Captain
  • *****
  • Posts: 1010
  • le lenny face
    • View Profile
Re: Internal commands
« Reply #438 on: December 14, 2012, 07:38:14 AM »
Guys, lets discuss backgroundtext. I don't get that one.  :victoria:
Backgroundtext can be used to make several textboxes appear on the screen at the same time. For example, terminals with a headline and a textbox.

It's used like this (in case you wonder, -1 in text(...) means "at the center"):

text(gray,-1,50,1)
Test
backgroundtext
speak
text(gray,-1,70,1)
More testing!
speak
endtext

How would that fit in a say(5) thing then?
Well, by adjusting the script to place the needed things together and split otherwise.

say(-1)
text(1,0,0,4)
say(5)
text(gray,-1,50,1)
Test
backgroundtext
speak
text(1,0,0,4)
say(5)
text(gray,-1,70,1)
More testing!
speak
endtext
text(1,0,0,4)
say(3)
endcutscene
untilbars
loadscript(stop)

And no, you can't background dialogs with several lines (more than 1), unless you like to break compatibility with 2.0 (please don't).

I won't.

Also, it's pretty neat that -1 is the center.
Only works in the X axis though, you cannot mimic position(center) w/o using it by using text(C,-1,-1,N). You can only mimic position(centerx) w/o using it (with the example above).

Speaking of the example, with the Y co-ordinate you used, the two text boxes touch each-other.

Dav999

  • Global Moderator
  • Captain
  • *****
  • Posts: 2173
    • View Profile
    • The Open Level Project
Re: Internal commands
« Reply #439 on: December 14, 2012, 07:41:15 AM »
:o
You know the "internal scripting without cutscene" thingy? Well, I found something interesting.

As already known, the script executes first. And, to my surprise, one of the commands that work (as discussed earlier, not all commands seem to work) is the text() command.
Now, what is the use of this?

Well... the internal script executes first, in the case above the text() command. text() is used with say(-1) to allow for several internal commands to run using say(N) at once by simply making the internal executer ignore some lines below it, including the converted say() command. See where I'm going?

But say(N) will make cutscenebars appear and a terminal sound playing!
It wont! By overwriting the commands that trigger them with the command text() as the internal command to run w/o cutscenes, it will not appear! text() triggers first, etc.

endcutscene and untilbars is missing from your example...
They aren't needed, as there are no cutscenebars. loadscript(stop) (or anything that isn't an internal script) is still needed, obviously.

Try this:

test:
iftrinkets(0,test2)

test2:
say(3)
alarmon
playef(10,10)
loadscript(stop)
text(1,0,0,4)

Will this work?

Code: [Select]
This is a text box!
It has two lines...
text(red,-1,50,2)

Dav999

  • Global Moderator
  • Captain
  • *****
  • Posts: 2173
    • View Profile
    • The Open Level Project
Re: Internal commands
« Reply #440 on: December 14, 2012, 07:52:09 AM »
'backgroundtext' can be better described as something which makes sure that the game doesn't wait for the player to press action at speak or speak_active. For example:

Code: [Select]
speakMakes a text box appear without removing old text boxes, wait for keypress

Code: [Select]
backgroundtext
speak
Makes a text box appear without removing old text boxes, don't wait for keypress

If you remove the 'backgroundtext's from FIQ's example, you'd have to press space after every text box.

blue626

  • Captain
  • *****
  • Posts: 672
  • I changed my avatar!
    • View Profile
Re: Internal commands
« Reply #441 on: December 14, 2012, 08:29:43 AM »
Now, I wonder if happy(all) and sad(all) is converted differently depending on how many crew members are on screen / in the level and which colours they are... does anyone know how they are converted? Thanks, this is quite interesting.

EDIT: I tried it, and it seems the parser takes the happy(all) command and does something different with it, so you can't use this method to test it. Everyone became happy and I just got a text box containing the usual rubbish no matter what value I used for N. Unless I'm doing something wrong?

Try sad(all/everyone/everybody). It may be converted to everybodysad().


FIQ

  • Captain
  • *****
  • Posts: 810
  • https://github.com/FredrIQ/
    • View Profile
    • FIQ
Re: Internal commands
« Reply #442 on: December 14, 2012, 08:42:40 AM »
:o
You know the "internal scripting without cutscene" thingy? Well, I found something interesting.

As already known, the script executes first. And, to my surprise, one of the commands that work (as discussed earlier, not all commands seem to work) is the text() command.
Now, what is the use of this?

Well... the internal script executes first, in the case above the text() command. text() is used with say(-1) to allow for several internal commands to run using say(N) at once by simply making the internal executer ignore some lines below it, including the converted say() command. See where I'm going?

But say(N) will make cutscenebars appear and a terminal sound playing!
It wont! By overwriting the commands that trigger them with the command text() as the internal command to run w/o cutscenes, it will not appear! text() triggers first, etc.

endcutscene and untilbars is missing from your example...
They aren't needed, as there are no cutscenebars. loadscript(stop) (or anything that isn't an internal script) is still needed, obviously.

Try this:

test:
iftrinkets(0,test2)

test2:
say(3)
alarmon
playef(10,10)
loadscript(stop)
text(1,0,0,4)

Will this work?

Code: [Select]
This is a text box!
It has two lines...
text(red,-1,50,2)
No, it wont, the parser will remove the text lines as it doesn't understand what to do with it.

The point with what I showed was that it allowed execution of infinite (well, apart from some limitations regarding dialogs) amount of scripts w/o cutscenebars OR making a new script per line.

blue626

  • Captain
  • *****
  • Posts: 672
  • I changed my avatar!
    • View Profile
Re: Internal commands
« Reply #443 on: December 14, 2012, 08:54:12 AM »
The point with what I showed was that it allowed execution of infinite (well, apart from some limitations regarding dialogs) amount of scripts w/o cutscenebars OR making a new script per line.

Did you mean, instead of the bold part, "AND you don't need to make a new script per line (like in the ASay method)."?

EDIT: Conclusion to facts related to int. scr. that were discovered and posted here: The script parser* has various glitches.

*I suppose that the parser is what transform simple. scr. into int. scr. and executes it?
« Last Edit: December 14, 2012, 09:18:00 AM by blue626 »

FIQ

  • Captain
  • *****
  • Posts: 810
  • https://github.com/FredrIQ/
    • View Profile
    • FIQ
Re: Internal commands
« Reply #444 on: December 14, 2012, 10:12:05 AM »
The point with what I showed was that it allowed execution of infinite (well, apart from some limitations regarding dialogs) amount of scripts w/o cutscenebars OR making a new script per line.

Did you mean, instead of the bold part, "AND you don't need to make a new script per line (like in the ASay method)."?

EDIT: Conclusion to facts related to int. scr. that were discovered and posted here: The script parser* has various glitches.

*I suppose that the parser is what transform simple. scr. into int. scr. and executes it?
Yes, basically I combined the methods together to get more than one line of internal scripting w/o spawning cutscenebars or sound. I.e. full access to the internal scripting engine w/o drawbacks in 2.1, and full access except limitation on the amount of dialog lines in 2.0.

And yes, when I say "script parser", I mean the piece of code that takes the simplified scripting and converts it to internal scripting.

Rapidgame

  • Crewmate
  • **
  • Posts: 20
  • I'm making a fan-made "The Tower". Scroll madness!
    • View Profile
Re: Internal commands
« Reply #445 on: December 16, 2012, 10:25:47 AM »
Can someone explain me some things?
1) The VVVVVV Man doesn't clip perfectly. Why?
2) How I can do this without the cutscene bars?
3) I have used:

say(-1)
text(1,0,0,4)
say(3)
createcrewman(50,0,red,0,right)
changeai(red,followplayer)
text(1,0,0,4)
say(3)
endcutscene()
untilbars()
loadscript(stop)


This makes a crewman that cannot be rescued.
I have did a terminal using this code. If I actívate it, a crewman will spawn.
If I die, the crewman becomes sad, until I spawn.
He follows me always.
But there is a problem.
Why he doesn't clip with spikes and moving platforms (and conveyors)?

Well, that's all for now.
Sorry if you see "gramatical errors" because I'm learning english.  :)

ToasterApocalypse

  • Captain
  • *****
  • Posts: 1010
  • le lenny face
    • View Profile
Re: Internal commands
« Reply #446 on: December 16, 2012, 10:41:39 AM »
Can someone explain me some things?
1) The VVVVVV Man doesn't clip perfectly. Why?
2) How I can do this without the cutscene bars?
3) I have used:

say(-1)
text(1,0,0,4)
say(3)
createcrewman(50,0,red,0,right)
changeai(red,followplayer)
text(1,0,0,4)
say(3)
endcutscene()
untilbars()
loadscript(stop)


This makes a crewman that cannot be rescued.
I have did a terminal using this code. If I actívate it, a crewman will spawn.
If I die, the crewman becomes sad, until I spawn.
He follows me always.
But there is a problem.
Why he doesn't clip with spikes and moving platforms (and conveyors)?

Well, that's all for now.
Sorry if you see "gramatical errors" because I'm learning english.  :)

Don't know the first answer.

Second: Simple.

SCRIPT 1:
Code: [Select]
iftrinkets(0,script2)
SCRIPT 2:
Code: [Select]
#
A)Say
[internal command]

FIQ

  • Captain
  • *****
  • Posts: 810
  • https://github.com/FredrIQ/
    • View Profile
    • FIQ
Re: Internal commands
« Reply #447 on: December 16, 2012, 11:04:19 AM »
Can someone explain me some things?
1) The VVVVVV Man doesn't clip perfectly. Why?
2) How I can do this without the cutscene bars?
3) I have used:

say(-1)
text(1,0,0,4)
say(3)
createcrewman(50,0,red,0,right)
changeai(red,followplayer)
text(1,0,0,4)
say(3)
endcutscene()
untilbars()
loadscript(stop)


This makes a crewman that cannot be rescued.
I have did a terminal using this code. If I actívate it, a crewman will spawn.
If I die, the crewman becomes sad, until I spawn.
He follows me always.
But there is a problem.
Why he doesn't clip with spikes and moving platforms (and conveyors)?

Well, that's all for now.
Sorry if you see "gramatical errors" because I'm learning english.  :)

Don't know the first answer.

Second: Simple.

SCRIPT 1:
Code: [Select]
iftrinkets(0,script2)
SCRIPT 2:
Code: [Select]
#
A)Say
[internal command]

I recommend this (similar) method instead, to enable full scripting w/o cutscenebars

Code: [Select]
script1:
iftrinkets(0,script2)

script2:
say(3)
createcrewman(50,0,red,0,right)
changeai(red,followplayer)
loadscript(stop)
text(1,0,0,4)

ToasterApocalypse

  • Captain
  • *****
  • Posts: 1010
  • le lenny face
    • View Profile
Re: Internal commands
« Reply #448 on: December 16, 2012, 11:42:59 AM »
Can someone explain me some things?
1) The VVVVVV Man doesn't clip perfectly. Why?
2) How I can do this without the cutscene bars?
3) I have used:

say(-1)
text(1,0,0,4)
say(3)
createcrewman(50,0,red,0,right)
changeai(red,followplayer)
text(1,0,0,4)
say(3)
endcutscene()
untilbars()
loadscript(stop)


This makes a crewman that cannot be rescued.
I have did a terminal using this code. If I actívate it, a crewman will spawn.
If I die, the crewman becomes sad, until I spawn.
He follows me always.
But there is a problem.
Why he doesn't clip with spikes and moving platforms (and conveyors)?

Well, that's all for now.
Sorry if you see "gramatical errors" because I'm learning english.  :)

Don't know the first answer.

Second: Simple.

SCRIPT 1:
Code: [Select]
iftrinkets(0,script2)
SCRIPT 2:
Code: [Select]
#
A)Say
[internal command]

I recommend this (similar) method instead, to enable full scripting w/o cutscenebars

Code: [Select]
script1:
iftrinkets(0,script2)

script2:
say(3)
createcrewman(50,0,red,0,right)
changeai(red,followplayer)
loadscript(stop)
text(1,0,0,4)

Wait, what? I'll check that.

FIQ

  • Captain
  • *****
  • Posts: 810
  • https://github.com/FredrIQ/
    • View Profile
    • FIQ
Re: Internal commands
« Reply #449 on: December 16, 2012, 01:20:37 PM »
Wait, what? I'll check that.
I tried to make people aware with an earlier post that I found out how to execute unlimited internal commands w/o cutscenebars, but noone cared. :P