Welcome, Guest. Please login or register.

Author Topic: Internal commands  (Read 55510 times)

nicholashin

  • tOLP Contributor
  • Captain
  • *****
  • Posts: 248
  • (Best?) VVVVVV Player level Critic
    • View Profile
Re: Internal commands
« Reply #40 on: 3 Oct 2013, 04:34 (9 years and 0 months ago) »
It's reopened!! Look at this print page for reference: http://distractionware.com/forum/index.php?action=printpage;topic=1089.0
Code: [Select]
counter_load:
ifflag(11,stop)
iftrinkets(0,counter) # load internal script

counter:
say(5) # this is one of the few needed internal scripts
gotoroom(0,0) # allow "script backgrounding"
customifflag(5,counter5) # increase counter of flag 5
customifflag(10,counter_started) # check if it has started at all
flag(10,on) # it hasn't
text(1,0,0,4)
say(5) # text
text(gray,-1,30,1)
Counter
backgroundtext
speak
text(1,0,0,4)
say(5)
text(red,-1,90,1)
10
backgroundtext
speak
text(1,0,0,4)
say(5) # set the flags to their current time, making it output 9 once a full second pass
flag(6,on)
flag(7,off)
flag(8,off)
flag(9,on)
loadscript(stop)
text(1,0,0,4)

counter_started:
flag(5,on)
delay(0)

counter5:
flag(5,off) # Do the splitsecond counter
ifflag(4,counter4)
flag(4,on)
delay(0) # those are needed to prevent a bug in VVVVVV

counter4:
flag(4,off)
ifflag(3,counter3)
flag(3,on)
delay(0)

counter3:
flag(3,off)
ifflag(2,counter2)
flag(2,on)
delay(0)

counter2:
flag(2,off)
ifflag(1,counter1)
flag(1,on)
delay(0)

counter1:
flag(1,off)
iftrinkets(0,counter_full0000) # trigger a second, check at the very bottom
delay(0)

# The full counters, sorted by when they occur (in practice). The first part which doesn't exist for odd numbers are continuing branching to other seconds, simulating integers. The second part sets the flags applied for the incoming second. The third part is actual output. While I could merge part 1 and 2 under the same text(1,0,0,4) part in some cirumstances, I didn't, to make it more understandable.

counter_full1001:
say(2)
flag(9,off)
text(1,0,0,4)
say(5)
text(red,-1,90,1)
09
backgroundtext
speak
loadscript(stop)
text(1,0,0,4)

counter_full1000:
say(2)
customifflag(9,counter_full1001)
text(1,0,0,4)
say(5)
flag(6,off)
flag(7,on)
flag(8,on)
flag(9,on)
text(1,0,0,4)
say(5)
text(red,-1,90,1)
08
backgroundtext
speak
loadscript(stop)
text(1,0,0,4)

counter_full0111:
say(2)
flag(9,off)
text(1,0,0,4)
say(5)
text(red,-1,90,1)
07
backgroundtext
speak
loadscript(stop)
text(1,0,0,4)

counter_full0110:
say(3)
customifflag(9,counter_full0111)
text(1,0,0,4)
say(3)
flag(8,off)
flag(9,on)
text(1,0,0,4)
say(5)
text(red,-1,90,1)
06
backgroundtext
speak
loadscript(stop)
text(1,0,0,4)

counter_full0101:
say(2)
flag(9,off)
text(1,0,0,4)
say(5)
text(red,-1,90,1)
05
backgroundtext
speak
loadscript(stop)
text(1,0,0,4)

counter_full0100:
say(3)
customifflag(8,counter_full0110)
customifflag(9,counter_full0101)
text(1,0,0,4)
say(4)
flag(7,off)
flag(8,on)
flag(9,on)
text(1,0,0,4)
say(5)
text(red,-1,90,1)
04
backgroundtext
speak
loadscript(stop)
text(1,0,0,4)

counter_full0011:
say(2)
flag(9,off)
text(1,0,0,4)
say(5)
text(red,-1,90,1)
03
backgroundtext
speak
loadscript(stop)
text(1,0,0,4)

