Chaos Project

RPG Maker => RPG Maker Scripts => Topic started by: Wingard on May 16, 2014, 07:35:40 am

Title: [solved] [XP] Changing event's graphic tone via ruby command
Post by: Wingard on May 16, 2014, 07:35:40 am
Title. Is there a way of doing so? I got inspired by this thread http://forum.chaos-project.com/index.php/topic,13902.0.html where it can be achieved for map tiles (changing tone, grayscale, etc). But how about individual event's graphic? :D
Title: Re: Changing event's graphic tone via ruby command
Post by: KK20 on May 17, 2014, 12:43:12 am

class Scene_Map
  attr_accessor :spriteset
end
class Spriteset_Map
  attr_accessor :character_sprites
end
class Interpreter
  def event_tone(id, color)
    return if !$scene.is_a?(Scene_Map)
    index = $game_map.events.keys.sort.index(id)
    return if index == nil
    $scene.spriteset.character_sprites[index].tone = color
    return true
  end
end

Usage in script call:

event_tone(3, Tone.new(128, 128, 128, 128))

where the 3 is the event's ID and the tone values are RGB and gray.
Untested like a boss.
Title: Re: Changing event's graphic tone via ruby command
Post by: Blizzard on May 17, 2014, 04:54:56 am
Quote from: KK20 on May 17, 2014, 12:43:12 am
Untested like a boss.


Just wanted to let everyone know that I lol'd on that.
Title: Re: Changing event's graphic tone via ruby command
Post by: PhoenixFire on May 17, 2014, 10:17:22 am
(http://ponyfictionarchive.net/images/gallery/galleries/Macros%20-%20Twilight/twilight%20like%20a%20boss.jpg)
Title: Re: Changing event's graphic tone via ruby command
Post by: Heretic86 on May 17, 2014, 07:02:33 pm
How about Battler Sprites?  Make em Grey for effects like Stone...
Title: Re: Changing event's graphic tone via ruby command
Post by: Wingard on June 05, 2014, 12:15:53 pm
oh my god, i forgot to thank you KK20  D: :shy:

Thanks a milion, works like a dream!  :D