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.
Best way to make an event run once, every time the map is loaded?

0 Members and 1 Guest are viewing this topic.

**
Rep: +0/-0Level 82
Hi, first post here, I'm just beginning to get my feet wet with VX.

I have two questions, one simple and one more complex.

Simple question: what's the best way to set up an autorun event on a map so that the event will always run exactly once when the map is loaded, even if the player comes back to that same map again?

I've figured out the set-self-switch deal (where you set an event to autorun, have it change a self-switch to ON at the end of the event, and add a new event page with the condition set for that self-switch as ON) so a given autorun event doesn't loop endlessly.

But, I'd like to have an event run once, every time the player enters that map.  The set-self-switch approach means it runs once, then never runs again on subsequent map loads.

My guess is that I'm missing something really obvious, so I could use a sanity check! :)

Complex question: what's the best way to set up a light/darkness system so that the player needs to use items (torches, lanterns, flaming heads of enemies soaked in pitch and lit ablaze) to see in underground or unlit maps?

I'm slowly noodling this out by myself, and trying to do it properly, so that it still works if I go back and add teleports, portals or rapid travel between maps later on.

What I'm doing now is setting a control-switch for "Light" to ON or OFF in an autorun event for each map, with a tiny bit of branching logic around it.  Should I plunge into a scripted solution, or rely on events like this?

On the other hand, I'm using different tint levels for different maps, so it may make more sense to not bother with switches, and just go with a variable for "ambient light level" and script that to set the tint + light/darkness level for a map.

I'd appreciate any responses, suggestions, or ideas, especially if you've done this sort of thing before or know of an existing solution.

Thanks!

****
Rep:
Level 84
3...2...1...
Answer to simple question:  Use "Erase Event" (I think it's on the second page) at the end of your event.

**
Rep: +0/-0Level 82
Woo!  Just tried that and it works.  Thanks!

****
Rep:
Level 84
Will you join me in the dark side...?
complex question: Well that's simple...Just get a tinted screen to day, and another tint screen to dark. Then make a common event. If player is in MAP ID: Light : Show tint screen light, else,showtint screen dark.
Make an Id to each map, and that will work.

Other way: In the dark maps, so that you would need to use a lantern or something...just make a pararell process event named BLACK sCrEen, and on it do a show picture, and add a full black picture there, so you can't see anything on the map.Then, if you want to use a lantern so that you can see anything, just make an item named lantern, trigger it to a common event, and on the common event, do something like this..show choices:TUrn lantern on/off? If On- Show picture (lantern), a fully black image, but with a circle where your hero is, so he can see something on the map, make it to that when player mooves the picture scrolls with him.Also, before the showing picture option, add a lantern on switch, and.In the black screen event, make a new page, and add the condition if switch lantern is on. And do nothing else. Again in the common event if not- erase picture lantern, and switch lantern off.
That will make you able to turn off/on the lantern when you want. Do that to every map that you want to be needed of a lantern use. You only need to make a paralell process with the black image on each map.The common event will be used tfor all of them. Hope you could understand and be able to do it. Any question just say something in PM or here.!!!
My Puzzle/StandAlone game in a week: