Submit Your Article Guild Wars 2 Forum RPG Maker VX.com
 
RPG Maker
 

 Username:
 Password:
   Not a member? Register!



Home > Tutorials > RPG Maker XP > Time effects in a single (common) event

Time effects in a single (common) event


Ok, this is simple, yet preeeeety long.

I can't work out how to use BBCode, so no screenshots, sorry!

Time Event

(difficulty: Medium)

To start with, you need:
1 common event
1 parallel process event on your starting map
3 switches
1 variable
an open mind

Name the common event 'time'.
Ensure that in the drop down menu, you have selected 'parallel process' as the trigger.
Now, return to the editor and click on your parallel event. Give it one command - control switches, and turn switch 1 on. Name this switch 'Time Activate'. This is important, because without your time activate switch, time is turned off, and time will not pass. Like in LoZ:OoT, when you enter a town, time stands still. you can turn off the switch for that effect.
Return to your common event. Change the condition switch to 'Time Activate'.
Now for the clever bit. Create a loop, and then another loop inside it (so time doesn't stop after day 1).
Inside this loop, create a control variables section, and select the variable you will use. Name this variable 'Time'. Select the add button and type in the constants box '1'.
Then you need a conditional branch. the condition needs to be 'is variable 'Time' =300?'. Under the conditional branch place a break loop event.
In the else section, place a wait event set at 1 frame. The event now will emulate day, but it won't do anything! At the bottom of the loop event, it says repeat above twice. Double click on the BOTTOM one, then select change screen colour tone. Change R,G+B to these amounts:

---------------------------------------------------------
| |
| R -40 |
| G -20 |
| B 0 |
| |
---------------------------------------------------------

This emulates night. Set the time at the bottom to 50 frames.

Yay! We're half done, and here it gets easy! Right Click on the bottom most word 'loop' at the start of the event. Copy this. Right click on the bottom most word 'repeat above' and paste a copy of the script again. Edit these events:

Control Variable: set to sub, not add.
Coditional Branch: Time is at 0, not 300.

Now, at the bottom of this copied event, create another change screen colour tone event, and change the time to 50. click ok, and you should have something that looks like this:

@>loop
@>loop
@>Control Variables: [####: Time]+=1
@>Coditional Branch: Variable: [####: Time]==300
@>Break loop
@>
: Else
@>Wait: 2 Frames
@>
: Branch End
@>
@>Repeat Above
@>Change Screen Colour tone (-40,-20,0,0), @50
@>loop
@>Control Variables: [####: Time]-=1
@>Coditional Branch: Variable: [####: Time]==0
@>Break loop
@>
: Else
@>Wait: 2 Frames
@>
: Branch End
@>
@>Repeat Above
@>Change Screen Colour tone (-40,-20,0,0), @50
@>
@>Repeat above

Ok! you have now drawn a code longbow! =D
No, It actually works.
Let's make use of the other 2 Switches. Place one above the second loop at the top, and call it day, like this.

@>loop
@>Control Switches: [####:Day]=ON
@>loop
...

Place the other after the first Change Screen Colour Tone event,like this.

...
@>Repeat Above
@>Change Screen Colour tone (-40,-20,0,0), @50
@>Control Switches: [####:Night]=ON
@>loop
...

There! It's done. Test the map now. After roughly 10 seconds, the screen dims and it looks like night!

More Fun With the Time Events

Lycanthropy

Difficulty: Medium (Bite Trigger = Hard)

Requires:
2 Actors
2 Common Events
1 switch
Van Helsing, in case something goes terribly wrong
(Bite triggers require 1 lycan enemy, 1 more common event, and 1 more switch)

Ok, set up the first actor as the daytime character, and the other as the Lycan. The only substantial difference is Lycans are usually stronger than humans. I'll call the human human and the lycan lycan. Just keeping things simple.
In the first common event, enter this list:

@>loop
@>Conditional Branch: Switch: [####:Night]==ON
@>Change Party Member: Remove [Human]
@>Change Party Member: Add [Lycan]
@>
: Else
@>
@>Repeat above

In the second, add this:
@>loop
@>Conditional Branch: Switch: [####:Day]==ON
@>Change Party Member: Remove [Lycan]
@>Change Party Member: Add [Human]
@>
: Else
@>
@>Repeat above

Make both Paralell Process events, with the trigger switch 'time activate'.

For the Bite!

First, create your Lycan enemy.

Then create a skill for him to use instead of attack (0 mana loss)
In the screen once it is set up, go into the common event, and set up this:

@>Control switch: [####:Lycan bite]==ON

simple, but required.
Return to the skills screen and select your event on the drop down menu. Select this as the lycan's primary skill, not neccisarily his only.

Now, if he uses it on you in battle, you join the pack and become a lycan overnight!

Watches

Difficulty: Easy

Reqires: 1 common event
1 item

In your common event, write this in a show text event:

The time presently is: \V[(the number assigned to your time variable)].

If you press f2, you can see what it looks like in game.
You will probably need a tutorial explaining the time system. you could alter it so positive numbers are daytime and negative numbers are night.

The watch itself is an item when used it displays the current time. you could also allow it to freeze time when you look at it, but that would cause glitches.

set-up the watch so it isn't consumable, and when used it triggers your common event. A message will pop up telling you the current time.

Clever, huh! I'm not done yet - I have two last things to show you...

Haunted by night

Difficulty - medium

Requires:
1 paralell event
Ghosts

Ghosts only come out at night, right? Here, with this handy event, you can have ghosts appear at night!

In the area, set it so every 30 odd steps you meet a monster.
Create your event, and set it up as paralell process.
In the event, program it so it looks like this:
@>Loop
@>Conditional Branch: Switch: [####:Night]=ON
@>Change Encounter: Enable
@>
: Else
@>
@>Conditional Branch: Switch: [####:Day]==ON
@>Change Encounter: Disable
@>
: Else
@>
@>Repeat above

Using this, you could also set up ghosts that appear on screen at night! Set a second page of the event, and insert a 'Control Self Switch: A' after the encounter enable at night. (I'm not sure, but i think if you tick through and always above on an event, you could get ghosts to walk through walls!)
On your second page, set it up like this:

Graphic: Undead 1 (you can change the hue to give it red eyes)
Opacity: 50-100
Movement: Random
Trigger: Event touch


Battle processing: Ghost*3

Cool, huh? Last thing next... =(

Oh ma gawd! It got dark!
(Civillians who go inside at night)


Difficulty: Medium

Requires:
A civilian.
Preferably with eyes.
3 extra event pages.
a spare self switch.

In the civilian's processing, you can set it up so it goes indoors at night. After the speech is all done, create a new event page and set the condition to 'Night is ON'.

In this event page, you want to set up a set move route command, and guide the stupid civvy into the nearest doorway. When they reach it, in set move route, set their graphic to none. Then turn on self switch A.

In the next event page, turn the condition to self switch A is on. Set the graphic to none. Make it completely unresponsive.

In the final event page, set the condition to 'Day is ON', and Self Switch A is ON. Use the set event location tool to set it to the doorway the civvy went into. Then, use the Set move route command to send him back to his original position.

It's all real clever, hmm? Yeah, Tata for now, when I finish my current project, A Dragon's Tail, (which features this, pun intentional) I'll work on more time events. Until then, goodbye!

Oh, btw, send me feedback if you can, all of it matters ^.^

See You! 
Details
Tutorial: Time effects in a single (common) event
Date Listed: Sun, 24 Aug 2008 07:06:12 -0700
Author: Libelnon
Total Hits: 3523


Embed
Short URL:

HTML:

BB Code:



RPG RPG Revolution
RPG RPG Revolution is your #1 stop for game development and console RPG games, as well as those created by people like you. Link to us to support us, so we may grow to be better website community for you.

RPG RPG Revolution is an Privacy Policy and Legal