Chaos Project

RPG Maker => General Discussion => Troubleshooting / Help => Topic started by: Mightylink on October 14, 2008, 07:13:32 pm

Title: How do you call a Common Event in a script?
Post by: Mightylink on October 14, 2008, 07:13:32 pm
I swear I must of spent 4 hours in google before coming here for help <_<

What I wish to do is run a common event in a script, particularly during the title screen. The reason is I wish to create a more dynamic title screen with pictures panning and fading in the background. I figured this would be much easier done in an event, now I just need to know how to call the event during the title screen.

I searched the help database and all I found was how to create a new event using a script, thats not what I want, I want to call an event that I already made from the Common Event database and run it in the script.
Title: Re: How do you call a Common Event in a script?
Post by: Blizzard on October 15, 2008, 09:02:24 am
          interpreter = Interpreter.new(0, false)
          interpreter.setup($data_common_events[C_ID].list, C_ID)
          interpreter.setup_starting_event
          interpreter.update


Keep in mind that this will execute events without "Wait X frames" commands normally. C_ID is the event of the common event you are calling. If you want it to run in the title screen, you would rather need something like this here.

This code goes into "def main" before the "loop" and "Graphics.transition" part.

          @interpreter = Interpreter.new(0, false)
          @interpreter.setup($data_common_events[C_ID].list, C_ID)
          @interpreter.setup_starting_event


This goes into "def update", best right below the line "def update".

          @interpreter.update


I'm not sure if that will work seemlessly, but you can try it out.
Title: Re: How do you call a Common Event in a script?
Post by: Mightylink on October 15, 2008, 09:27:12 am
dam no wait command, that was very important in the squencing...

ok so i guess i should ask what the scripting command to wait xx seconds is, and i guess im going to have to use multiple events to split the wait times

so the script will be something like this

call common event
wait xx seconds
call common event
wait xx seconds
call common event
loop

i think i just need to know how to wait then i can go about creating the title screen, i saw in your tons of adds an animated title sequence but that would use too much space and power >.< i just want to pan pictures behind other pictures and loop it till the player continues or stats a new game
Title: Re: How do you call a Common Event in a script?
Post by: Blizzard on October 15, 2008, 10:28:48 am
Nonono, the second part would work even if you had wait commands.
Title: Re: How do you call a Common Event in a script?
Post by: Mightylink on October 15, 2008, 11:43:39 am
i dont understand, you said the script would ignore wait times?
Title: Re: How do you call a Common Event in a script?
Post by: Blizzard on October 15, 2008, 11:48:59 am
I was a bit unclear. The first code I posted would not work right with wait commands. That's why I put together an alternative code (2 and 3) which should.
Title: Re: How do you call a Common Event in a script?
Post by: Mightylink on October 15, 2008, 12:03:12 pm
ok thank you very much, i got everything i need now :)

i think i will also find some scripting tutorials to better understand the scripting in rpg maker, i thought i would be fine with just the event system, which is really good but not complete
Title: Re: How do you call a Common Event in a script?
Post by: Calintz on June 03, 2009, 05:24:16 pm
So basically, the 1st would be useless, because the second is optimized, right??
Title: Re: How do you call a Common Event in a script?
Post by: Starrodkirby86 on June 04, 2009, 12:50:47 am
Yeah, since the second version is more optimal, it is recommend to choose that version instead of its old, obsolete one. But that doesn't mean it's all useless though. You can still use it for educational purposes, like all of Blizzard's posts (Even the sexual ones). d(^_~)
Title: Re: How do you call a Common Event in a script?
Post by: G_G on June 11, 2009, 05:06:56 pm
I want to call a common event at the end of a battle. So I tried placing this where the battle ends in Scene_Battle and it starts my autorun events that are on the map all over. Any help anyone?
Title: Re: How do you call a Common Event in a script?
Post by: Calintz on June 11, 2009, 05:42:02 pm
Lol, that's funny!!
Title: Re: How do you call a Common Event in a script?
Post by: G_G on June 11, 2009, 05:46:07 pm
Let ne clear it up it restarts my autorun events xD
Title: Re: How do you call a Common Event in a script?
Post by: Calintz on June 11, 2009, 05:55:20 pm
Did you place the def update in the proper place?
Title: Re: How do you call a Common Event in a script?
Post by: G_G on June 11, 2009, 05:58:51 pm
I didnt place it in the title screen so I didnt need to. I used the first method and I have no idea where to make a common event start at the end of a battle.