• Add Review
  • Subscribe
  • Nominate
  • Submit Media
  • RSS

Caterpillars are like Day and Night

  • kentona
  • 04/16/2010 10:37 PM
  • 3204 views
So I have added two basic features to my game because I plan on making use of them.

Handy Game Design Tip!
Do not just add scripts or features willy-nilly just because "it'd be cool!". That's poor game design. Features should contribute positively to the game and be justified in their inclusion, otherwise they are just so much fluff (and have the potential to detract from the experience). For example, do not just add a Day/Night system because it's the in-thing to do. Add a Day/Night system because it will affect and improve gameplay (perhaps by incorporating the feature into quests).


STEP 6 ::..
Caterpillar script

Max McGee's game To Arms! contains the World's Most Epic Caterpillar implementation, thus when I was going ahead with the feature I approached him and asked him how he achieved it (hint: it was with a script).

Dear fucking LORD!


DOWNLOAD: http://rpgmaker.net/users/kentona/locker/woratana_caterpillar.txt

I copied Woratana's Caterpillar script and pasted it into the Materials section of the script editor of my game. This script should be placed JUST BEFORE ? Main Process.

There are two other customization points with this script (on lines 71 and 75):
1) CATERPILLAR_HIDE_SWITCH
This is the ID of the switch used to toggle the caterpillar ON/OFF. I set it to 10. Turn ON this switch to hide caterpillar actors.

2) CATERPILLAR_MAX_ACTORS
This is the number of actors in the caterpillar. In my game I have 4 playable characters.

And that's all there is to this script! I tested it out quickly and things worked swell.

UPDATE ::..
Healy pointed out that Max ran into a problem with the script and GreatRedSpirit confirmed it. Luckily for us he has also provided a fix!

A PM I sent to Max
Go to Scene_File and around line 244 there should be:

if $game_system.version_id != $data_system.version_id


Add a 'or true' to the end (like so)

if $game_system.version_id != $data_system.version_id or true


As far as I can tell, the caterpillar script requires the game map to run setup before it runs since that's where $game_cateracter's are initialized. Due to that version_id check in Scene_File (I don't know why that's there either, I don't see it change ever except being set to $data_system.version_id, but I don't see that being changed or even initialized! Argh RMVX hides too much shit!) it isn't always setting up the map. This causes $game_cateracter to be uninitialized then the script acts as if it is an array and crashes because it isn't one yet.

The whole thing is annoying but that should fix it up. Let me know if there's any issues.


STEP 7 ::..
Day/Night script

This is a KGC script known as KGC_DayNight (found in the ==Map/Movement System== section).

This script adds the concept of Day-to-Night phase shifting to your game. Thus events can be created that are dependent on the current phase (ie- night), adding a new dimension to your game.

NOTE: Do not add a Day/Night system for the sake of having a Day/Night system.

DOWNLOAD: http://rpgmaker.net/media/content/users/105/locker/KGC_Scripts_Library.exe

There are a lot of customization options here:
1) Suffix
[DN_STOP]
to a map's name to stop the Day-to-Night change (the timer still runs). For example, you'd probably attach this to a town map.

2) Suffix
[DN_VOID]
to a map's name to freeze the Day-to-Night change and reset the tint. For example, you might attach this to a dungeon or cave map.

3) METHOD = 1
0. Time Lapse 1.Time passes with number of steps 2.Real Time

4) PHASE_VARIABLE = 11
This variable holds the current phase. Use it for your events pre-conditions to have events run, say, at night.

5) PASS_DAYS_VARIABLE = 12
The passing days is stored here.

6) STOP_ON_EVENT = false
Stops the Day/Night Timer when an event is run by player. I am considering making this true.

7) BG_TONE_IN_BATTLE = 0
Tinting effect in the battle system. 0: None 1: Only Background 2: Background + Enemies

8) Phases
  PHASE = [

# Name Tint Time Shift
["Noon", Tone.new( 0, 0, 0), 300], # Phase 0
["Evening", Tone.new( -32, -64, -96), 175], # Phase 1
["Night", Tone.new(-128, -128, -32), 200], # Phase 2
["MidNight", Tone.new(-164, -164, -64), 150], # Phase 3
["Daybreak", Tone.new( -64, -64, 32), 200], # Phase 4
["Morning", Tone.new( -32, -48, 16), 75], # Phase 5
]

Now, this is the default setup for the Time Passes With Steps option. I have no use for so many distinct phases in my game (I really only need DAY and NIGHT) so I will be restricting this in the future. Be sure to settle on your phases before creating a ton of phase-dependent events, since the phase number is sequentially determined.

9) PASS_DAY_PHASE = 3
The day counter increments on this phase.

10) PHASE_DURATION = 564
The amount of frames it takes to fade into the next phase (for tinting).

There are also several scripting options for events (remember Page 3 of the Events? Well, this is where you could use that functionality). One method of note is the set_daynight_default(duration. It forces the tint of the current phase to reset to the initial phase. Hypothetically, you could use this at an Inn to reset the day to morning.

But fuck me I can't figure out how to call that method from an event! I keep getting errors.

So it turns out RMVX thinks I am trying to call a method called "set_daynight_default" from a class that does not contain this method (or doesn't exist). Now, I am not sure why that is (my high-level searches found the method) so I will have to investigate further.But in the meantime here is a workaround: http://rpgmaker.net/users/kentona/locker/KGC_DayNightHack.txt

Paste that into its own page and then you'll be able to call set_daynight_default right from events.

Nighttime in Xnyndril



So that's that!

Posts

Pages: 1
Wasn't there an issue that popped up with that caterpillar script in To Arms? Or am I thinking of something entirely different?
Possibly! Do you remember what it was? I haven't ran into a problem yet.
I don't see the point of the Day/Night script. I find having to wait for the day time to do a quest to be just annoying!
LouisCyphre
can't make a bad game if you don't finish any games
4523
comment=27028
I don't see the point of the Day/Night script. I find having to wait for the day time to do a quest to be just annoying!

Do nighttime quests to pass the time.
Caterpillar scripts are like kentona scripts in that they are F*CKIN awesome :D
comment=27024
Possibly! Do you remember what it was? I haven't ran into a problem yet.

Apparently Max was encountering a saved game bug with the script, but Great Red Spirit found a simple fix for it. I wouldn't worry too much about it, now that I think about it.
Healy's right:

A PM I sent to Max
Go to Scene_File and around line 244 there should be:

if $game_system.version_id != $data_system.version_id


Add a 'or true' to the end (like so)

if $game_system.version_id != $data_system.version_id or true


As far as I can tell, the caterpillar script requires the game map to run setup before it runs since that's where $game_cateracter's are initialized. Due to that version_id check in Scene_File (I don't know why that's there either, I don't see it change ever except being set to $data_system.version_id, but I don't see that being changed or even initialized! Argh RMVX hides too much shit!) it isn't always setting up the map. This causes $game_cateracter to be uninitialized then the script acts as if it is an array and crashes because it isn't one yet.

The whole thing is annoying but that should fix it up. Let me know if there's any issues.



(that lich boss is annoying >:( )
Pages: 1