counter_full0010:
say(2)
customifflag(9,counter_full0011)
text(1,0,0,4)
say(3)
flag(8,off)
flag(9,on)
text(1,0,0,4)
say(5)
text(red,-1,90,1)
02
backgroundtext
speak
loadscript(stop)
text(1,0,0,4)

counter_full0001:
say(2)
flag(9,off)
text(1,0,0,4)
say(5)
text(red,-1,90,1)
01
backgroundtext
speak
loadscript(stop)
text(1,0,0,4)

counter_full0000:
say(5)
customifflag(6,counter_full1000) # those are different states of flags
customifflag(7,counter_full0100)
customifflag(8,counter_full0010)
customifflag(9,counter_full0001)
text(1,0,0,4)
say(5)
text(red,-1,90,1)
00
backgroundtext
speak
text(1,0,0,4)
say(2)
flag(11,on) # stop the script
loadscript(stop)
text(1,0,0,4)
« Last Edit: 4 Oct 2013, 07:27 by nicholashin »

FIQ

  • Global Moderator
  • Professor
  • *
  • Posts: 132
    • View Profile
    • GitHub profile
Re: Internal commands
« Reply #41 on: 4 Oct 2013, 06:34 (9 years and 0 months ago) »
I just re-read the script, and found 2 obvious bugs. The code was just to show what I would do, not for actual use, but here goes:

In counter2:
-ifflag(2,counter1)
+ifflag(1,counter1)

In counter1:
-ifflag(1,counter_full0000)
+iftrinkets(0,counter_full0000)

FIQ

  • Global Moderator
  • Professor
  • *
  • Posts: 132
    • View Profile
    • GitHub profile
Re: Internal commands
« Reply #42 on: 18 May 2014, 14:30 (8 years and 4 months ago) »
Bump.

Since Terry has made clear that he doesn't intend to do anything regarding scripting - that is, neither fixing it, or improving it - this is still very relevant.

HOWEVER, Terry also made clear that he doesn't want to force people to update just to play player levels. This means that, unless someone wants to ignore that request, we should NOT abuse the fact that 2.1+ currently can work with say() (or reply() ) with lines above 5.

Basically, just pretend that the update never happened @ level scripting. Otherwise, him wanting to keep backward compatibility is rather pointless. Just saying : D

EDIT: And if you decide to ignore it regardless, at least do a version check.
Code: (checkversion) [Select]
squeak(off)
say(-1)
text(1,0,0,4)
say(2)
customiftrinkets(0,version20)
customiftrinkets(0,version21)
« Last Edit: 18 May 2014, 14:35 by FIQ »

Info Teddy

  • Ultra Captain
  • ********
  • Posts: 3138
    • View Profile
a 1yr bump? rly fiq?
« Reply #43 on: 18 May 2014, 18:07 (8 years and 4 months ago) »
Bump.

Since Terry has made clear that he doesn't intend to do anything regarding scripting - that is, neither fixing it, or improving it - this is still very relevant.

HOWEVER, Terry also made clear that he doesn't want to force people to update just to play player levels. This means that, unless someone wants to ignore that request, we should NOT abuse the fact that 2.1+ currently can work with say() (or reply() ) with lines above 5.

Basically, just pretend that the update never happened @ level scripting. Otherwise, him wanting to keep backward compatibility is rather pointless. Just saying : D

EDIT: And if you decide to ignore it regardless, at least do a version check.
[code=checkversion]NOBODY CARES ABOUT THIS[/code]
you know how some random person created mcedit for minecraft just to make modifying maps easier? someone should make an external scripting editor for vvvvvv so we won't have to repeat text() and say() every 4 lines. the program takes the script data from a level, we just throw in our commands, the program adds in the necessary text() and say() crap, then uploads it into the level.

Hejmstel

  • tOLP Contributor
  • Super Captain
  • ******
  • Posts: 714
  • Formerly "Doormat"
    • View Profile
    • youtoot chunnel
Re: Internal commands
« Reply #44 on: 18 May 2014, 18:09 (8 years and 4 months ago) »
Quote
a 1yr bump? rly fiq?
if it's relevant to the topic and adds something, it's fine.

