Author Topic: Internal Script Help  (Read 6349 times)

shiny k

  • Captain
  • *****
  • Posts: 1553
  • Welcome to the MOTHER3 world
    • View Profile
    • my msuic
Internal Script Help
« on: July 13, 2014, 01:08:08 PM »
Help...?
I made an internal script using the say(-1) method, but all the commands after this:

say(5)
squeak(player)
text(cyan,100,100,1)
Something's wrong!
position(player,above)
speak_active
text(1,0,0,4)


show up in gray text boxes instead of actually being executed. :victoria:
here is the script:

say(-1)
text(1,0,0,4)
say(5)
shake(60)
delay(60)
flash(5)
playef(9)
text(1,0,0,4)
say(5)
shake(50)
delay(50)
flash(5)
everybodysad()
text(1,0,0,4)
say(5)
squeak(player)
text(cyan,100,100,1)
Something's wrong!
position(player,above)
speak_active
text(1,0,0,4)
say(2)
shake(80)
text(1,0,0,4)
say(5)
squeak(gray)
text(gray,100,100,1)
POWER_OVERLOAD
position(center)
speak_active
text(1,0,0,4)
say(4)
createcrewman(50,190,red,0,3)
everybodysad()
changedir(right)
text(1,0,0,4)
say(5)
squeak(red)
text(red,100,100,1)
Nooo!!! Stop it!
position(red,above)
speak_active
text(1,0,0,4)
say(5)
flash(5)
playef(9)
shake(20)
gotoroom(4,19)
text(1,0,0,4)
say(4)
endtext
endcutscene()
loadscript(stop)
text(1,0,0,4)



also "Something's wrong!" is repeated twice.  :victoria:
How does this happen? Please Help.

This is my Banner!
  Trinket! I want it!
« Last Edit: July 15, 2014, 05:46:16 PM by ShinyWolf07 »

Dav999

  • Global Moderator
  • Captain
  • *****
  • Posts: 2173
    • View Profile
    • The Open Level Project
Re: Internal Script Help
« Reply #1 on: July 15, 2014, 02:20:25 AM »
The blocks which start with squeak have a line too many. This is a fixed script:

say(-1)
text(1,0,0,4)
say(5)
shake(60)
delay(60)
flash(5)
playef(9)
text(1,0,0,4)
say(5)
shake(50)
delay(50)
flash(5)
everybodysad()
text(1,0,0,4)
say(2)
squeak(player)
text(1,0,0,4)

say(5)
squeak(player)
text(cyan,100,100,1)
Something's wrong!
position(player,above)
speak_active
text(1,0,0,4)
say(2)
shake(80)
text(1,0,0,4)
say(2)
squeak(gray)
text(1,0,0,4)

say(5)
squeak(gray)
text(gray,100,100,1)
POWER_OVERLOAD
position(center)
speak_active
text(1,0,0,4)
say(4)
createcrewman(50,190,red,0,3)
everybodysad()
changedir(right)
text(1,0,0,4)
say(2)
squeak(red)
text(1,0,0,4)

say(5)
squeak(red)
text(red,100,100,1)
Nooo!!! Stop it!
position(red,above)
speak_active
text(1,0,0,4)
say(5)
flash(5)
playef(9)
shake(20)
gotoroom(4,19)
text(1,0,0,4)
say(4)
endtext
endcutscene()
untilbars()
loadscript(stop)
text(1,0,0,4)

shiny k

  • Captain
  • *****
  • Posts: 1553
  • Welcome to the MOTHER3 world
    • View Profile
    • my msuic
Re: Internal Script Help
« Reply #2 on: July 15, 2014, 07:31:00 AM »
Thank You! 

Works like a charm! 

This is my Banner!
  Trinket! I want it!
« Last Edit: July 15, 2014, 05:45:56 PM by ShinyWolf07 »

FIQ

  • Captain
  • *****
  • Posts: 810
  • https://github.com/FredrIQ/
    • View Profile
    • FIQ
Re: Internal Script Help
« Reply #3 on: July 15, 2014, 08:48:03 AM »
Remember, say(N) (N is between 1 and 5) lets you have that many lines at once, and the last one must be text(1,0,0,4) (except when ending the script with loadscript(stop) or similar), and as Dav said, you had too many (you had 6 instead of 5).

shiny k

  • Captain
  • *****
  • Posts: 1553
  • Welcome to the MOTHER3 world
    • View Profile
    • my msuic
Re: Internal Script Help
« Reply #4 on: July 15, 2014, 06:35:52 PM »
Remember, say(N) (N is between 1 and 5) lets you have that many lines at once, and the last one must be text(1,0,0,4) (except when ending the script with loadscript(stop) or similar), and as Dav said, you had too many (you had 6 instead of 5).

Aahh. Did not know that.    I've been using Internal Commands for a very long time, but I haven't used textboxes yet. 

This is my Banner!
  Trinket! I want it!

shiny k

  • Captain
  • *****
  • Posts: 1553
  • Welcome to the MOTHER3 world
    • View Profile
    • my msuic
Coordinates for gotoposition, createcrewman, etc.
« Reply #5 on: July 17, 2014, 05:15:37 PM »
in gotoposition(x,y,z),
there are coordinates. how do you know EXACTLY Where they are?? ??? :o
HOW??

Sorry for Caps in  EXACTLY & HOW??...


This is my Banner!
  Trinket! I want it!
« Last Edit: July 17, 2014, 06:15:58 PM by ShinyWolf07 »

