Author Topic: Internal commands  (Read 258380 times)

blue626

  • Captain
  • *****
  • Posts: 672
  • I changed my avatar!
    • View Profile
Re: Internal commands
« Reply #75 on: August 13, 2012, 08:19:10 AM »
What sound effects are playef(9) and playef(10)? You said that flash(x) was like flash in regular scripting, so won't that make the flash sound effect? Why do you need to hide the player for some time?

Btw: this thread already has >75 replies! That shows that, for some people, internal scripting is interesting. Also, some people have asked questions about internal scripting here.

Dav999

  • Global Moderator
  • Captain
  • *****
  • Posts: 2173
    • View Profile
    • The Open Level Project
Re: Internal commands
« Reply #76 on: August 13, 2012, 08:53:20 AM »
What sound effects are playef(9) and playef(10)? You said that flash(x) was like flash in regular scripting, so won't that make the flash sound effect? Why do you need to hide the player for some time?

I think I was wrong, because flash(x) only makes a white screen, and it doesn't shake or make sound. playef(9) is the flash sound and playef(10) is the warp sound. You need to hide the player because he teleports away in the one room, and one moment later, he appears in the other room. Disappearing and appearing doesn't happen at the same time. If you see somebody teleported away, you can't see him anymore, right? Then, the view changes to the place he teleports to and he appears. The warping technology would be VERY fast if there was absolutely no time between disappearing in one room and appearing in the other!

Bearboy

  • Captain
  • *****
  • Posts: 270
  • guy
    • View Profile
    • Bearboys Youtube
Re: Internal commands
« Reply #77 on: August 13, 2012, 10:32:40 AM »
Something like this:

Code: [Select]
flash(5)
playef(9)
shake(20)
delay(30)
flash(5)
playef(9)
shake(20)
delay(30)
flash(5)
playef(10)
hideplayer()
delay(30)
gotoroom(x,y)
delay(30)
flash(5)
playef(9)
shake(20)
delay(30)
flash(5)
playef(9)
shake(20)
delay(30)
flash(5)
playef(10)
showplayer()

So to get that, you will need to enter this:

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

Man, I wish I could copy and paste that in.
I may have to do it a few times  :victoria:

ToasterApocalypse

  • Captain
  • *****
  • Posts: 1010
  • le lenny face
    • View Profile
Re: Internal commands
« Reply #78 on: August 13, 2012, 10:48:41 AM »
After finding an interesting entity (entity ID: 1), I am going to make a level containing it.

teehee

Dav999

  • Global Moderator
  • Captain
  • *****
  • Posts: 2173
    • View Profile
    • The Open Level Project
