Mobius's "The Story So Far" Script
The Story So Farby
MobiusXVI
Release Notes
Dec 2013 - v. 1.0 Initial Release
Mar 2023 - v. 1.1 Fixed a bug where it would ask the user if they wanted to watch the story even if it didn't exist
Introduction
The purpose of this script is to allow you to remind the player about what has happened in the story whenever they load their game.I hope you enjoy it!
Features
- Very little scripting needed to make script work, since it uses maps for cutscenes.
- Can have as many or few chapters as you want
- Allows player to skip watching the cutscene and load directly into game (especially useful when reloading a game due to death)
Screenshots
None.
How to Use
- Place this script below the defaults but above main. If you have other scripts that modify saving/loading, put this onebelow them.
- What this script does is check a game variable of your choosing todetermine the current "chapter". Then it loads a map that you specify to let you play out a cutscene of your own design to recap the story. So you'll need to complete the configuration section below to do this.
- You can do whatever you want on the cutscene maps, including going toadditional maps if need be. Whenever you finish with your cutscene, all you have to do is put the following script call in an event and the game will then load and allow the player to keep going:"Mobius_Story_So_Far.finish_cutscene" (without quotes)
- The additional configuration needed is listed in the script under "Configuration"
Demo
http://www.mediafire.com/download/alsku2kn3c2ke0d/Story So Far Demo.zip
Script
Spoiler Code:
#===============================================================================
# The Story So Far
# Author: Mobius XVI
# Version: 1.1
# Date: 02 MAR 2023
#===============================================================================
#
# Introduction:
#
# The purpose of this script is to allow you to remind the player about what
# has happened in the story whenever they load their game.
#
# Instructions:
#
#- Place this script below the defaults but above main. If you have other
# scripts that modify saving/loading, put this one below them.
#- What this script does is check a game variable of your choosing to
# determine the current "chapter". Then it loads a map that you specify to
# let you play out a cutscene of your own design to recap the story.
# So you'll need to complete the configuration section below to do this.
#- You can do whatever you want on the cutscene maps, including going to
# additional maps if need be. Whenever you finish with your cutscene, all
# you have to do is put the following script call in an event and the game
# will then load and allow the player to keep going.
# "Mobius_Story_So_Far.finish_cutscene" (without quotes)
#
# Features:
#
#- Very little scripting needed to make script work, since it uses maps for
# cutscenes.
#- Can have as many or few chapters as you want
#- Allows player to skip watching the cutscene and load directly into game
# (especially useful when reloading a game due to death)
#
# Issues/Bugs/Possible Bugs:
#
# - There may be incompatibility issues with any script that heavily modifies
# the saving/loading of the game. Placing this script below them should
# alleviate most problems
#
#Credits/Thanks:
# - Mobius XVI, author
# - Monkeysnow55, for requesting it
#
#License
# - Copyright 2023 Mobius XVI
# - This script is licensed under the MIT license.
# The full license is availble here:
# https://opensource.org/license/mit/
# Further, if you decide to use this script in a commercial product,
# I'd ask that you let me know via a forum post or a PM. Thanks.
#
#===============================================================================
# CONFIGURATION
#===============================================================================
module Mobius_Story_So_Far
CHAPTER_VARIABLE = 0
# Define the game variable that will be used to determine what chapter
# the player is on.
CUTSCENE_MAPS = [,# Chapter 0
,# Chapter 1
, # Chapter 2
# ...
#, # CHAPTER X
# ...
] # Array end - DON'T DELETE!
# This is an array of arrays. The inner arrays have three entries. The first
# is the Map_ID for whatever map you want to use for the cutscene. The second
# and third entries are for the player's x and y coordinates respectively.
# The inner arrays are all indexed, so whichever one comes first is used
# when the chapter variable is 0, the second array is used when the chapter
# variable is 1, and so on. Make sure all inner arrays are separated by commas
end
#===============================================================================
# ** Story So Far - EDIT BELOW THIS LINE AT OWN RISK
#===============================================================================
class Game_Temp
attr_accessor :cutscene_filename# filename to load after cutscene
end
class Scene_Load
# alias old loading method
alias mobius_ssf_on_decision on_decision
# new loading method
def on_decision(filename)
# If file doesn't exist
unless FileTest.exist?(filename)
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Read save data
file = File.open(filename, "rb")
read_save_data(file)
file.close
# Get chapter info
chapter_variable = Mobius_Story_So_Far::CHAPTER_VARIABLE
chapter = $game_variables
# Get cutscene info
@cutscene_info_array = Mobius_Story_So_Far::CUTSCENE_MAPS
if @cutscene_info_array == nil or @cutscene_info_array.length < 3
# If there's no info, then load the save as normal
# Play load SE
$game_system.se_play($data_system.load_se)
# Load savefile as normal
mobius_ssf_on_decision(filename)
return
end
# If there is a cutscene, ask the player if they want to see it
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Set help text
@help_text = "Do you want to watch the story so far?"
@help_window.set_text(@help_text)
# Create choice window
@choice_window = Window_Command.new(120, ["Yes", "No"])
@choice_window.active = true
# Center choice window
@choice_window.x = 640 / 2 - @choice_window.width / 2
@choice_window.y = 480 / 2 - @choice_window.height / 2
@choice_window.z = 200
# Wait for input
end
# Load into cutscene
def load_into_cutscene(filename)
# Play load SE
$game_system.se_play($data_system.load_se)
# Remeber filename
$game_temp.cutscene_filename = filename
# Set cutscene info
cutscene_map_id = @cutscene_info_array
cutscene_x = @cutscene_info_array
cutscene_y = @cutscene_info_array
# Stop BGM
Audio.bgm_stop
# Load cutscene map
# Set up new map
$game_map.setup(cutscene_map_id)
# Move player to initial position
$game_player.moveto(cutscene_x, cutscene_y)
# Refresh player
$game_player.refresh
# Straighten player
$game_player.straighten
# Run automatic change for BGM and BGS set with map
$game_map.autoplay
# Update map (run parallel process event)
$game_map.update
# Switch to map screen
$scene = Scene_Map.new
end
end
class Scene_File
# alias old update method
alias mobius_ssf_update update
def update
# If choice window is up don't do other updating
if @choice_window != nil and @choice_window.active
# Update command window
@choice_window.update
# If C button was pressed
if Input.trigger?(Input::C)
# Branch by command window cursor position
case @choice_window.index
when 0# Yes
# Load into cutscene
load_into_cutscene(make_filename(@file_index))
when 1# No
# Call old loading method
mobius_ssf_on_decision(make_filename(@file_index))
end
@choice_window.dispose
end
return
else # If no choice window, perform normal updating
mobius_ssf_update
end
end
end
module Mobius_Story_So_Far
def Mobius_Story_So_Far.finish_cutscene
# Prevent Screen Changes
Graphics.freeze
# Recall old filename
filename = $game_temp.cutscene_filename
# Create Load screen
$scene = Scene_Load.new
# Load savefile using original method
$scene.mobius_ssf_on_decision(filename)
end
end
FAQ
None yet.
Credit and Thanks
Special thanks to Monkeysnow55 for requesting this script.
Author's Notes
Copyright 2023 Mobius XVI
This script is licensed under the MIT license
The full license is available here: https://opensource.org/license/mit/
Further, if you decide to use this script in a commercial product, I'd ask that you let me know via a post here or a PM. Thanks.
本贴来自国际rpgmaker官方论坛作者:MobiusXVI处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/mobiuss-the-story-so-far-script.21464/
页:
[1]