Chaos Project

RPG Maker => RPG Maker Scripts => Script Requests => Topic started by: Ravenith on April 07, 2010, 09:35:24 am

Title: [Resolved] Common event on pressing a key
Post by: Ravenith on April 07, 2010, 09:35:24 am
Hello there.
Without further ado. I'd like a script that executes common event X when pressing key Y (preferrably only on the map).
If this requires a custom input script, I'd really appreciate a link too.
Thanks in advance!  :)
Title: Re: Common event on pressing a key
Post by: (Hexamin) on April 07, 2010, 09:44:51 am
...

Parallel Process Event checking for Input::Y
something like this.

Conditional Branch:  If Input.trigger?(Input::Y)
$game_switches[1] = true



Common Event:  Parallel Process: Condition: $game_switches[1]
Do whatever.
Do whatever.
Do whatever.
$game_switches[1] = false


... or am I missing something?  Just type in "Custom Input Script" into the SEARCH that CP conveniently has and you can find that.
Title: Re: Common event on pressing a key
Post by: G_G on April 07, 2010, 08:04:15 pm
Its much simpler then that.

Conditional Branch: A Button is Being Pressed
  Do event here
branch end


No need to make it turn on a switch after button press.
Make sure its in the parallel process of a common event.
Title: Re: Common event on pressing a key
Post by: Ravenith on April 09, 2010, 02:05:43 pm
Thanks guys.
I hoped this would be done with a scriptlet.. I'm kinda psychotic with using parallel process events as little as possible, and this is going in every single map of the project. A parallel process is executed every frame, right?
I guess one wouldn't make a real difference in lag, so I guess I'll do it that way.

Thanks again!
Title: Re: Common event on pressing a key
Post by: Subsonic_Noise on April 09, 2010, 02:14:53 pm
Quote from: Ravenith on April 09, 2010, 02:05:43 pm
Thanks guys.
I hoped this would be done with a scriptlet.. I'm kinda psychotic with using parallel process events as little as possible, and this is going in every single map of the project. A parallel process is executed every frame, right?
I guess one wouldn't make a real difference in lag, so I guess I'll do it that way.

Thanks again!

Before RMXP everything had to be done with events, and the games worked anyways, so one more won't make a difference here, right?
Besides, the script would have been executed just as often as the event, so where is the big difference?
Title: Re: Common event on pressing a key
Post by: Ravenith on April 10, 2010, 01:31:16 pm
Quote from: Subsonic_Noise on April 09, 2010, 02:14:53 pm
Before RMXP everything had to be done with events, and the games worked anyways, so one more won't make a difference here, right?
Besides, the script would have been executed just as often as the event, so where is the big difference?


I'm not too into technical stuff of this kind myself, so I kinda repeat what I hear the most from other users. I guess you're right, no big difference here. Maybe I'll try to work with parallel process a bit more and test some other stuff with it. Thanks!