Author Topic: Internal commands  (Read 257549 times)

FIQ

  • Captain
  • *****
  • Posts: 810
  • https://github.com/FredrIQ/
    • View Profile
    • FIQ
Re: Internal commands
« Reply #315 on: October 15, 2012, 11:06:02 AM »
Script: test
A)Say
alarmon

It doesn't work :-\
Hmm. Weird, it does for me!
I'll check for typos/etc, brb

EDIT: ...lol
I found out why. (I played around with my dedicated test level and didn't realize that I actually loaded another script)

Try this instead:

Script: test
flag(90,on)
ifflag(90,test2)

Script: test2
A)Say
alarmon

If it still doesn't work, try the level below to see my exact environment. Might explain why then.

Did you put anything in the zip? It's empty ???

EDIT: It started with a dot, so it showed up as hidden for me. :P Will try it out.

By the way, I'm also testing it with specialline(x) now.
I also found out this: Sometimes (often) if you have something below that ^, the script will just not execute at all. Don't know why exactly, but since it doesn't matter, you can place it last in a script, it will go first anyway :P

If even that environment doesn't work (for you), I have no idea really. Linux exclusive glitch ???

That level worked, and I found out how to make it work (although I have no idea why it works :P)

Code: [Select]
A)Say
alarmon
This doesn't work.

Code: [Select]
delay(0)
A)Say
alarmon
This does work!

So, a delay makes it work. I've also tried
Code: [Select]
#
A)Say
alarmon
but that didn't work. Now I tried it again and it did work??? ???

Anyway: putting a delay(0) or # in front of it makes it work. (And of course ifflagging from another script)

It's also handy for gotoroom!
Ohh, so you don't *have* to run it externally, just run something before? Good to know!

Wonder how quickly scripts do run? Was thinking of doing a trinket room in my level, like in the original game. :3

Well, I think it runs quick enough to do that. If you make :viridian: walk into another room with walk(x,x), and if you time it correctly, you can create an entity fast enough to make it look like it was there before you entered the room.
Yeah, but I hoped to not have to bother with walk() to do it. :P

Dav999

  • Global Moderator
  • Captain
  • *****
  • Posts: 2173
    • View Profile
    • The Open Level Project
Re: Internal commands
« Reply #316 on: October 15, 2012, 11:25:32 AM »
Well, this script runs quick enough, doesn't it? You can run it multiple times.

RibShark

  • Crewmate
  • **
  • Posts: 23
    • View Profile
Re: Internal commands
« Reply #317 on: October 15, 2012, 11:28:37 AM »
Anyway: putting a delay(0) or # in front of it makes it work. (And of course ifflagging from another script)

I've been trying this out, and for whatever reason only the ifflag method works for me... strange  :-\.

Anyways, Imma try make it work with multiple commands, but great job guys!

FIQ

  • Captain
  • *****
  • Posts: 810
  • https://github.com/FredrIQ/
    • View Profile
    • FIQ
Re: Internal commands
« Reply #318 on: October 15, 2012, 11:36:49 AM »
Well, this script runs quick enough, doesn't it? You can run it multiple times.
Definitely.
The updated version of my level will feature working trinkets room :P

Dav999

  • Global Moderator
  • Captain
  • *****
  • Posts: 2173
    • View Profile
    • The Open Level Project
Re: Internal commands
« Reply #319 on: October 15, 2012, 11:47:40 AM »
Why doesn't it work here?

<script>script1:|flag(90,on)|ifflag(90,script2)|script2:|delay(0)|A)Say|alarmon||</script>

???

EDIT: Oh right, it does work if I remove one enter at the end:

<script>script1:|flag(90,on)|ifflag(90,script2)|script2:|delay(0)|A)Say|alarmon|</script>

Why does that matter? ???
« Last Edit: October 15, 2012, 11:49:34 AM by Dav999 »

FIQ

  • Captain
  • *****
  • Posts: 810
  • https://github.com/FredrIQ/
    • View Profile
    • FIQ
Re: Internal commands
« Reply #320 on: October 15, 2012, 12:07:59 PM »
Why doesn't it work here?

<script>script1:|flag(90,on)|ifflag(90,script2)|script2:|delay(0)|A)Say|alarmon||</script>

???

EDIT: Oh right, it does work if I remove one enter at the end:

