Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Hero as light source with Rataime's Shadows script.

For part of my game, I want the player to wander through a creepy forest with a lamp.

I've got Rataime's shadows script for XP, but I wonder... is there a way to set the Hero as the source of light? Currently the script only supports events as light sources, see, and I was wondering if anyone could lend me a hand here?

Thanks, much!
 
Sweet. I've made an event which follows the player exactly with the lightsource event, but sometimes the player will cast a shadow when they move. Hopefully yours will work better. :D
 

EOG

Member

OK it's done. Player is a source of light and does not make shadow of himself.

It is based on this script.
There is not any other dynamic shadow script for XP I know so I suppose you use this one.

Plaste Fragment of code under shadow script:
Code:
 

# Player Light - "Addon to Dynamic Light & Shadows v1.5 by Trebor777"

# Made by EOG

#

# This simple scrit makes player as a source of ligt. You can turn off and turn

# on light on dement same way as in normal events.

#

class Spriteset_Map

  def player_as_light 

    light_param = ["0|360|100|0|4"] # here you change the light same way as in for event

    @lights.push( Light.new(@viewport1,$game_player,light_param) )

    for i in $game_map.events.keys.sort    

      shadow_param = SDK.event_comment_input($game_map.events[i], 1, "Shadow")

      next if shadow_param.nil? 

      @shadows.push( Shadow.new(@viewport1,$game_map.events[i], shadow_param, @lights.last) )

    end

  end

end

class Scene_Map

  attr_reader :spriteset

end

class Game_Player < Game_Character

  alias treb_mobile_source_game_event_initialize initialize

  attr_accessor :off, :direction

  def initialize(*args)

    @off = false

    treb_mobile_source_game_event_initialize(*args)

  end

end

 

To initialize light make new event(set Trigger to Autorun):
@> Script: $scene.spriteset.player_as_light
@> Erase Event


If somebody need demo just tell.
 
EOG":3nd4hww5 said:
If somebody need demo just tell.
Yeah please. The version I have of the SDk is newer than the one for that demo. I can't seem to get it all to work...

EDIT: Nevermind. Got the demo from the topic you linked to, and the script in that is incompatable with some of the scripts I already have...
 
Naah, it's from his Dynamic Lights script. Some NoMethodError. I dunno Ruby or RGSS, so I'm not sure what that means. I'll just bear with what I've got, I don't wanna annoy ya. Thanks, though. :D
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top