Picture Center Problem

● ARCHIVED · READ-ONLY
Started by HeroofTime123 14 posts View original ↗
  1. I am trying to make a picture appear on screen and I have the picture set to be centered with the player's position on the screen. However, when I erase the picture. the game crashes and says "Script Sprite_Picture' line 54: NoMethodError occurred. Undefined method 'width' for nil:NilClass" I have no idea what this means or why it's doing that. It works fine if the picture is set to appear in the Upper Left, but then I cant make it work right. I included a picture of the event for reference.

    Picture.png

    Erase.png
  2. Please show your erase picture command as well.


    Are both picture commands targeted on the same number? those numbers you assign give the pictures their IDs.


    What could happen is that you accidentially set two different pictures to the same number, and then the second erase picture tries to erase a picture that no longer exists.
  3. The picture ID's are the same; they're both 1. I don't know what else could be happening. Like I said, the whole event works fine if I have it set to Upper Left, so I don't  know what happens when I set it to Center. I added the picture of the other page to the original post.
  4. the problem is the parallel process - all parallel processes repeat indefinitely, which means the second event calls the command to erase the picture sixty times per second...


    And sorry that I didn't see it in the first picture - that also needs to be something different than parallel process, because it's also repeating sixty times per second.


    Please state more in detail what and when you want the picture to appear, then we can tell you how to trigger it in the correct way.
  5. That seems like an old outdated bug. Is your vxace version the latest?
  6. Andar said:
    the problem is the parallel process - all parallel processes repeat indefinitely, which means the second event calls the command to erase the picture sixty times per second...

    And sorry that I didn't see it in the first picture - that also needs to be something different than parallel process, because it's also repeating sixty times per second.

    Please state more in detail what and when you want the picture to appear, then we can tell you how to trigger it in the correct way.
    I want it to be so that the picture appears when the player enters the room. and is erased when the player leaves the room and it also stays centered over the players position in the screen. It's supposed to be a black picture with a transparent center so that the player can only see a little bit in front of them.. I have the switch turning on and off as part of the Transfer event going in and out of the map. I'd show you a picture of that but I'm not at my computer right now. If you need it, let me know.

    Archeia said:
    That seems like an old outdated bug. Is your vxace version the latest?
    I just bought and downloaded VX Ace less than a month ago, This happened even when I had the trial version and the lite version.
  7. What version is your VXace?
  8. HeroofTime123 said:
    I have the switch turning on and off as part of the Transfer event going in and out of the map.
    At the place where you switch off, add a single command to erase the picture. completely remove/delete the event page with the current erase picture command.
  9. Andar said:
    At the place where you switch off, add a single command to erase the picture. completely remove/delete the event page with the current erase picture command.
    That still didn't work. It came up as the same error

    Archeia said:
    What version is your VXace?
    1.02a If I looked in the right spot for that.
  10. Can you make a small demo that emulates this problem?
  11. For some reason in a new project this works fine. It's only in my actual project that it crashes. I've included a demo of the event just in case with the project file. It has the events in the same set up as they are in my actual game.

    Project1.zip
  12. I'm using a script that fixes a picture's position on a map, but that only applies to pictures with [FIXED] in the file name, which the picture I'm using does not have.
  13. If you want to make a dark map with a limited visibility range, drop all the eventing stuff, there are several scripts made to do exactly this.


    I recommend Dekita's "Pokemon 'Flash' Style Lights" for this, or if you want a more serious and realistic looking light effect script, you can try Khas's "Awesome Light Effects" script.


    Both goes well with Dekita's "Character Lanterns" script, which can make a simple lantern graphic in the hand of the character.


    You already use a script, might as well save yourself from unnecessary and troublesome eventing and just get a cool script for it. :p