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.
How to read event comments?

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
I know that there was some sort of syntax for it, but I couldn't find it in Game_Interpreter and RPG::Event, and I don't really want to search for a script that uses comments (I'm lazy), so what's the proper syntax for reading an event comment?

Thanks in advance.

Insert this scriptlet into your project.

Code: [Select]
class Game_Event
attr_reader :event
end

now:

$game_map.events[id].event.pages[id of page].list[index/position in the events list].parameters[0]
If you need more info just ask

EDIT:

EXPLANATION:

$game_map.events[1]
Accesses the event with the id of 1.

$game_map.events[1].event
Accesses the instance of RPG::Event related to this event

$game_map.events[1].event.pages[0]
the first object in the @pages array which consists of all the event pages of this event. 1 will access the second page while 0 will access the first one.

$game_map.events[1].event.pages[0].list[1]
The @list array contains all the commands on the page. 1 will access the second on the page while 0 will access the first one.

$game_map.events[1].event.pages[1].list[1].parameters[0]
@parameters is an array containing all the values that comes with the command. In case of a comment, the first and only parameter is the text in it.
Just as above, 0 refers to the first object.

« Last Edit: June 21, 2010, 09:57:39 PM by valdred »

*****
Rep:
Level 84
This text is way too personal.
Bronze - GIAW 11 (Hard)Silver - GIAW Halloween
I forgot to say that I'm using VX :P

But that should work all the same. I'll give it a try and tell you if it works.

I added some explanations just for the sake of it.

**
Rep:
Level 82
Do you mean scripts that use event comments to set values, etc, etc.?
If so you need to only search for the specific code for comments. You may also need to look a little into Regular Expressions, depending on what you are using this for.


*****
Rep:
Level 84
This text is way too personal.
Bronze - GIAW 11 (Hard)Silver - GIAW Halloween
Actually, I already read into that tutorial a while ago, but thanks for the input.