<script>script1:|flag(90,on)|ifflag(90,script2)|script2:|delay(0)|A)Say|alarmon|</script>

Why does that matter? ???
As I said, if you have anything below the script, it will not work as it shouuld, if at all. "Anything" includes empty lines. :P (You must have exactly one empty line after the script. If you also remove this one, VVVVVV will remove the line before that, because of how it parses stuff)

Dav999

  • Global Moderator
  • Captain
  • *****
  • Posts: 2173
    • View Profile
    • The Open Level Project
Re: Internal commands
« Reply #321 on: October 15, 2012, 12:31:08 PM »
Why doesn't it work here?

<script>script1:|flag(90,on)|ifflag(90,script2)|script2:|delay(0)|A)Say|alarmon||</script>

???

EDIT: Oh right, it does work if I remove one enter at the end:

<script>script1:|flag(90,on)|ifflag(90,script2)|script2:|delay(0)|A)Say|alarmon|</script>

Why does that matter? ???
As I said, if you have anything below the script, it will not work as it shouuld, if at all. "Anything" includes empty lines. :P (You must have exactly one empty line after the script. If you also remove this one, VVVVVV will remove the line before that, because of how it parses stuff)

It still feels kinda contradictory that you have to write scripts backwards now. If you want to use three internal lines without cutscene bars or sound or whatever, you have to use this:

script0:
flag(90,on)
ifflag(90,script1)

script1:
ifflag(90,script2)
A)Say
[internal]

script2:
ifflag(90,script3)
A)Say
[internal]

script3:
#
A)Say
[internal]

You would think it first runs the ifflag command, which lets you never run the A)Say command.

Does B)Say and C)Say also work?

FIQ

  • Captain
  • *****
  • Posts: 810
  • https://github.com/FredrIQ/
    • View Profile
    • FIQ
Re: Internal commands
« Reply #322 on: October 15, 2012, 12:32:33 PM »
Why doesn't it work here?

<script>script1:|flag(90,on)|ifflag(90,script2)|script2:|delay(0)|A)Say|alarmon||</script>

???

EDIT: Oh right, it does work if I remove one enter at the end:

<script>script1:|flag(90,on)|ifflag(90,script2)|script2:|delay(0)|A)Say|alarmon|</script>

Why does that matter? ???
As I said, if you have anything below the script, it will not work as it shouuld, if at all. "Anything" includes empty lines. :P (You must have exactly one empty line after the script. If you also remove this one, VVVVVV will remove the line before that, because of how it parses stuff)

It still feels kinda contradictory that you have to write scripts backwards now. If you want to use three internal lines without cutscene bars or sound or whatever, you have to use this:

script0:
flag(90,on)
ifflag(90,script1)

script1:
ifflag(90,script2)
A)Say
[internal]

script2:
ifflag(90,script3)
A)Say
[internal]

script3:
#
A)Say
[internal]

You would think it first runs the ifflag command, which lets you never run the A)Say command.

Does B)Say and C)Say also work?
Anything should work, really.
And yeah, the behaviour is quite buggy and way more "instable" than the traditional metod, it's just a nice way to run stuff without leaving "markings". I will actually switch to this method in some places that requires "critical" timing in my own level (mostly related to checkpointing and The Gravitron), as it works better than the old method *for purposes like that*. :P
« Last Edit: October 15, 2012, 12:34:38 PM by FIQ »

Dav999

  • Global Moderator
  • Captain
  • *****
  • Posts: 2173
    • View Profile
    • The Open Level Project
Re: Internal commands
« Reply #323 on: October 15, 2012, 12:43:54 PM »
I also know some purposes for it in my new level! (That may be released soon! :viridian:)

avengah

  • Professor
  • ****
  • Posts: 117
    • View Profile
Re: Internal commands
« Reply #324 on: October 15, 2012, 01:12:42 PM »
Instead of wasting a flag (not that it really matters), you could use iftrinkets(0,script2) etc. Of course, you could set the flag at the start of the level and leave it set, but that would cause problems when testing specific rooms.

FIQ

  • Captain
  • *****
  • Posts: 810
  • https://github.com/FredrIQ/
    • View Profile
    • FIQ
Re: Internal commands
« Reply #325 on: October 15, 2012, 01:24:28 PM »
Instead of wasting a flag (not that it really matters), you could use iftrinkets(0,script2) etc. Of course, you could set the flag at the start of the level and leave it set, but that would cause problems when testing specific rooms.
Yeah, of course.

