Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"$this." or "$self." self reference for events. The current way is very counter intuitive even for programmers #188

Open
blurymind opened this issue Oct 4, 2018 · 8 comments

Comments

@blurymind
Copy link

Right now when you use the editor, and you want to access a variable of an event from the event you are editing, the syntax is very counter intuitive and very long. Like this:
$dataMap.events[n].name
Where you have to also know how to get the event's own ID ('n') (I already forgot it)

This is counter intuitive - even for programmers.
When you try:
$this.name
you find out that $this is not even defined. The event has no reference to itself!

Consider having to check an event's own variable from an addon via a conditional branch - only way to do it is by using the 'script' option. The syntax to access variables is a pain in the butt and is easy to forget. Even if you know javascript, you have to dig through forums to find out this very basic thing..

Suggested solution:
Define $this automatically when calling events from the editor, so when using $this.x for example, we can get the event's X , without having to write tons of obscure functions just to get the event to look into its own script values

@blurymind blurymind changed the title "$this." self reference for events. The current way is very counter intuitive even for programmers "$this." or "$self." self reference for events. The current way is very counter intuitive even for programmers Oct 4, 2018
@krmbn0576
Copy link
Collaborator

use this.character(0) ;-)

@blurymind
Copy link
Author

blurymind commented Oct 4, 2018

@krmbn0576 does this.character(0) make the event to refer to itself?
is 0 the event tab's index?

Its still not very intuitive :) who is character 0 ?

Why not this.event..

@krmbn0576
Copy link
Collaborator

krmbn0576 commented Oct 4, 2018

does this.character(0) make the event to refer to itself?

Yes. 0 means itself 😇

@blurymind
Copy link
Author

@krmbn0576 what would 1 mean in this case then? :)

@krmbn0576
Copy link
Collaborator

this.character(1) means the event of Id:1.

0 is special

@blurymind
Copy link
Author

@krmbn0576 the method is hard to discover :)

Rpg maker MV has no official API documentation. There is one incomplete google doc made by the community and even that is hard to find

@krmbn0576
Copy link
Collaborator

Thanks, I'll think about it.

@Inkognitoo
Copy link

https://docs.google.com/spreadsheets/d/1-Oa0cRGpjC8L5JO8vdMwOaYMKO75dtfKDOetnvh7OHs/edit#gid=0

I think you can just take it and make official

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants