Call common event via scrip // ORDER?

romepizza

Veteran
Veteran
Joined
Nov 9, 2015
Messages
45
Reaction score
1
First Language
German
Hey,


so I'm having an annoying issue and I'm not sure if it's solvable. I'm using the <Custom React Effect> from Yanfly's Buffs & States Core and inside that I call a common event via "$gameTemp.reserveCommonEvent(52);".


My problem is, that this event always is called right after the whole custom react effect code.


A simple example:


Inside the state:


<Custom React Effect>


console.log("1.");


$gameTemp.reserveCommonEvent(1);


console.log("3.");


<Custom React Effect>


inside common event #1 I'm just making a script call with the following inside:


console.log("2.");


Instead of being "1.  2.  3.", the order in the console pops up as "1.  3.  2.". It seems like the commont event isn't called instantaniously but, as I said, after the whole custom react effect.


Does anyone know how to evade this effect, so that the common event is called right on the spot, or if it's even possible?
 

InBlast

The Mad Hamster
Veteran
Joined
Nov 2, 2015
Messages
287
Reaction score
89
First Language
French
There is maybe a easier way to do it, but you can probably do something like this :


<Custom React Effect>


console.log("1.");


$gameTemp.reserveCommonEvent(1);


while($gameSwitches.value(1) == false) {


sleep(10);


}


console.log("3.");


<Custom React Effect>


And your common event set the switch 1 to ON at its end.
 

romepizza

Veteran
Veteran
Joined
Nov 9, 2015
Messages
45
Reaction score
1
First Language
German
There is maybe a easier way to do it, but you can probably do something like this :


<Custom React Effect>


console.log("1.");


$gameTemp.reserveCommonEvent(1);


while($gameSwitches.value(1) == false) {


sleep(10);


}


console.log("3.");


<Custom React Effect>


And your common event set the switch 1 to ON at its end.


Ok, so I tried it, but i get a syntax-error on the sleep() funktion. It seems to be not defined.
 

InBlast

The Mad Hamster
Veteran
Joined
Nov 2, 2015
Messages
287
Reaction score
89
First Language
French
well, just remove the sleep fonction. It was to avoid free looping.
 

romepizza

Veteran
Veteran
Joined
Nov 9, 2015
Messages
45
Reaction score
1
First Language
German
Tried it out, but it doesn't work. Infiniteloop and the game doesnt respond. Seems like the code of the common event doesn't execute.


Thank you for that suggestion though, now I can most certainly say, that the common event executes after the custom react effect. I guess I'll try to handle it otherwise then.
 

Arcmagik

Game Developer
Veteran
Joined
Sep 27, 2015
Messages
514
Reaction score
675
First Language
English
Primarily Uses
RMMV
I think Himeworks has an Event Queue Stack plugin.  I am on my phone so I can't pull the link right now but you might want to look into that. Don't know if it is exactly compatible or not but it could be a start.
 

romepizza

Veteran
Veteran
Joined
Nov 9, 2015
Messages
45
Reaction score
1
First Language
German
I think Himeworks has an Event Queue Stack plugin.  I am on my phone so I can't pull the link right now but you might want to look into that. Don't know if it is exactly compatible or not but it could be a start.


Ty, I'll take a look on it!


Edit: Doesn't do the job either :(
 
Last edited by a moderator:

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

Latest Threads

Latest Posts

Latest Profile Posts

Frostorm wrote on Featherbrain's profile.
Hey, so what species are your raptors? Any of these?
... so here's my main characters running around inside "Headspace", a place people use as a safe place away from anxious/panic related thinking.
Stream will be live shortly! I will be doing some music tonight! Feel free to drop by!
Made transition effects for going inside or outside using zoom, pixi filter, and a shutter effect
I have gathered enough feedback from a few selected people. But it is still available if you want to sign up https://forums.rpgmakerweb.com/index.php?threads/looking-for-testers-a-closed-tech-demo.130774/

Forum statistics

Threads
105,995
Messages
1,018,212
Members
137,775
Latest member
yj8570
Top