Re: Internal commands
« Reply #79 on: August 13, 2012, 10:48:58 AM »
You can put it in one script, then open it in a text editor and copy and paste that script after the first one and change the name. (it's a bit tricky though)


|teleport1:|say(-1)|text(1,0,0,4)|say(5)|etcetera|anotherscript|say|Hi|

|teleport1:|say(-1)|text(1,0,0,4)|say(5)|etcetera|teleport2:|say(-1)|text(1,0,0,4)|say(5)|etcetera|anotherscript|say|Hi|

|teleport1:|say(-1)|text(1,0,0,4)|say(5)|etcetera|teleport2:|say(-1)|text(1,0,0,4)|say(5)|etcetera|teleport3:|say(-1)|text(1,0,0,4)|say(5)|etcetera|anotherscript|say|Hi|


Like that. And of course things like coordinates need to be changed, but you can quickly do it this way.

Dav999

  • Global Moderator
  • Captain
  • *****
  • Posts: 2173
    • View Profile
    • The Open Level Project
Re: Internal commands
« Reply #80 on: August 13, 2012, 10:56:46 AM »
After finding an interesting entity (entity ID: 1), I am going to make a level containing it.

teehee

Well, there are more interesting entities than enemies, because I thought you can't specify a sprite. You can get enemy sprites like the yes men/stop heads/word enemies/pretty much everything though, but they don't move and they don't kill.

blue626

  • Captain
  • *****
  • Posts: 672
  • I changed my avatar!
    • View Profile
Re: Internal commands
« Reply #81 on: August 13, 2012, 11:03:15 AM »
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?

Bearboy

  • Captain
  • *****
  • Posts: 270
  • guy
    • View Profile
    • Bearboys Youtube
Re: Internal commands
« Reply #82 on: August 13, 2012, 11:28:12 AM »
You can put it in one script, then open it in a text editor and copy and paste that script after the first one and change the name. (it's a bit tricky though)


|teleport1:|say(-1)|text(1,0,0,4)|say(5)|etcetera|anotherscript|say|Hi|

|teleport1:|say(-1)|text(1,0,0,4)|say(5)|etcetera|teleport2:|say(-1)|text(1,0,0,4)|say(5)|etcetera|anotherscript|say|Hi|

|teleport1:|say(-1)|text(1,0,0,4)|say(5)|etcetera|teleport2:|say(-1)|text(1,0,0,4)|say(5)|etcetera|teleport3:|say(-1)|text(1,0,0,4)|say(5)|etcetera|anotherscript|say|Hi|


Like that. And of course things like coordinates need to be changed, but you can quickly do it this way.

Do you mean opening the .vvvvvv in something like notepad?

Dav999

  • Global Moderator
  • Captain
  • *****
  • Posts: 2173
    • View Profile
    • The Open Level Project
Re: Internal commands
« Reply #83 on: August 13, 2012, 12:38:21 PM »
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?

You forgot a second playef(10). If you add that, I guess it's perfect.

Do you mean opening the .vvvvvv in something like notepad?

Exactly! Near the bottom are the <script> tags, and everything in between those tags is scripting.

ToasterApocalypse

  • Captain
  • *****
  • Posts: 1010
  • le lenny face
    • View Profile
Re: Internal commands
« Reply #84 on: August 13, 2012, 01:51:24 PM »
LIST OF ENTITY ID THINGIES

1: Wierd purple thingy that kills you(Unused enemy?)
2: An immobile moving platform
3: A disappearing platform
4: A 1x1 quicker quicksand block
5: A flipped Viridian, you will flip gravity when touched
6: Weird red flashy thingy that disappears quickly
7: Same as above, bit doesn't flash and is coloured cyan
8: A coin from the prototype
9: Trinket
10: Activated flipped checkpoint (you don't respawn at it, even if you touch)
11: Invisible gravity line
12: Same as above(?)
13: Warp token without a destination
14: The round teleporter
15: Verdigris
16: Flipped Vitellary
17: Victoria
18: Viridian
19: Vermillion
20: Flipped terminal (Activates but no script)
21: Same as above but when touched the terminal doesn't light up
22: Nothing?
23:Gravitron Square
24: A Viridian that follows you (if you touch a wall it never stops running into that wall)
25: Not sure (nothing?)
26: The warp token to the Secret Lab (does not work)
27: Weird glitchy Viridians at the top of the screen

I'm not sure if there's anymore, but afterwards I tried IDs 28-32 and nothing happened.
brb using the trinkets to get more than 20 trinkets to see what happens
« Last Edit: August 13, 2012, 01:58:35 PM by ToasterApocolypse »

ToasterApocalypse

  • Captain
  • *****
  • Posts: 1010
  • le lenny face
    • View Profile
Re: Internal commands
« Reply #85 on: August 13, 2012, 02:06:12 PM »
And this is what happens when you go above 50 trinkets.

Dav999

  • Global Moderator
  • Captain
  • *****
  • Posts: 2173
    • View Profile
    • The Open Level Project
Re: Internal commands
« Reply #86 on: August 13, 2012, 02:44:52 PM »
I find createentity a bit unpredictable, I've used createentity(x,y,21,18,0) in my level to test it, and I got a terminal. Then I made a new level in which I tested it one by one, but this time, the exact same command, createentity(x,y,21,18,0), produced a white enemy sprite like you see in Linear Collider! ??? WTH? 20 also created such a thing, but you could activate it if you touch it as if it was a terminal. Also, entity ID 10 created a CD thing like you see in Security Swoop or something like that, and 18 and 24 are gray crewmates instead of cyan.

11=horizontal gravity line
12=vertical gravity line
22=should be trinket, but only shows up if you collect a trinket in that room without leaving it (used when :victoria: gives you a trinket in the ship, it is the only createentity command used in the game)
25=you have to use the metadata to change the created sprite, so createentity(x,y,25,M,0)
   0=top cup holder
   1=bottom cup holder
   2=cup
   3=flipped cup
   4=crewmate cup
   5=flipped crewmate cup
   6=sad crewmate cup
   7=flipped sad crewmate cup
   8=trinket cup
   9=flipped trinket cup
   10=nothing?
   11=nothing?
   12=square
   13=1/4th of a disappearing platform frame 1
   14=frame 2
   15=frame 3
   16=another square
   17=another square
   18=another square (when I first tested it it was a V???)
   19=square
   20=square
   (I don't know if it goes further than 20)

And it does go above 27, actually, 27-50 are all glitched :viridian:'s at the top of the screen, 51-54 is nothing?, 55 is a rescuable crewmate, where you have to use metadata 2 for the colours, createentity(x,y,55,0,M):
0= :viridian:
1= :violet:
2= :vitellary:
3= :vermillion:
4= :verdigris:
5= :victoria:
6= :viridian:
7= :viridian:
8= :viridian:
9= :viridian:

56 is an enemy, and 57, 58 and 59 are glitched :viridian:'s. After that I stopped.

Now, can someone please tell me why a lot of entities are :viridian: at the top of the screen, standing still until you move, then it starts to slide in the direction you walked to, and if you go further in that direction, it moves faster. If you walk in the opposite direction, :viridian: at the top of the screen slows down. As if the normal :viridian: is a joystick!

Dav999

  • Global Moderator
  • Captain
  • *****
  • Posts: 2173
    • View Profile
    • The Open Level Project
Re: Internal commands
« Reply #87 on: August 13, 2012, 03:01:41 PM »
And this is what happens when you go above 50 trinkets.


I changed the number of trinkets in my save file once, and it said Trinkets Found: Lots

FIQ

  • Captain
  • *****
  • Posts: 811
  • https://github.com/FredrIQ/
    • View Profile
    • FIQ
Re: Internal commands
« Reply #88 on: August 13, 2012, 03:26:10 PM »
I find createentity a bit unpredictable, I've used createentity(x,y,21,18,0) in my level to test it, and I got a terminal. Then I made a new level in which I tested it one by one, but this time, the exact same command, createentity(x,y,21,18,0), produced a white enemy sprite like you see in Linear Collider! ??? WTH? 20 also created such a thing, but you could activate it if you touch it as if it was a terminal. Also, entity ID 10 created a CD thing like you see in Security Swoop or something like that, and 18 and 24 are gray crewmates instead of cyan.

11=horizontal gravity line
12=vertical gravity line
22=should be trinket, but only shows up if you collect a trinket in that room without leaving it (used when :victoria: gives you a trinket in the ship, it is the only createentity command used in the game)
25=you have to use the metadata to change the created sprite, so createentity(x,y,25,M,0)
   0=top cup holder
   1=bottom cup holder
   2=cup
   3=flipped cup
   4=crewmate cup
   5=flipped crewmate cup
   6=sad crewmate cup
   7=flipped sad crewmate cup
   8=trinket cup
   9=flipped trinket cup
   10=nothing?
   11=nothing?
   12=square
   13=1/4th of a disappearing platform frame 1
   14=frame 2
   15=frame 3
   16=another square
   17=another square
   18=another square (when I first tested it it was a V???)
   19=square
   20=square
   (I don't know if it goes further than 20)

And it does go above 27, actually, 27-50 are all glitched :viridian:'s at the top of the screen, 51-54 is nothing?, 55 is a rescuable crewmate, where you have to use metadata 2 for the colours, createentity(x,y,55,0,M):
0= :viridian:
1= :violet:
2= :vitellary:
3= :vermillion:
4= :verdigris:
5= :victoria:
6= :viridian:
7= :viridian:
8= :viridian:
9= :viridian:

56 is an enemy, and 57, 58 and 59 are glitched :viridian:'s. After that I stopped.

Now, can someone please tell me why a lot of entities are :viridian: at the top of the screen, standing still until you move, then it starts to slide in the direction you walked to, and if you go further in that direction, it moves faster. If you walk in the opposite direction, :viridian: at the top of the screen slows down. As if the normal :viridian: is a joystick!
Didn't know about id55 :p

Sprite metadata takes sprite info from <vvvvvvdir>/data/graphics/sprites.png. You can also put numbers lower than 0 for sprites @ 25 - the entity thingy just adds some number to get the trophy sprites. Try -36.
What you are taking with 12+ is actually data from an entire other file, "entcolours.png", but as colors isn't shown, you just see blocks instead of conveyor belt parts.

I don't know why undefined entity IDs gives glitchy viridians at the top. Also, ToasterApocalypse, you forgot entity ID 0 ;)

The purple enemy thing is the first enemy sprite, but I don't think it was used ever. As custom levels leave enemy info undefined (internally, that is), that sprite is all you'll get. I guess pink is the default colour (might have to do with the fact that the first gameplay room is Welcome Aboard, which also is pink). Entity ID 56 is pretty much custom level's version of 1, but as the sprite that should be shown isn't updated if a room lacks enemies, it'll be a square, unless the room contains other enemies, or you've visited a room just before with other entities (in which case those will be used).
« Last Edit: August 13, 2012, 03:28:46 PM by FIQ »

FIQ

  • Captain
  • *****
  • Posts: 811
  • https://github.com/FredrIQ/
    • View Profile
    • FIQ
Re: Internal commands
« Reply #89 on: August 13, 2012, 03:53:13 PM »
Dav999 just made me aware (in another topic) that you could use squeak(off) to turn off the terminal (or Viridian) sound in internal scripts in 2.1.

But - I just realized that this wont do any good if not doing one of the work-arounds suggested below.

Why? Because squeak(off) turns off squeaking. How surprising indeed. But what you maybe don't realize is that this is done with simply scripting, and will edit the conversion of say() and reply() commands internally, removing the squeak() line. This will make so custom scripting needs text(1,0,0,3) instead of text(1,0,0,4), while still needing text(1,0,0,4) in 2.0... effectively making the level 2.1-only.

But, as said, this is possible to work-around with compatibility to 2.0 (except that the terminal sound still sounds in 2.0, of course). I'll show how

Work-around 1 - Version checking

versioncheck
squeak(off)
say(-1)
text(1,0,0,4)
say(4)
flag(N,on)
endcutscene
untilbars
loadscript(stop)

This is a bit interesting. While 2.0 will do the usual thing, 2.1 will ignore the first internal line, as text(1,0,0,4) writes over one line too much. If you use flag(N,on) here, it will be turned on in 2.0, while kept off in 2.1. This way, you can check which version the user runs! While this has other benefits, the main benefit of working around the 1,0,0,4 vs 1,0,0,3 problem here is easy solvable. Here's an use after turned on the flag. It will however force you to make the scripts twice.

script:
ifflag(N,script_2_0)
squeak(off)
say(-1)
text(1,0,0,3)
say(5)
(Do your thing)

script_2_0
say(-1)
text(1,0,0,4)
say(5)
(Do your thing here as well)

Work-around 2 - Limit yourself to using 3 lines per internal scripting "iteration". Makes dialogs next-to impossible to do, however!

script
squeak(off)
say(-1)
text(1,0,0,4)
say(5)
#
internal
internal
internal
text(1,0,0,4)
(...)

The "#" line will be executed in 2.0, but not in 2.1. Therefore, leaving something that isn't a command - like "#" will make 2.0 and 2.1 do the same thing.
« Last Edit: August 13, 2012, 03:57:26 PM by FIQ »