Dav999

  • Global Moderator
  • Captain
  • *****
  • Posts: 2173
    • View Profile
    • The Open Level Project
Re: Internal commands
« Reply #326 on: October 16, 2012, 02:46:46 AM »
I only realize now that there is a misunderstanding. Yes, you have to put something before the A)Say, but you also do have to link from another script. I showed what the actual script looked like when it worked for me, but when I said it was linked, I said it in such a way that you thought I meant you don't have to link from another script.

FIQ

  • Captain
  • *****
  • Posts: 810
  • https://github.com/FredrIQ/
    • View Profile
    • FIQ
Re: Internal commands
« Reply #327 on: October 16, 2012, 10:30:25 AM »
I only realize now that there is a misunderstanding. Yes, you have to put something before the A)Say, but you also do have to link from another script. I showed what the actual script looked like when it worked for me, but when I said it was linked, I said it in such a way that you thought I meant you don't have to link from another script.

My trinket scripts looks like this:

showtrinket1:
iftrinkets(0,showtrinkets2)
A)Say
createentity(136,80,22,1,0)

showtrinket2:
iftrinkets(0,showtrinkets3)
A)Say
createentity(112,80,22,2,0)

(...)

showtrinket20:
A)Say
createentity(136,176,22,0,0)

And it works perfectly. Note that I don't have anything before the internal part in #20

(Never mind my interesting lack of order, that wasn't my point)

Dav999

  • Global Moderator
  • Captain
  • *****
  • Posts: 2173
    • View Profile
    • The Open Level Project
Re: Internal commands
« Reply #328 on: October 16, 2012, 10:51:41 AM »
Well, I will try it out. ???

blue626

  • Captain
  • *****
  • Posts: 672
  • I changed my avatar!
    • View Profile
Re: Internal commands
« Reply #329 on: October 16, 2012, 12:06:59 PM »
I've been testing internal scripting in a differnt way, to see if it worked:

say(-x)
internal x times

I found a glitch, I'll tell details later.

You have piqued my interest... How far away is later?

Sorry, I've been busy. But it's almost what avengah said:

It only detects one internal command, but you see an empty text box as well.

Here's what I did:

I played a level, the last script being executed made :viridian: sad and created a grey centered text box saying "Here's your cake" or something similar. I quitted without saving (because I had no way out, including suiciding).

After that, I created a level just for testing internal scripting. I created 3 scripts. One called script1 had this:

say(-1)
alarmon
(empty line)

Another called script2 had something like this:

say(-2)
playef(9)
(something I don't remember)
(empty line)


The last one, called script3 had someting like this:

say(-4)
flash(5)
gotoposition(1,1)
playef(10)
(empty line)

Here's what happened when I triggered script1 (I triggered every script in the editor):

:viridian: turned sad, a centered grey text box with "Here's your cake" appeared and the alarm turned on.

When I triggered script2:

:viridian: turned sad, a centered grey text box with "Here's your cake" appeared and a flash sound was played with neither the white screen nor shaking. If script1 was triggered earlier the alarm didn't turn off.

When I triggered script3:

:viridian: turned sad, a centered grey text box with "Here's your cake" appeared and a flash with neither sound effect nor shaking and normal duration appeared. If script1 was triggered earlier the alarm didn't turn off.

I changed script3 slightly. I also changed script2 slightly but I don't remember how. Here's the new script3:

say(-4)
gotoposition(1,1)
flash(5)
playef(10)
(empty line)

Here's what happened when I triggered it:

:viridian: turned sad, a centered grey text box with "Here's your cake" appeared and :viridian: immediately disappeared form the place he/she was and appeared near the top left of the screen. If script1 was triggered earlier the alarm didn't turn off.

Then, I realized this: only the 1st line was executed. The same behavior happened with the new script2, IIRC.

It's likely that the reason to why an empty box appeared when avengah tested it is because avengah tested it immediately after he/she opened VVVVVV.

The fact that you need to play a level before testing to make a text box appear is similar to a glitch I've reported that isn't related to internal scripting. You need to make a mistake in scripting to reproduce this, though.

The fact that it only executes the 1st line might (or should) have been discovered before by FIQ (since he's the one who discovered the say(-1) glitch to execute int. scripting). Did anyone discover this before?

EDIT: This thread already has 330 replies! :o :o :o