How do you call a Common Event in a script?

Started by Mightylink, October 14, 2008, 07:13:32 pm

Previous topic - Next topic

Mightylink

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.

Blizzard

October 15, 2008, 09:02:24 am #1 Last Edit: October 15, 2008, 09:05:28 am by Blizzard
          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.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Mightylink

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

Blizzard

Nonono, the second part would work even if you had wait commands.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Mightylink

i dont understand, you said the script would ignore wait times?

Blizzard

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.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Mightylink

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

Calintz

So basically, the 1st would be useless, because the second is optimized, right??

Starrodkirby86

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(^_~)

What's osu!? It's a rhythm game. Thought I should have a signature with a working rank. ;P It's now clickable!
Still Aqua's biggest fan (Or am I?).




G_G

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?

Calintz


G_G

Let ne clear it up it restarts my autorun events xD

Calintz

Did you place the def update in the proper place?

G_G

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.