Internal commands

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

Previous topic - Next topic

blue626

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)...

Quote from: Dav999 on February 04, 2013, 07:53:52 PM
Quote from: ToasterApocalypse on February 04, 2013, 07:30:14 PM
Quote from: Dav999 on February 04, 2013, 07:27:17 PM
Quote from: ToasterApocalypse on February 04, 2013, 07:20:14 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? ???

Dav999

Quote from: blue626 on February 05, 2013, 10: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.
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)

Quote from: blue626 on February 05, 2013, 10:42:28 PM
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.)

Quote from: blue626 on February 05, 2013, 10:42:28 PM
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.

Quote from: blue626 on February 05, 2013, 10:42:28 PM
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.

Quote from: blue626 on February 05, 2013, 10:42:28 PM
Quote from: Dav999 on February 04, 2013, 07:53:52 PM
Quote from: ToasterApocalypse on February 04, 2013, 07:30:14 PM
Quote from: Dav999 on February 04, 2013, 07:27:17 PM
Quote from: ToasterApocalypse on February 04, 2013, 07:20:14 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? ???
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

Quote from: blue626 on February 05, 2013, 10:42:28 PM
Quote from: Dav999 on February 04, 2013, 07:53:52 PM
Quote from: ToasterApocalypse on February 04, 2013, 07:30:14 PM
Quote from: Dav999 on February 04, 2013, 07:27:17 PM
Quote from: ToasterApocalypse on February 04, 2013, 07:20:14 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

#543
Quote from: crazyal02 on February 05, 2013, 11:20:07 PM
Quote from: blue626 on February 05, 2013, 10:42:28 PM
Quote from: Dav999 on February 04, 2013, 07:53:52 PM
Quote from: ToasterApocalypse on February 04, 2013, 07:30:14 PM
Quote from: Dav999 on February 04, 2013, 07:27:17 PM
Quote from: ToasterApocalypse on February 04, 2013, 07:20:14 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.

FIQ

#544
Indeed the level select menu I created works by having you move left/right or flip.

FIQ

#545
Quote from: Dav999 on February 05, 2013, 09:41:56 PM
Quote from: blue626 on February 05, 2013, 09:13:20 PM
Quote from: FIQ on February 04, 2013, 02:23:57 PM
Quote from: Dav999 on February 04, 2013, 02:20:56 PM
Quote from: FIQ on February 04, 2013, 12:13:36 PM
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).

FIQ

#546
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

Hilbert

I'm having trouble Internal Scripting. It just doesn't work. I attached the script so you could figure it out.

<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

Quote from: RoskillaHULK!! on February 08, 2013, 12:12:49 AM
I'm having trouble Internal Scripting. It just doesn't work. I attached the script so you could figure it out.

<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

Quote from: RoskillaHULK!! on February 08, 2013, 12:12:49 AM
I'm having trouble Internal Scripting. It just doesn't work. I attached the script so you could figure it out.

<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!' ;)

Fussmatte

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

Quote from: Doormat on February 09, 2013, 07:22:07 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

Quote from: RoskillaHULK!! on February 09, 2013, 12:59:02 PM
Quote from: Doormat on February 09, 2013, 07:22:07 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

yes.

colour is the British

and color is worldwide or something.

Hilbert

Quote from: Chillius03 on February 09, 2013, 03:43:43 PM
yes.

colour is the British and Canadian

and color is worldwide or something.