Problem with script calls [Solved]

● ARCHIVED · READ-ONLY
Started by zzTop 3 posts View original ↗
  1. =================================================================================================================================================================

    SOLVED!!!: I found a little program that lets me resize windows in... windows. So I could resize the script call window and not deal with the line break. I'm going to leave this up, unless a moderator wants to take it down, so that people can see my solved issue. The program can be found here and instructions on how to use it are in the zip folder that gets downloaded.

    =================================================================================================================================================================

    Hi. I'm using the script call equivalents of event commands to be able to do what I'm doing. In particular I'm using the show pictures one 

    screen.pictures[index].show(file_name, position, x, y, x zoom, y zoom, opacity, blend type)I'm trying to use a game variable as the index as I am generating 16 x 16 tiles on the screen to cover it on a 640 x 480 resolution which would be 1200 tiles. So I am doing a loop with game variable #4 being a tile count that adds one every time it loops.

    screen.pictures[$game_variables[4]].show("Water", 0, 0, 0, 100, 100, 255, 0)As far as I know, that should work. But the script call box is so small that it line breaks after .show so it looks like this.

    screen.pictures[$game_variables[4]].show("Water", 0, 0, 0, 100, 100, 255, 0)Here is a screenshot of what it looks like in the editor.

    EiM4QAG.png

    And because of that, I get this error when the event runs.

    u1Dl6eT.png

    And I know the line break is an issue because when I replace $game_variables[4] with say 1 with the line break still there so it looks like this.

    screen.pictures[1].show("Water", 0, 0, 0, 100, 100, 255, 0)I get the exact same error. So because the window is so tiny, it causes a line break and I get an error. Any help would be appreciated.

    NOTE: I know the event is incomplete and it will only show the water tile on the one spot. That will need more game variables which means more line breaks. I'm just trying to get past this problem I'm having before continuing on.
  2. It seems you're using an older version of the engine. If you redownload/reinstall, your script window will be much wider and you won't have this issue.


    In addition, if you DO need to wrap the commands, it's RARELY a good idea to let it wrap by default - it almost ALWAYS puts the line break in the wrong spot. Instead, put your line break after a character that makes it obvious that there's more to come ... all of these (and more) indicate something is still to come:


    + / - * ( [


    In your example it's getting to .show and thinking that's the end of the command. It doesn't KNOW that there are arguments to come and that the next line is actually meant to be tacked on to the end. Making sure your line ends with one of the characters above would solve the issue (so putting the ( on the first line, then starting the next line with "Water" would solve your problem).
  3. Shaz said:
    It seems you're using an older version of the engine. If you redownload/reinstall, your script window will be much wider and you won't have this issue.

    In addition, if you DO need to wrap the commands, it's RARELY a good idea to let it wrap by default - it almost ALWAYS puts the line break in the wrong spot. Instead, put your line break after a character that makes it obvious that there's more to come ... all of these (and more) indicate something is still to come:

    + / - * ( [

    In your example it's getting to .show and thinking that's the end of the command. It doesn't KNOW that there are arguments to come and that the next line is actually meant to be tacked on to the end. Making sure your line ends with one of the characters above would solve the issue (so putting the ( on the first line, then starting the next line with "Water" would solve your problem).
    Oh! Well... Would you look at that. It's so much bigger. I actually had no idea it was updated. Thank you very much for enlightening me. I'm still going to be using the resizer program though. It's very nifty.