Internal commands

Started by Hilbert, July 28, 2012, 01:23:29 PM

Previous topic - Next topic

FIQ

Quote from: ToasterApocalypse on December 14, 2012, 02:57:20 PM
Quote from: FIQ on December 14, 2012, 02:52:13 PM
Quote from: ToasterApocalypse on December 14, 2012, 01:41:49 PM
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

Quote from: FIQ on December 14, 2012, 03:05:59 PM
Quote from: ToasterApocalypse on December 14, 2012, 02:57:20 PM
Quote from: FIQ on December 14, 2012, 02:52:13 PM
Quote from: ToasterApocalypse on December 14, 2012, 01:41:49 PM
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

Quote from: ToasterApocalypse on December 14, 2012, 03:07:10 PM
Quote from: FIQ on December 14, 2012, 03:05:59 PM
Quote from: ToasterApocalypse on December 14, 2012, 02:57:20 PM
Quote from: FIQ on December 14, 2012, 02:52:13 PM
Quote from: ToasterApocalypse on December 14, 2012, 01:41:49 PM
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

Quote from: FIQ on December 14, 2012, 03:09:04 PM
Quote from: ToasterApocalypse on December 14, 2012, 03:07:10 PM
Quote from: FIQ on December 14, 2012, 03:05:59 PM
Quote from: ToasterApocalypse on December 14, 2012, 02:57:20 PM
Quote from: FIQ on December 14, 2012, 02:52:13 PM
Quote from: ToasterApocalypse on December 14, 2012, 01:41:49 PM
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

Quote from: FIQ on December 14, 2012, 03:03:13 PM
: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?

This is a text box!
It has two lines...
text(red,-1,50,2)

Dav999

'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:

speak
Makes a text box appear without removing old text boxes, wait for keypress

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

Quote from: avengah on December 10, 2012, 04:23:15 PM
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

Quote from: Dav999 on December 14, 2012, 03:41:15 PM
Quote from: FIQ on December 14, 2012, 03:03:13 PM
: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?

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

#443
Quote from: FIQ on December 14, 2012, 04:42:40 PM
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?

FIQ

Quote from: blue626 on December 14, 2012, 04:54:12 PM
Quote from: FIQ on December 14, 2012, 04:42:40 PM
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

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

Quote from: Rapidgame on December 16, 2012, 06:25:47 PM
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:
iftrinkets(0,script2)

SCRIPT 2:

#
A)Say
[internal command]


FIQ

Quote from: ToasterApocalypse on December 16, 2012, 06:41:39 PM
Quote from: Rapidgame on December 16, 2012, 06:25:47 PM
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:
iftrinkets(0,script2)

SCRIPT 2:

#
A)Say
[internal command]


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

script1:
iftrinkets(0,script2)

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

ToasterApocalypse

Quote from: FIQ on December 16, 2012, 07:04:19 PM
Quote from: ToasterApocalypse on December 16, 2012, 06:41:39 PM
Quote from: Rapidgame on December 16, 2012, 06:25:47 PM
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:
iftrinkets(0,script2)

SCRIPT 2:

#
A)Say
[internal command]


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

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

Quote from: ToasterApocalypse on December 16, 2012, 07:42:59 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