RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[RESOLVED] Picture Location Limitations

0 Members and 1 Guest are viewing this topic.

***
Rep:
Level 87
...I'M HUNGRY! Food plawks
The title is kind of a fancy way of explaining my problem. More simply, I'm trying to add a picture that consists of a circular gradient and creates a "torch" effect, giving the player only a small window of the map.
The problem is that it only stays centered on your sprite as long as you stay away from the edges of the map: as soon as you the edge of your screen touches the edge of the map, the picture stops moving in that direction, and you move out of the circle of "light".

I've been working on this problem with events for awhile now, and I'm getting nowhere. Any ideas?
« Last Edit: June 02, 2007, 07:12:35 PM by Zeriab »

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
You'll need to do a little bit of frigging around to determine the right setting, but if you base picture location on variables then it will work. Specifically, set the variables to the player's screen x and screen y. You will need to subtract a bit from those variables in order to center the picture on the player, but once you figure that out (prolly subtract half the width of the picture from the x and half the height of the picture from the y), you'll be golden.

*
? ? ? ? ? ? ? ? ? The nice kind of alien~
Rep:
Level 92
Martian - Occasionally kind
It would be easier if you just increased the map size and put some impassable stuff around the edges so the player will always stay dead center.

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
That kind of sounds much more annoying <3. I think my way works well. If you put it on center it works even better.

***
Rep:
Level 87
...I'M HUNGRY! Food plawks
Centering it is actually the easy part. You're right, Algebra, I had been using the players X and Y coordinates to determine the picture location. However, this stops working when you approach the edge of the map. So far, Zeriab's solution is all I had been able to think of, and I was hoping there was a better way.

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Don't use Map X and Map Y. Use Screen X and Screen Y

EDIT:
Like this demo:

« Last Edit: June 02, 2007, 04:14:30 AM by Seamus »

***
Rep:
Level 87
...I'M HUNGRY! Food plawks
Thanks Modern Algebra. Once again you have saved me from endless frustration :D