Welcome, Guest. Please login or register.

Author Topic: Internal commands  (Read 32686 times)

nicholashin

  • tOLP Contributor
  • Captain
  • *****
  • Posts: 248
  • (Best?) VVVVVV Player level Critic
    • View Profile
Re: Internal commands
« Reply #40 on: October 3, 2013, 04:34:56 AM »
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: October 4, 2013, 07:27:30 AM by nicholashin »

FIQ

  • Global Moderator
  • Professor
  • *
  • Posts: 132
    • View Profile
    • GitHub profile
Re: Internal commands
« Reply #41 on: October 4, 2013, 06:34:48 AM »
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: May 18, 2014, 02:30:24 PM »
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: May 18, 2014, 02:35:40 PM by FIQ »

Info Teddy

  • Ultra Captain
  • ********
  • Posts: 3141
    • View Profile
a 1yr bump? rly fiq?
« Reply #43 on: May 18, 2014, 06:07:33 PM »
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: May 18, 2014, 06:09:28 PM »
Quote
a 1yr bump? rly fiq?
if it's relevant to the topic and adds something, it's fine.

Info Teddy

  • Ultra Captain
  • ********
  • Posts: 3141
    • View Profile
still,,,,,,,,
« Reply #45 on: May 18, 2014, 06:12:16 PM »
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: May 18, 2014, 09:37:22 PM »
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: 3141
    • View Profile
external level editing.
« Reply #47 on: May 18, 2014, 09:46:14 PM »
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: May 19, 2014, 06:38:26 AM »
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: June 12, 2014, 09:55:10 AM »
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
  • I make video games sometimes
    • View Profile
    • Alek Fleischer
Re: Internal commands
« Reply #50 on: September 13, 2014, 06:26:00 PM »
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: 3141
    • View Profile
thatsridiculous.wav
« Reply #51 on: September 13, 2014, 07:00:13 PM »
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
  • I make video games sometimes
    • View Profile
    • Alek Fleischer
Re: thatsridiculous.wav
« Reply #52 on: September 13, 2014, 08:27:37 PM »
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: 3141
    • View Profile
waitwhat.wav
« Reply #53 on: September 13, 2014, 09:05:01 PM »

Demonic Starlow

  • Banned
  • Professor
  • ****
  • Posts: 167
  • RUN, WHILE YOU STILL HAVE TIME...
    • View Profile
    • connection lost
Re: Internal commands
« Reply #54 on: February 10, 2015, 04:08:29 AM »
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: 3141
    • View Profile
Probably all.
« Reply #55 on: March 30, 2015, 09:32:54 PM »
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: 1353
  • <3
    • View Profile
    • Ally 🌠
Re: Probably all.
« Reply #56 on: August 15, 2015, 12:06:49 PM »
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: August 31, 2015, 10:12:57 AM by Luigi master »

Info Teddy

  • Ultra Captain
  • ********
  • Posts: 3141
    • View Profile
Because you didn't say which version works.
« Reply #57 on: August 19, 2015, 08:07:20 PM »
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: August 20, 2015, 10:47:42 AM »
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: 3141
    • View Profile
Guess that makes one thing where Java is better than C++.
« Reply #59 on: August 20, 2015, 05:42:51 PM »
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++.