allison

  • Captain
  • *****
  • Posts: 924
  • monolithic since 2012??
    • View Profile
    • Allison Fleischer
Re: Coordinates for gotoposition, createcrewman, etc.
« Reply #6 on: July 17, 2014, 08:02:40 PM »
in gotoposition(x,y,z),
there are coordinates. how do you know EXACTLY Where they are?? ??? :o

  • Create an alternate version of the level where the start point is where you want to teleport Viridian.
  • Load it up (via "Play a Level", not the editor)
  • Save immediately.
  • Open the [levelname].vvvvvv.vvv file in your "saves" folder with a text editor.
  • The "savex" and "savey" tags are your coordinates.

Dav999

  • Global Moderator
  • Captain
  • *****
  • Posts: 2173
    • View Profile
    • The Open Level Project
Re: Internal Script Help
« Reply #7 on: July 18, 2014, 02:54:21 AM »
That, or you could just try and look where Viridian ends up, then try again with an adjusted position.

shiny k

  • Captain
  • *****
  • Posts: 1553
  • Welcome to the MOTHER3 world
    • View Profile
    • my msuic
Re: Internal Script Help
« Reply #8 on: July 18, 2014, 06:32:55 PM »
in gotoposition(x,y,z),
there are coordinates. how do you know EXACTLY Where they are?? ??? :o

  • Create an alternate version of the level where the start point is where you want to teleport Viridian.
  • Load it up (via "Play a Level", not the editor)
  • Save immediately.
  • Open the [levelname].vvvvvv.vvv file in your "saves" folder with a text editor.
  • The "savex" and "savey" tags are your coordinates.
That, or you could just try and look where Viridian ends up, then try again with an adjusted position.

Wow. Thank you Everyone!
I think I know what to do now!
(I think you can notice that I don't like to use the forum's regular smileys 💧 )

This is my Banner!
  Trinket! I want it!
      Who are you?
« Last Edit: July 18, 2014, 06:59:30 PM by ShinyWolf07 »

Hennal

  • Doctor
  • ***
  • Posts: 93
    • View Profile
Re: Coordinates for gotoposition, createcrewman, etc.
« Reply #9 on: July 28, 2014, 12:02:29 PM »
in gotoposition(x,y,z),
there are coordinates. how do you know EXACTLY Where they are?? ??? :o
HOW??

Sorry for Caps in  EXACTLY & HOW??...


This is my Banner!
  Trinket! I want it!

You can also just count the tiles (1 tile = 8 pixels) up to where you want it and then times the result by 8 and insert it into gotoposition()

shiny k

  • Captain
  • *****
  • Posts: 1553
  • Welcome to the MOTHER3 world
    • View Profile
    • my msuic
More Stuff Screws Up.
« Reply #10 on: August 20, 2014, 05:06:23 PM »



Why
Please help. This part of the script doesn't work at all.

shadow9997.0

  • Crewmate
  • *
  • Posts: 2
    • View Profile
2.2
« Reply #11 on: August 20, 2014, 05:39:20 PM »
Hey guys, I have version 2.0 and I couldn't get 2.1 working, so I stuck with 2.0
I understand that 2.2 is released but I do not want to pay for it.
Is there an free 2.2 download anyone knows of? :(
Much appreciated.

PS: I play on Windows 8.1
« Last Edit: August 20, 2014, 05:42:48 PM by shadow9997.0 »

Dav999

  • Global Moderator
  • Captain
  • *****
  • Posts: 2173
    • View Profile
    • The Open Level Project
Re: More Stuff Screws Up.
« Reply #12 on: August 20, 2014, 06:08:59 PM »



Why
Please help. This part of the script doesn't work at all.

Unfortunately internal text boxes can't be made to work like that. You put three lines of text, then started a new block of internal commands (which overwrites your text in the process), and then you display the text box. Because of the technical restriction of 5 commands per block (including text(1,0,0,4)) that allows for 2.0 compatibility, text boxes in internal scripting can only be up to two lines high (unless you make the level 2.0 incompatible or exit internal scripting mode at that point). Also the fourth argument of the text command is the number of lines the text box has, so if you break 2.0 compatibility or exit internal scripting there, you also need to change that to 3 for your text command.

Also there's a small error in the line containing "changeai(yellow,followposition(-999)", which is not important since that should actually work (the parser appears to consider brackets and commas the same in commands).

Other than that that part of the script looks fine to me

Hey guys, I have version 2.0 and I couldn't get 2.1 working, so I stuck with 2.0
I understand that 2.2 is released but I do not want to pay for it.
Is there an free 2.2 download anyone knows of? :(
Much appreciated.

PS: I play on Windows 8.1

Where did you get v2.0 from?

shiny k

  • Captain
  • *****
  • Posts: 1553
  • Welcome to the MOTHER3 world
    • View Profile
    • my msuic
Re: More Stuff Screws Up.
« Reply #13 on: August 20, 2014, 06:18:39 PM »
unless you make the level 2.0 incompatible
Okay. I think I might do that.

allison

  • Captain
  • *****
  • Posts: 924
  • monolithic since 2012??
    • View Profile
    • Allison Fleischer
Re: 2.2
« Reply #14 on: August 20, 2014, 07:10:08 PM »
Hey guys, I have version 2.0 and I couldn't get 2.1 working, so I stuck with 2.0
I understand that 2.2 is released but I do not want to pay for it.
Is there an free 2.2 download anyone knows of? :(
Much appreciated.

PS: I play on Windows 8.1
There's the Make and Play version, which only supports the custom level system (i.e. you can play and create levels, but can't play the main game)