check eventId from another functions?

Isabella Ava

Veteran
Veteran
Joined
Sep 13, 2016
Messages
635
Reaction score
756
First Language
English
Erm Hi : =)
You see that i try to run a simple function for each Event in the map (RPGMV)
$gameMap.events().forEach(function(event) {
if (event._stb) {
if (event._stb == 1 && event.x == 16 && event.y >= 26) {
$gameMap.event(X)._ccheck = $gameMap.event(X)._ccheck || 0;
$gameMap.event(X)._ccheck = 1;
}}});
But within this function, i need to get eventId of the event that is running this code (assume that i don't know it)
I tried several ways but cannot get eventId of the "host" event
Please help, thank you :=(
 

KanaX

Just being a sleepy
Veteran
Joined
Apr 3, 2013
Messages
1,455
Reaction score
1,297
First Language
Broken English.
Primarily Uses
N/A
There ya go my bud:

The event ID:
Code:
this._eventId
The whole event
Code:
$gameMap.event(this._eventId)
 
Last edited:

Isabella Ava

Veteran
Veteran
Joined
Sep 13, 2016
Messages
635
Reaction score
756
First Language
English
There ya go my bud:

The event ID:
Code:
this._eventId
The whole event
Code:
$gameMap.event(this._eventId)
Hi @KanaX := )
Thank you but when i ran
$gameMap.event(this._eventId)
inside of another function (like my sample code above) it will give 'undefined' error
 

KanaX

Just being a sleepy
Veteran
Joined
Apr 3, 2013
Messages
1,455
Reaction score
1,297
First Language
Broken English.
Primarily Uses
N/A
Where do you run it from?

Edit: I stupidly assumed that you are using script calls, which isn't the case.

try this'n:

Code:
event._eventId
 

KanaX

Just being a sleepy
Veteran
Joined
Apr 3, 2013
Messages
1,455
Reaction score
1,297
First Language
Broken English.
Primarily Uses
N/A
Working out some weird flickering and timing issues but the gist of it is done :) Did it work?
 

Isabella Ava

Veteran
Veteran
Joined
Sep 13, 2016
Messages
635
Reaction score
756
First Language
English
Working out some weird flickering and timing issues but the gist of it is done :) Did it work?
It did not work but i realized that i was asking for an impossible thing : =P
 

KanaX

Just being a sleepy
Veteran
Joined
Apr 3, 2013
Messages
1,455
Reaction score
1,297
First Language
Broken English.
Primarily Uses
N/A
Okay, again, show me where you are using it :p Or tell me what you want to do.
 

Isabella Ava

Veteran
Veteran
Joined
Sep 13, 2016
Messages
635
Reaction score
756
First Language
English
Thanks for your kind @KanaX
however i make it simple by assign the hostId to a global variable like this:
var test = this._eventId;
$gameMap.events().forEach(function(event) {
if (event._stb) {
if (event._stb == 1 && event.x == 16 && event.y >= 26) {
$gameMap.event(test)._ccheck = $gameMap.event(test)._ccheck || 0;
$gameMap.event(test)._ccheck = 1;
}}});
Erm.. so it's is kinda of a curious question only.. : =)
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c

Forum statistics

Threads
105,857
Messages
1,017,018
Members
137,563
Latest member
MinyakaAeon
Top