bvlgari

Veteran
Veteran
Joined
Jan 14, 2018
Messages
34
Reaction score
5
First Language
english
Primarily Uses
RMMV
What i need, as the title says, is the name of the current common event that is being executed. The scriptcall has to be done inside the common event, the result is going to be saved into a variable.

Thanks!
 

bvlgari

Veteran
Veteran
Joined
Jan 14, 2018
Messages
34
Reaction score
5
First Language
english
Primarily Uses
RMMV
Solved by myself. Can be closed.
 

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,762
Reaction score
609
First Language
German
Primarily Uses
RMMV
How did you solve it? Iam just curious.
 

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
3,009
Reaction score
2,302
First Language
Portuguese - Br
Primarily Uses
RMMZ
How did you solve it? Iam just curious.
There is a couple of ways.
If you have the common event Id, you can just do the:
$dataCommonEvents[ID].name

If you do not have the ID, meaning that somehow you are executing common events dynamically, you can find the id using the common event list. But that example will only work if you execute the script call in that common event context:

JavaScript:
for(let i = 1; i < $dataCommonEvents.length; i++){
    const commonEvent = $dataCommonEvents[i]
    const commandList = commonEvent.list

    if(commandList === this._list){
        const commonEventId = i
        const commonEventName = commonEvent.name
        break
    }
}
 
  • Love
Reactions: Bex

Latest Threads

Latest Posts

Latest Profile Posts

Tried something. Little sneak peak of Unity AD.
M42S7Us.gif

It's the little things. Lengthened the time the bar fades in and out to be a bit more comfortable.
3 days until release!

Forum statistics

Threads
125,735
Messages
1,173,108
Members
164,880
Latest member
Tatrunglinh271
Top