Info Teddy

  • Ultra Captain
  • ********
  • Posts: 3138
    • View Profile
still,,,,,,,,
« Reply #45 on: 18 May 2014, 18:12 (8 years and 4 months ago) »
if it's relevant to the topic and adds something, it's fine.
okay, then.

FIQ

  • Global Moderator
  • Professor
  • *
  • Posts: 132
    • View Profile
    • GitHub profile
Re: a 1yr bump? rly fiq?
« Reply #46 on: 18 May 2014, 21:37 (8 years and 4 months ago) »
Bump.

Since Terry has made clear that he doesn't intend to do anything regarding scripting - that is, neither fixing it, or improving it - this is still very relevant.

HOWEVER, Terry also made clear that he doesn't want to force people to update just to play player levels. This means that, unless someone wants to ignore that request, we should NOT abuse the fact that 2.1+ currently can work with say() (or reply() ) with lines above 5.

Basically, just pretend that the update never happened @ level scripting. Otherwise, him wanting to keep backward compatibility is rather pointless. Just saying : D

EDIT: And if you decide to ignore it regardless, at least do a version check.
[code=checkversion]NOBODY CARES ABOUT THIS[/code]
you know how some random person created mcedit for minecraft just to make modifying maps easier? someone should make an external scripting editor for vvvvvv so we won't have to repeat text() and say() every 4 lines. the program takes the script data from a level, we just throw in our commands, the program adds in the necessary text() and say() crap, then uploads it into the level.
Oh yeah, I'm all for an external VVVVVV level editor. The internal one is fine enough, but it could use some work, but since there wont be any work done with it, I suppose an external editor could be useful. Not just for scripting, but for other stuff too like better tile management and such nice things.

Info Teddy

  • Ultra Captain
  • ********
  • Posts: 3138
    • View Profile
external level editing.
« Reply #47 on: 18 May 2014, 21:46 (8 years and 4 months ago) »
Oh yeah, I'm all for an external VVVVVV level editor. The internal one is fine enough, but it could use some work, but since there wont be any work done with it, I suppose an external editor could be useful. Not just for scripting, but for other stuff too like better tile management and such nice things.
and 40x40 maps that won't crash when you attempt to save them in-game!

FIQ

  • Global Moderator
  • Professor
  • *
  • Posts: 132
    • View Profile
    • GitHub profile
Re: external level editing.
« Reply #48 on: 19 May 2014, 06:38 (8 years and 4 months ago) »
Oh yeah, I'm all for an external VVVVVV level editor. The internal one is fine enough, but it could use some work, but since there wont be any work done with it, I suppose an external editor could be useful. Not just for scripting, but for other stuff too like better tile management and such nice things.
and 40x40 maps that won't crash when you attempt to save them in-game!
Not possible.
40x40 is way too big for such a thing anyway.

FIQ

  • Global Moderator
  • Professor
  • *
  • Posts: 132
    • View Profile
    • GitHub profile
Re: Internal commands
« Reply #49 on: 12 Jun 2014, 09:55 (8 years and 3 months ago) »
If you want to use Predestined Fate Remixed in the level, I suggest doing this:

Code: [Select]
music_predestinedfate2:
music(6)
music(15a)

Or, internally:
Code: [Select]
music_predestinedfate2:
say(3)
play(8)
play(15)
loadscript(stop)
text(1,0,0,4)

This will ensure that 2.0 and 2.1 users will hear Predestined Fate rather than Predestined Fate 2. Keep in mind that this will currently break in the Windows version of M&P because for some reason that version lacks the remixed Predestined Fate. However, this version is supposed to see a patch very soon, so we should be OK using this.

allison

  • tOLP Contributor
  • Hyper Captain
  • *******
  • Posts: 1208
  • monolithic since 2012???
    • View Profile
    • Allison Fleischer
Re: Internal commands
« Reply #50 on: 13 Sep 2014, 18:26 (8 years and 0 months ago) »
I've been messing around with internal scripting in 2.2. The maximum number of lines in a "block" [say(x)] aren't unlimited; the maximum is 50.

