Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Where are the event's original info (speed, frq, etc.) stored?

Do you know where the original data (speed, fequency, etc.) of events are stored? When you change speed and such, and then transport to a different map and back again, the speed (and location!) will be reset back to what you gave to the event in the map editor. Do you know how to access this data? Because I want to do the "resetting" of speed, frequency and event location by hand. :) Thank you!

By the way this is for RMXP.
 

Zeriab

Sponsor

You didn't specify the maker, but I'll assume you are talking about RPG Maker XP.

The data you are seeking are stored in the mapXXX.rxdata files in the Data folder. (RPG::Map)
It has an events accessor where you can retrieve a hash mapping eventing ids to there corresponding events.

One Game_Event is created for each RPG::Event in the map. The Game_Event will contain the temporary data that will be gone when you change map.

You can look at RPG::Map and RPG::Event in the help file.


If you are using RPG Maker VX I believe that a similar structure is present and it can be located in the help file as well.

*hugs*
- Zeriab
 
Hi Zab Zab~! *emberrased because I haven't read your script test yet but you come here to post a helpful post* D:

So, I'm not quite sure what to use. I tried using blabla.events~something, but it said undefined method "events". I'm sure you understand what I mean. I used it in a script call. Is it possible that "events" isn't reachable in a script command, or did I just use the wrong prefix for "events"? Could you give me an example? ^.^ Tytyttyy. *hug*

By the way this is for RMXP.
 

Zeriab

Sponsor

No problem Twin ^^

You cannot by default access the RPG::Events directly. At least not through Game_Event.
You can add an accessor to Game_Event which allows you to get the RPG::Event.
I think this snippet will do:

Code:
class Game_Event < Game_Character
  attr_reader :event
end

Now you can retrieve what you want through an Game_Event by using the .event method ^_^

*hugs*
- Zeriab
 
Hmm, I added the reader and then tried this:

p $game_map.event[8].graphic.opacity

and this:

p $game_map.events[8].graphic.opacity

But both times it says "graphic" is undefined. D:

(I'm trying to reset the graphic's opacity back to the map standard, and then store the original x and y in a variable, but I can't find that either. @_@)

Edit: I decided to try and make the x/y storing work first, so I did this:

p $game_map.events[6].x

But it simply gives the current x of the event and not the original. >_<
 

Zeriab

Sponsor

$game_map.events[6] is a Game_Event, if you want the original you have to get the RPG::Event:

Code:
p $game_map.events[6].event.x

This does require the reader.
Notice how you have to use the .event to get the RPG::Event after you get the Game_Event ^^

*hugs*
- Zeriab
 

Zeriab

Sponsor

The opacity depends on which page is in use at the moment. (A quick look in the help file will tell you this. Look under RGSS Reference Manual->Game Library->RPGXP Data Structure)
Each event has an array of RPG::Event::Page.
Each page has a RPG::Event::Page::Condition and a RPG::Event::Page::Graphic.

You need to look at the conditions to determined which page will be the active page. Only then can you look at the graphic of that page and find out what the opacity is.

*hugs*
- Zeriab
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top