[solved] [XP] Changing event's graphic tone via ruby command

Started by Wingard, May 16, 2014, 07:35:40 am

Previous topic - Next topic

Wingard

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

KK20


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.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Blizzard

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.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

PhoenixFire

Quote from: Subsonic_Noise on July 01, 2011, 02:42:19 amNext off, how to create a first person shooter using microsoft excel.

Quote from: Zeriab on September 09, 2011, 02:58:58 pm<Remember when computers had turbo buttons?

Heretic86

How about Battler Sprites?  Make em Grey for effects like Stone...
Current Scripts:
Heretic's Moving Platforms

Current Demos:
Collection of Art and 100% Compatible Scripts

(Script Demos are all still available in the Collection link above.  I lost some individual demos due to a server crash.)

Wingard

oh my god, i forgot to thank you KK20  D: :shy:

Thanks a milion, works like a dream!  :D