RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Glow in the Dark Sprites

0 Members and 1 Guest are viewing this topic.

*****
Rep:
Level 84
This text is way too personal.
Bronze - GIAW 11 (Hard)Silver - GIAW Halloween
Glow in the Dark Sprites
Version: 1.0
Author: cozziekuns
Date: August 1st, 2010

Version History


  • <Version 1.0> 08.01.2010 - Original Release

Planned Future Versions

  • None. Suggest something.

Description


This script allows for sprites that change their tone depending on the screen tone. Essentially for making glow-in-the-dark sprites, however has a smoother transition from Dark to Bright than other light effect scripts.

Features

  • Sprite tone relative to the screen tone.

Screenshots



Ignore the sloppy HUD.

Instructions

See header.

Script


Code: [Select]
#===============================================================================

# Cozziekuns Glow in the Dark Sprites
# Last Date Updated: 08/01/2010
#
# This script allows for sprites that change their tone depending on the screen
# tone. Essentially for making Glow in the Dark Sprites, which is tortologius to
# the title.
#
#===============================================================================
# Updates
# -----------------------------------------------------------------------------
# o 08/01/10 - Created Script.
#===============================================================================
# What's to come?
# -----------------------------------------------------------------------------
# o Nothing! Suggest something.
#===============================================================================
# Instructions
# -----------------------------------------------------------------------------
# To install this script, open up your script editor and copy/paste this script
# to an open slot below ? Materials but above ? Main. Remember to save.
#
# To make a sprite glow in the dark, just add this comment to an event:
#
# \glow_in_the_dark (CaSe InSenSitIve)
#
# The lag this script will induce depends on the amount you set for your frames.
# The higher the number, the less laggy the script. Each frame lasts for 1/60th
# of as second, so the default (15 frames) refreshes each 1/4 of a second.
# 0 frames would mean that the sprite never refreshes.
#===============================================================================

$imported = {} if $imported == nil
$imported["CozGlowInTheDarkSprites"] = true

module COZZIEKUNS
  module BOKTAI
    module GINDS
      FRAMES = 15 # Amount of frames waited before refreshing the sprites tone.
    end
  end
end

#==============================================================================
# ** Game_Character
#------------------------------------------------------------------------------
#  This class deals with characters. It's used as a superclass of the
# Game_Player and Game_Event classes.
#==============================================================================

class Game_Character
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :glow_in_the_dark
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  alias coz_ginds_gc_initialize initialize
  def initialize
    coz_ginds_gc_initialize
    @glow_in_the_dark = false
  end
end
#==============================================================================
# ** Game_Event
#------------------------------------------------------------------------------
#  This class deals with events. It handles functions including event page
# switching via condition determinants, and running parallel process events.
# It's used within the Game_Map class.
#==============================================================================

class Game_Event < Game_Character
  #--------------------------------------------------------------------------
  # * Setup
  #--------------------------------------------------------------------------
  alias coz_ginds_ge_setup setup
  def setup(new_page)
    coz_ginds_ge_setup(new_page)
    unless @page == nil
      i = 0
      comment = ''
      while [108].include?(@page.list[i].code)
        comment += @page.list[i].parameters[0]
        i += 1
      end
      if comment[/\\GLOW_IN_THE_DARK/i] != nil
        @glow_in_the_dark = true
      end
    end
  end
end

#==============================================================================
# ** Sprite_Character
#------------------------------------------------------------------------------
#  This sprite is used to display characters. It observes a instance of the
# Game_Character class and automatically changes sprite conditions.
#==============================================================================

class Sprite_Character < Sprite_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     viewport  : viewport
  #     character : character (Game_Character)
  #--------------------------------------------------------------------------
  alias coz_ginds_sc_initialize initialize
  def initialize(viewport, character = nil)
    @frames = 0
    coz_ginds_sc_initialize(viewport, character)
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  alias coz_boktai_gs_sc_update update
  def update
    coz_boktai_gs_sc_update
    if @character.glow_in_the_dark and @frames == COZZIEKUNS::BOKTAI::GINDS::FRAMES
      self.tone.red = $game_map.screen.tone.red < 0 ? 0 - $game_map.screen.tone.red : 0
      self.tone.blue = $game_map.screen.tone.blue < 0 ? 0 - $game_map.screen.tone.blue : 0
      self.tone.green = $game_map.screen.tone.green < 0 ? 0 - $game_map.screen.tone.green : 0
      @frames = 0
    end
    @frames += 1
  end
end

Credit


  • cozziekuns

Thanks

  • Boktai, great game.

Support


Just post down below.

Known Compatibility Issues

Can't say right now.

Author's Notes


Pinch and a punch for the first day of the month.

Restrictions

:ccby:

**
Rep: +0/-0Level 76
So ace
Cool, I always wondered why no-one made this :D Great for time scripts and fires, lamps, ghost, and why not the runes on a giant obelisk?

***
Rep:
Level 89
Nice one. I see this for a lanterns! :)
Regards,
Mike

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Looks good cozzie!