Info Teddy

  • Ultra Captain
  • ********
  • Posts: 3138
    • View Profile
thatsridiculous.wav
« Reply #51 on: 13 Sep 2014, 19:00 (8 years and 0 months ago) »
I've been messing around with internal scripting in 2.2. The maximum number of lines in a "block" [say(x)] aren't unlimited; the maximum is 50.
why is there a maximum anyway

allison

  • tOLP Contributor
  • Hyper Captain
  • *******
  • Posts: 1208
  • monolithic since 2012???
    • View Profile
    • Allison Fleischer
Re: thatsridiculous.wav
« Reply #52 on: 13 Sep 2014, 20:27 (8 years and 0 months ago) »
I've been messing around with internal scripting in 2.2. The maximum number of lines in a "block" [say(x)] aren't unlimited; the maximum is 50.
why is there a maximum anyway

Info Teddy

  • Ultra Captain
  • ********
  • Posts: 3138
    • View Profile
waitwhat.wav
« Reply #53 on: 13 Sep 2014, 21:05 (8 years and 0 months ago) »
is it because i stole your eye pee

Demonic Starlow

  • Banned
  • Professor
  • ****
  • Posts: 167
  • RUN, WHILE YOU STILL HAVE TIME...
    • View Profile
    • connection lost
Re: Internal commands
« Reply #54 on: 10 Feb 2015, 04:08 (7 years and 7 months ago) »
Sorry for the bump, but I have something relevant to add to the list of gamestates:
3500 - Pause for a minute, continue to state 3501
3501 - Game Complete, continue to state 3502
3502-3507 just show stats

Info Teddy

  • Ultra Captain
  • ********
  • Posts: 3138
    • View Profile
Probably all.
« Reply #55 on: 30 Mar 2015, 21:32 (7 years and 6 months ago) »
Sorry for the bump, but I have something relevant to add to the list of gamestates:
3500 - Pause for a minute, continue to state 3501
3501 - Game Complete, continue to state 3502
3502-3507 just show stats
Are these for v2.0, v2.1, or v2.2?

Ally 🌠

  • tOLP Contributor
  • Hyper Captain
  • *******
  • Posts: 1354
  • <3
    • View Profile
    • Ally 🌠
Re: Probably all.
« Reply #56 on: 15 Aug 2015, 12:06 (7 years and 1 month ago) »
Sorry for the bump, but I have something relevant to add to the list of gamestates:
3500 - Pause for a minute, continue to state 3501
3501 - Game Complete, continue to state 3502
3502-3507 just show stats
Are these for v2.0, v2.1, or v2.2?
Hmm, I might look. but really last post in march? (SHIT, I DIDN'T KNOW I BUMPED THIS)
EDIT: Yes they do in fact work!!!
« Last Edit: 31 Aug 2015, 10:12 by Luigi master »

Info Teddy

  • Ultra Captain
  • ********
  • Posts: 3138
    • View Profile
Because you didn't say which version works.
« Reply #57 on: 19 Aug 2015, 20:07 (7 years and 1 month ago) »
Hmm, I might look. but really last post in march?
EDIT: Yes they do in fact work!!!
Do they work in v2.0, v2.1, or v2.2?

som1sezhi

  • tOLP Contributor
  • Doctor
  • ***
  • Posts: 52
  • lurks the forums 22/7
    • View Profile
Re: Internal commands
« Reply #58 on: 20 Aug 2015, 10:47 (7 years and 1 month ago) »
works in 2.2 make & play, although "press ACTION to continue" doesn't seem to work
also, the default hardest room is Welcome Aboard, even if you don't have a room named that

Info Teddy

  • Ultra Captain
  • ********
  • Posts: 3138
    • View Profile
Guess that makes one thing where Java is better than C++.
« Reply #59 on: 20 Aug 2015, 17:42 (7 years and 1 month ago) »
works in 2.2 make & play, although "press ACTION to continue" doesn't seem to work
also, the default hardest room is Welcome Aboard, even if you don't have a room named that
Oh, that's interesting. I always thought that the default room would be the first room that you started in, but apparently you shouldn't have intuitive logic when programming games in C++.