Darkness Bug

Hello Everyone! I would like to officially announce my joining of the RPG Maker Community. I hope to not only take advantage of the resources available to me, but I would like to in time also give back to the community through whatever talent I can offer. (Not much. Yet.)

To Business!

So I am trying to use eventing (parallel process) to create darkness in an outside environment. If you have ever played Pokemon, then you will know what I am talking about when I say that it is exactly the same as Flash.

Point is: It is supposed to be dark, and only a small area is visible to the player. It currently works perfectly fine, the darkness follows the player. Everything is fine.

Except.

Problem is: I have the darkness, it follows the player, HOWEVER, when I have the main character interact with another event (such as reading a note), the picture that I use to create the darkness circle starts drifting off to the top left.

So here is the Parallel Process event in all it's complicated glory. (Let me know if there is an official way to format posting these into the forums for easy reading)

--------------------------------------

Control Variable: [0016: X-Axis] = Player's Map X

Control Variable: [0017: Y-Axis] = Player's Map Y

Show Picture: 1, 'Darkness2', Center (272,208), (100%, 100%), 200, Normal

Move Picture: 1, Center (Variable [0015][00016]), (100%, 100%), 200, Normal, @ 600

--------------------------------------

If anyone knows how to prevent the image from wandering when I interact with other events, please let me know. It would be greatly appreciated.

Just in case you need some visual aid on what is happening, I have attached a couple images to help.

DarknessIssue2A.png

This is what happens when I try to read some notes on the ground.
 

DarknessIssue1A.png

This is approximately where the image should be. Don't worry if it looks off, I am using an image where I was having other problems I've since fixed.

I've noticed that it is slightly off even without interacting with events, and it may just be a weird load issue. Also could be that I need to increase the size of the image a few pixels. Beyond the 544 x 416 suggestion I've seen on other threads.

DarknessIssue1B.png
Set it to use the player's Screen X/Y rather than their Map X/Y.  Map X/Y is the coordinate position they're currently located on the map.  Screen X/Y is the pixel position they're located on the screen.
Tried it out. Here's the updated code.
 

--------------------------------------

Control Variable: [0016: X-Axis] = Player's Screen X

Control Variable: [0017: Y-Axis] = Player's Screen Y

Show Picture: 1, 'Darkness2', Center (272,208), (100%, 100%), 200, Normal

Move Picture: 1, Center (Variable [0015][00016]), (100%, 100%), 200, Normal, @ 600

--------------------------------------

However, now it moves to the bottom left.

Not sure how to explain that.

Should I have it try and track both the Screen and Map X's and Y's?
Unless you've made a typo in your post (which is why it's always better to take a screenshot of the event and include the WHOLE event window, rather than type out what you're doing), you're also using variables 16 and 17 for the player's coordinates, but 15 and 16 in the move.


Also, why do you have the show AND the move? The move takes 10 seconds, but I'm not sure why (and you don't say if you're making it wait for completion). You can use the variables in the Show Picture command - you don't have to set them to constants and then add a move to make it look at the variables. I'd just do that, and take out the move altogether, because that's what's causing it to drift off.


Have you tested what happens if you walk to the edge of the map? Does the light still follow the player? Is the darkness around it big enough to still cover the rest of the screen? If not, you'll need to make it nearly TWICE the width and height of the screen, with the light area still in the middle.
You know, in retrospect, it does seem like a good idea to simply screenshot the code window. It would save time, and prevent copying mistakes like you pointed out. Yes, I should have made it 15 and 16, rather than 16 and 17.

As for your suggestion on removing the Move command, it has cured the problem. Thanks!

I was referencing from another post made awhile back in these forums (took some digging), and it made mention that I need to not only display the picture, but to have it move in order to prevent it from getting misaligned when you reached the edge of the map.

I added in a buffer zone to the map anyway just as an additional precaution. I am beginning to think that I muddled up a mixture of codes from various posts, rather than sticking to a single solution.

Thanks again! And might I add that this was an incredibly fast response to my programming issue.

Problem Solved! Record time! 22 Minutes
You COULD use the move, but since you're displaying the picture in a parallel process event, which repeats by default, it's going to just keep redisplaying the picture anyway, so the move really has no effect.


This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/darkness-bug.17726/