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] How to track an event's X and Y Co-ordinate

0 Members and 1 Guest are viewing this topic.

*****
Rep:
Level 84
This text is way too personal.
Bronze - GIAW 11 (Hard)Silver - GIAW Halloween
Before we begin, I'd like to stress the fact that I am NOT going to put "Control Variable [0001]: (Events X Co-ordinate)" all over the screen. I've tried, and it was super laggy, and this was on a 17 * 17 map.

So, the question is simple. How can you track a specific event's x and y co-ordinate? Woratana made it look so easy with his mini-map script, but I've tried to replicate it to no avail. Is there any way I could do this?
« Last Edit: April 29, 2010, 12:07:19 AM by cozziekuns »

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Best RPG Maker User (Scripting)2010 Best Use Of Avatar And Signature Space
I can't see why that would be laggy; it's a very simple operation. How many do you have going? In any case, it's the best way to do it for eventing purposes as far as I'm concerned. Unless you are doing it in a script and not an event?

If you are doing something with events and getting lag, then just try to avoid setting the variable or checking it unless you need to, and put in wait frames instead of running the event every frame.

If you tell me what you are trying to do, I can show you a way to do it that would be relatively lagless.

In terms of scripting, the method to retrieve the x or y of an event is just:

Code: [Select]
$game_map.events[event_id].x
$game_map.events[event_id].y
« Last Edit: April 29, 2010, 12:01:10 AM by modern algebra »

********
Resource Artist
Rep:
Level 94
\\\\\
Project of the Month winner for June 2009
Why would you have Variable events "all over the screen" - You need 1 common event to do it. No lag. You did it wrong.

*****
Rep:
Level 84
This text is way too personal.
Bronze - GIAW 11 (Hard)Silver - GIAW Halloween
In terms of scripting, the method to retrieve the x or y of an event is just:
Code: [Select]
$game_map.events[event_id].x
$game_map.events[event_id].y

That works fine. I thought it was $game_map.event :( One s can make a big difference.

And I filled up the whole 17 * 17 map with events. For example, the first event (on coordinate 0,0), I had

Control Variable[0001]: == 0
Control Variable[0002]: == 0

Which proved to be really laggy (or at least on my computer). And Mr. Graf, I'm not much of an event guru... Could you explain how that would work?

Anyways, thanks to both of you.

* RESOLVED *




********
Furry Philosopher
Rep:
Level 94
Rawr?
2013 Best RPG Maker User (Creativity)Gold - GIAW 11 (Hard)Randomizer - GIAW 11Secret Santa 2013 ParticipantFor frequently finding and reporting spam and spam bots2012 Best RPG Maker User (Mapping)2012 Best RPG Maker User (Programming)Secret Santa 2012 ParticipantGold - GIAW 9Project of the Month winner for September 2008For taking a crack at the RMRK Wiki2011 Best RPG Maker User (Programming)2011 Best Veteran2011 Kindest Member2010 Best RPG Maker User (Story)2010 Best RPG Maker User (Technical)
Wow, you definitely don't need to do that. Just one event keeping track of the variables will do the trick for you.




*****
Rep:
Level 84
This text is way too personal.
Bronze - GIAW 11 (Hard)Silver - GIAW Halloween
Wow, you definitely don't need to do that. Just one event keeping track of the variables will do the trick for you.

Lol, like I said, I have no idea how this would work. Oh yeah, I forgot I wanted to track the event's co-ordinates into a variable, if that would make things easier/harder.