Function that returns true if player "action-button-ed" the event

Ricksoaz

Villager
Member
Joined
Aug 6, 2016
Messages
11
Reaction score
0
Primarily Uses
I just want to use a conditional branch inside a parallel event. Something like if (hasBeenTriggered()). I'm aware that whatever I'm trying to do, could be achieved by other/easier means but I think I might have use for this in the future. Also, I'm trying to learn how the trigger flow works (I tried looking into the "call stack" of a trigger action but I kinda got lost. I guess it's still too complex for me).
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,430
Reaction score
7,711
First Language
German
Primarily Uses
RMMV
I think you should better explain what you want.


There is a very easy non-script way to handle this (control self-switch on at the event, add more self-switches by plugin if neccessary), but to access the input buffer or the game loop directly can have a lot of unexpected side-effects and make bughunting a lot more problematical.


And even if you need it inside a script/plugin, it would be easier to add a function "mark variable XY" to the execution of an event or function than to watch for the trigger itself.


So unless there is something extremely special that needs this, I would really advice agains such a function.
 

Rivingtondown

Villager
Member
Joined
Mar 14, 2016
Messages
13
Reaction score
4
Primarily Uses
Like you said, there are easy ways to do this - you really don't even need to resort to custom javascript.


What I usually do is have a variable reserved for self switches like this. The parallel only runs with the variable is set to a number > 1 or even sets a said variable to 1 itself. Then wrap the button-down event in a variable conditional - shutting it off in that same button down condition so it doesn't treat it as being held continuously.
 
Last edited by a moderator:

Ricksoaz

Villager
Member
Joined
Aug 6, 2016
Messages
11
Reaction score
0
Primarily Uses
I kinda expected it to be convoluted, honestly. But I have already achieved what I want already, with self-switches like you mentioned (going back and forth between paralled page and action button page), I just had to know how that stuff worked internally. I'm glad you mentioned that messing with the game loop isn't good, I think I should give up on this.
 

Ricksoaz

Villager
Member
Joined
Aug 6, 2016
Messages
11
Reaction score
0
Primarily Uses
My goal at first was making npcs, but I've decided to try and make a master event instead of a single event with parallel(for moving) + button trigger(for talking). It all went well until I needed to use moveroutes for specific small movements. I could use the ingame move route menu but that's not really friendly when you have to manage a LOT of moveroutes at the same time so this time I kinda need a script.


Let's say I want this event to do "moveStraight twice to the left, setDirection up, wait 120 frames and moveStraight twice to the right": I tried using setWaitMode('route') but it doesn't work so I'm missing something else. For example, is there a function to check if moveStraight has been sucessful?


EDIT: Actually, I just figured it myself by looking inside the this._eventData.pages[0].moveRoute object. What I did next is copy the object and use it in the function this.forceMoveRoute(object) and yay, the npc moved! Now I just need to learn all the commands. Is this way ok, or is there a better one?
 
Last edited by a moderator:

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

Latest Threads

Latest Posts

Latest Profile Posts

He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!

Forum statistics

Threads
106,036
Messages
1,018,461
Members
137,821
Latest member
Capterson
Top