Author Topic: Internal commands  (Read 256805 times)

blue626

  • Captain
  • *****
  • Posts: 672
  • I changed my avatar!
    • View Profile
Re: Internal commands
« Reply #540 on: February 05, 2013, 02:42:28 PM »
I did think of something like that... should have thought deeper.
Didn't play that level yet, but I'll play it and check the scripts.
This might be hard to do, but I believe it's possible: hold an arrow key for a short time, short enough so that :viridian: doesn't touch the script box. It's unavoidable, although it's unlikely to happen.
Why would you have a script box above :viridian:?
Perhaps making :viridian: invisible would be a good idea (or did you already do that?).
According to my calculations, I don't see why FIQ would need 35 scripts and 8 flags (considering his screenshot from Back to VVVVVV)...

Is there a way to make  :viridian: move during a script?

walk(left/right,tiles)

Be controlled*

Oh, so that you can control him while running a script?

Unfortunately not. :(

I thought you could do that with the No-cutscene-bars method? ???

Dav999

  • Global Moderator
  • Captain
  • *****
  • Posts: 2173
    • View Profile
    • The Open Level Project
Re: Internal commands
« Reply #541 on: February 05, 2013, 03:19:18 PM »
I did think of something like that... should have thought deeper.
Didn't play that level yet, but I'll play it and check the scripts.
The script names are still a bit misleading, but these are from things I tried before having a yes/no dialog (first I had an easy/hard dialog, but I didn't change the name of the scripts. Also you might find some things which haven't been used yet (like centering a text box with -500,-500 as coordinates)

This might be hard to do, but I believe it's possible: hold an arrow key for a short time, short enough so that :viridian: doesn't touch the script box. It's unavoidable, although it's unlikely to happen.
That may also happen in other programs/applications/games, and it's not a big problem (it would be the user's fault if they deliberately press the button for a really short time, and it doesn't cause glitches at all.)

Why would you have a script box above :viridian:?
To check whether you pressed action/space (/up/down/z/v) to select something or not.

Perhaps making :viridian: invisible would be a good idea (or did you already do that?).
I used fadeout(), but you can also use blackout(), it freezes the screen instead of making it black. If the screen is frozen, you don't see :viridian: moving, but you have to cover up the background because otherwise you notice that the stars also stop moving. And text boxes won't be cleared correctly while 'blacked out', they will have faded a little bit, but they won't disappear.

Is there a way to make  :viridian: move during a script?

walk(left/right,tiles)

Be controlled*

Oh, so that you can control him while running a script?

Unfortunately not. :(

I thought you could do that with the No-cutscene-bars method? ???
That's something else. It can be used to simulate it, but it doesn't make you able to control :viridian: while the script is still running.

allison

  • Captain
  • *****
  • Posts: 924
  • monolithic since 2012??
    • View Profile
    • Allison Fleischer
Re: Internal commands
« Reply #542 on: February 05, 2013, 03:20:07 PM »
Is there a way to make  :viridian: move during a script?

walk(left/right,tiles)

Be controlled*

Oh, so that you can control him while running a script?

Unfortunately not. :(

I thought you could do that with the No-cutscene-bars method? ???

The No-cutscene-bars method still locks the controls, but it's usually for a short enough time that it's not noticeable. However, longer scripts will noticeably lock the controls.

Dav999

  • Global Moderator
  • Captain
  • *****
  • Posts: 2173
    • View Profile
    • The Open Level Project
Re: Internal commands
« Reply #543 on: February 05, 2013, 03:30:29 PM »
Is there a way to make  :viridian: move during a script?

walk(left/right,tiles)

Be controlled*

Oh, so that you can control him while running a script?

Unfortunately not. :(

I thought you could do that with the No-cutscene-bars method? ???

The No-cutscene-bars method still locks the controls, but it's usually for a short enough time that it's not noticeable. However, longer scripts will noticeably lock the controls.

If you only use things like gotoroom(x,y), gotoposition(x,y,f), playef(x), customiftrinkets(n,s), customifflag(n,s), etc, then you won't notice any interruption with the no-cutscene-bars method, if you use text boxes without backgroundtext, delay(t), or an enormously large amount of commands, then you will. Still, the scripts run faster than you think: I once made a script where 15 text boxes were displayed on top of each other at the same time using backgroundtext (with the number of the text box as the text), and the last one still appeared instantly, and the first 14 were completely unnoticeable.
« Last Edit: February 05, 2013, 03:41:34 PM by Dav999 »

FIQ

  • Captain
  • *****
  • Posts: 810
  • https://github.com/FredrIQ/
    • View Profile
    • FIQ
Re: Internal commands
« Reply #544 on: February 06, 2013, 02:03:28 AM »
Indeed the level select menu I created works by having you move left/right or flip.
« Last Edit: February 06, 2013, 06:54:53 AM by FIQ »

FIQ

  • Captain
  • *****
  • Posts: 810
  • https://github.com/FredrIQ/
    • View Profile
    • FIQ
Re: Internal commands
« Reply #545 on: February 06, 2013, 07:03:28 AM »
I was creating an user interface abusing backgroundtext heavily showing various dialogs at screen. (...)

I wonder how you can create a user interface with only one button and barely any conditional things...

Oh, and maybe textboxactive can help. It's clears all dialogs on the screen except for the last one created. So if you create 3 text boxes to be displayed at the same time, when you use endtext or endtextfast, all three will be cleared at once, but if you use textboxactive, only the first two are cleared, and the last one remains on the screen!
You have 3 buttons actually.
Look at my screenshot in Back to VVVVVV :P
(...)

And, the lack of real conditionals doesn't make it impossible, just a bit more complex :P

The total amount of scripts in my user interface ended up being 35 and it used 8 flags. In that state, everything was working properly without issues.

 :vitellary: ???
How can you make it so that the arrow keys affect a script (I guess those are the other 2 buttons)?
Didn't see any command that does that in the 2nd post.
Not that I'm going to use it in a level but... :o

I figured it out myself: you can put :viridian: in a specific spot with one script box to the left and one script box to the right, and another one above him. If you walk to either side, you trigger the script where the dialogs are displayed on screen, flags are changed, and :viridian: is teleported back to the original spot. I first thought the flipping part wouldn't work, because not using endtext after a script with normal dialogs meant that the dialog would not dissappear, and :viridian: wouldn't be able to flip while the text box is on the screen. However, this only applies to text boxes without backgroundtext.

I also made two examples of a level with a sort of interface, the first one has the 20-dialogs-cap-bug, which only occurs if you repeatedly move back and forth between the buttons more than 8 times. The second one doesn't, because you select in a different way (you just press left or right to directly 'click' a button, without first highlighting it and pressing action).

As always, please ignore the __MACOSX folder in the zip it's a hidden folder I can't change that etc etc.
Also ignore the typing error in the script (saing instead of saying)
While that it cool, keep in mind that it's very easy to accidentally quit the game with enter or escape by mistake in the UI. A work-around is to fadeout, then use blackout, then fadein again (it will not visibly fade in UNLESS you have roomtext inside (strangely the [Press ENTER to return to editor] text in the editor also visibly fade in)). This also gives the benefit of a more seamless textbox reload, as they don't disappear completely when "reloading" them to avoid the 20 textboxes limit. However, this is at the same time an issue as you have to make the dialogs output the exact same content (or at least the exact same length) to avoid having old dialogs still on screen.

Interestingly, 2.1's blackon/blackout has several bugs not present in 2.0, including:
* The transistion between the game screen and ESC screen is a bit glitchy
* Same goes for enter screen
* Pause text doesn't get stuck in 2.0 as in 2.1 (as 2.0 doesn't show it).
« Last Edit: February 06, 2013, 07:33:05 AM by FIQ »

FIQ

  • Captain
  • *****
  • Posts: 810
  • https://github.com/FredrIQ/
    • View Profile
    • FIQ
Re: Internal commands
« Reply #546 on: February 07, 2013, 02:25:34 PM »
Just a FYI, but if you for some reason want to leave internal mode and continue with simplified scripting without either a text dialog which isn't 5 lines or appearing over Viridian's head or the center, or loading a new script, you can substitute loadscript(stop) by text(1,0,0,3). This will override the necessary commands, i.e:
(2.0: position(center) or position(player,above) | 2.1: customposition(center) or customposition(player,above))
speak_active
endtext
« Last Edit: February 07, 2013, 02:27:27 PM by FIQ »

Hilbert

  • Captain
  • *****
  • Posts: 574
  • Yup. This is my name. Not Black, Hilbert.
    • View Profile
Re: Internal commands
« Reply #547 on: February 07, 2013, 04:12:49 PM »
I'm having trouble Internal Scripting. It just doesn't work. I attached the script so you could figure it out.

Code: [Select]
<script>start:|iftrinkets(0,startreal)||startreal:|say(3)|hideplayer()|fadeout()|untilfade()|flash|delay(20)|flash|reply(1)|Wait-|flash|flash|flash|reply|What? NO! NO!|reply|NOOOOOOOO!!|flash|delay(10)|flash|delay(10)|flash|delay(10)|flash|delay(10)|flash|delay(100)|</script>
I used the second method in the second post.

Hilbert

  • Captain
  • *****
  • Posts: 574
  • Yup. This is my name. Not Black, Hilbert.
    • View Profile
Re: Internal commands
« Reply #548 on: February 07, 2013, 04:19:17 PM »
I'm having trouble Internal Scripting. It just doesn't work. I attached the script so you could figure it out.

Code: [Select]
<script>start:|iftrinkets(0,startreal)||startreal:|say(3)|hideplayer()|fadeout()|untilfade()|flash|delay(20)|flash|reply(1)|Wait-|flash|flash|flash|reply|What? NO! NO!|reply|NOOOOOOOO!!|flash|delay(10)|flash|delay(10)|flash|delay(10)|flash|delay(10)|flash|delay(100)|</script>
I used the second method in the second post.
NVM i fixed it but i get a text box with customposition center and shtuff. also it takes a long time to start

Dav999

  • Global Moderator
  • Captain
  • *****
  • Posts: 2173
    • View Profile
    • The Open Level Project
Re: Internal commands
« Reply #549 on: February 07, 2013, 04:30:44 PM »
I'm having trouble Internal Scripting. It just doesn't work. I attached the script so you could figure it out.

Code: [Select]
<script>start:|iftrinkets(0,startreal)||startreal:|say(3)|hideplayer()|fadeout()|untilfade()|flash|delay(20)|flash|reply(1)|Wait-|flash|flash|flash|reply|What? NO! NO!|reply|NOOOOOOOO!!|flash|delay(10)|flash|delay(10)|flash|delay(10)|flash|delay(10)|flash|delay(100)|</script>
I used the second method in the second post.

You forgot text(1,0,0,4) at the end. Also check FIQ's post above yours about the change from internal to simplified (so change say(3) into say(4) for a line underneath untilfade() with text(1,0,0,3). Also change 'Wait-' into 'TURN YOUR VOLUME DOWN!' ;)

Hejmstel

  • Captain
  • *****
  • Posts: 502
  • Formerly "Doormat"
    • View Profile
    • My hardly used YT account
Re: Internal commands
« Reply #550 on: February 08, 2013, 11:22:07 PM »
I was trying to use the changecolor/changeplayercolor commands and they wouldn't work, but then I found out it was 'colour' in the commands, not color. British English ???

Hilbert

  • Captain
  • *****
  • Posts: 574
  • Yup. This is my name. Not Black, Hilbert.
    • View Profile
Re: Internal commands
« Reply #551 on: February 09, 2013, 04:59:02 AM »
I was trying to use the changecolor/changeplayercolor commands and they wouldn't work, but then I found out it was 'colour' in the commands, not color. British English ???
I always thought it was wierd since they mainly use that spelling in Canada, but Terry uses it for the game and I think he made it in Ireland? ???

FIQ

  • Captain
  • *****
  • Posts: 810
  • https://github.com/FredrIQ/
    • View Profile
    • FIQ
Re: Internal commands
« Reply #552 on: February 09, 2013, 07:09:18 AM »
I was trying to use the changecolor/changeplayercolor commands and they wouldn't work, but then I found out it was 'colour' in the commands, not color. British English ???
I always thought it was wierd since they mainly use that spelling in Canada, but Terry uses it for the game and I think he made it in Ireland? ???
Well, Terry lives in ireland, and then the british english used makes sense. After all the scripting language was never supposed to be used by end users, which probably would be more comfortable with US english as that's what most things on the internet use :P

Personally I don't care, as long as I know what it is.

Chillius

  • Captain
  • *****
  • Posts: 451
  • I'm back.
    • View Profile
Re: Internal commands
« Reply #553 on: February 09, 2013, 07:43:43 AM »
yes.

colour is the British

and color is worldwide or something.

Hilbert

  • Captain
  • *****
  • Posts: 574
  • Yup. This is my name. Not Black, Hilbert.
    • View Profile
Re: Internal commands
« Reply #554 on: February 09, 2013, 08:26:42 AM »
yes.

colour is the British and Canadian

and color is worldwide or something.