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.
[VXA] [resolved] Help Req : Events relocating on map change

0 Members and 1 Guest are viewing this topic.

**
Rep:
Level 58
in training
This is probably best explained by example; say you have a treasure map or something that requires the player to move to an X on the map and interact.

Say I have Event A located at (005, 005). It's a picture of an X.
When you interact with Event A it says "go down 5 spaces", turns invisible and moves to location (005, 010).
When you interact with it again it says "move right five spaces", moves to location (010, 010).
When you interact with it again it reveals a treasure chest or something.

Obviously, as the event is invisible, it's essential the player move to the right spot to interact and get the next set of instructions.

My problem is that, whenever you change maps, the event goes back to (005, 005). It doesn't matter what stage of the process you are up to so, theoretically, you could find the chest at (010,010), leave the screen, come back and the open chest would be at (005,005). More importantly, if you were following the instructions, you would lose the point of reference. So, say you did step 1. You then left the screen and came back. You'd expect to continue at (005,010) however the invisible event would now be at (005,005).

I did a bit of searching but came up blank. Probably just not using the right search terms as I'm sure someone must have raised this before.

Can anyone help?
« Last Edit: June 11, 2013, 10:40:02 PM by Chickan117 »

*
Rep:
Level 85
I solve practical problems.
For taking arms in the name of your breakfast.
Use an actual variable to switch between what I assume are event pages instead of a self switch, that way when you change maps and return the event will be in the correct location.

Just name a variable and increment it by one at the end of each interaction. :D

***
Rep:
Level 72
The cloaked schemer
Most Promising Project 2014
Although you are right about self switches, I don't think changing to a variable would work. Events automatically go to their original position no matter what page they're on. You either have to make 3 seperate events and use a variable to keep track of them, or make the one event, and another that checks a variable. If the variable is 1 have it teleport to the first spot and if it's 2 then the second spot. That's really the only two ways you can go about it.

**
Rep:
Level 58
in training
Damn. That's a shame. I had a further play last night and got it to work by creating separate events for each. So you interact with event 1, it moves to event 2 then a self switch makes it invisible/puts it under the player (or erases but I've had mixed experience with that). It also uses a script to turn on event 2 which has a starting position where event 1 was meant to move to. Rinse and repeat.

It works but I was kinda hoping that there'd be a better way to do it.

Thanks again though. Appreciate the answers.

****
Rep:
Level 84
3...2...1...
What you need to do is make the even that you're interacting with use two variables (position X, and position Y). When you interact with it, and it moves, make it update those two variables.

For example, when you interact with it at (005,005) it moves to (005,010), then update the variables. That way you can always trace where it's at with them.

Then make a separate even in the corner or something that will change the location of the event you need to interact with to the position based on the variables and have it erase itself (the even needs to be set to parallel process).

What that does, is sets the postion of the event every time it moves, and then when you enter the map will warp it to it's last known position without disrupting anything.

Did that make sense? If not, maybe I could throw together a small demo or something to show you.

*
Rep:
Level 85
I solve practical problems.
For taking arms in the name of your breakfast.
Although you are right about self switches, I don't think changing to a variable would work. Events automatically go to their original position no matter what page they're on. You either have to make 3 seperate events and use a variable to keep track of them, or make the one event, and another that checks a variable. If the variable is 1 have it teleport to the first spot and if it's 2 then the second spot. That's really the only two ways you can go about it.

You are correct, its been far too long since I've opened up the editor. With that being said I've attached a solution to the problem using two events, I'm a little rusty so it might not be pretty, the ruins above the start point can be entered to demonstrate it working while leaving the map, enjoy :3

Variable Test.exe

EDIT- I think countdown mentioned what I just uploaded
EDIT 2- Looked at the demo again, found an error, fixed it
« Last Edit: June 01, 2013, 02:37:54 PM by Captain America »

****
Rep:
Level 84
3...2...1...
I haven't taken a look at your demo, but I'm certain we're on the same page here. Excellent work.

**
Rep:
Level 58
in training
Sorry for the delayed response (email notification was playing up) and thank you for the answers/demo.

That seems like a very efficient solution however I'm concerned about having dedicated parallel events continually running to relocate objects. My method uses 3-4 events though so I'm not sure how that will affect the game either.

Anyone know the performance effects of having parallel processes running constantly? The game's jerky at full screen as it is so I'm concerned about adding to that :(

****
Rep:
Level 84
3...2...1...
If you're running a decent computer, it won't affect anything. I run my game with several parallel process events running 24/7 and the framerate doesn't even hiccup.

*
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 Most Mature Member2010 Favourite Staff Member
Sorry for the delayed response (email notification was playing up) and thank you for the answers/demo.

That seems like a very efficient solution however I'm concerned about having dedicated parallel events continually running to relocate objects. My method uses 3-4 events though so I'm not sure how that will affect the game either.

Anyone know the performance effects of having parallel processes running constantly? The game's jerky at full screen as it is so I'm concerned about adding to that :(

Well, the parallel processes described only run once upon entering the map, so there should not be any continuing lag. There is no need to be continually relocating the events. Just erase the event after it does it once.

As for your general lag, anti-lag scripts are usually good for that. Also, to reduce the lag from parallel processes, it is usually the case that most parallel processes do not need to run every frame (there are 60 frames in a second). As such, a Wait event command of a few frames at the end of the event will help reduce lag and usually won't affect anything major.

**
Rep:
Level 58
in training
Thanks for the advice. I've been meaning to check out an anti-lag script as my framerate is pretty choppy. I have a powerful PC and not many events running so was a little disappointed. Can't even run it in full screen :(

Edit : I should clarify. The gameplay looks choppy but the framerate is sitting around the mid to high 50s (hadn't realised you could press F2 to view that in the header).
« Last Edit: June 18, 2013, 11:29:48 PM by Chickan117 »