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.

Shadow Script V.4

hanmac;209135 said:
cann you make it so: with a value at the mirror part change left and right.
this where a good effect at horror games^^
@rataime: you said that you need that we remind you.
 
simple: if a value is true
and you go left the mirror-chara go right.

understand?

i think this can be a good effect at Horror-Games.
 

ADX

Member

Hi man!
I test out this awesome script. Very well dude!
First of all, sorry about my very "strange" (lol) english.
But...I have an issue...
I'm using also the pixelmovement script (v1.4, I'm sure you know about ;P)

The problem is, that when I move diagonally (like 'up-right'), it crashes.

The error report is:
Error in script Shadows on line 200 of type 'NoMethodError'
undefined method `[]' for nil:nilClass

Any solution?
I think this is because when you are moving diagonally the Shadow script can't handle this out...However, my knowledge about RGSS isn't the best .___.

BIG EDIT
I fixed it!!! (lol I'm getting crazy)
I was right about the problem with 8 directions. To fix that, I completed the array called SHADOWS_DIRECTION_ARRAY.
So, locate...
Code:
SHADOWS_DIRECTION_ARRAY = Array.new
SHADOWS_DIRECTION_ARRAY[2] = [ -3, 4, -2, 1 ]
SHADOWS_DIRECTION_ARRAY[4] = [ 4, -2, 1, -3 ]
SHADOWS_DIRECTION_ARRAY[6] = [ 1, -3, 4, -2 ]
SHADOWS_DIRECTION_ARRAY[8] = [ -2, 1, -3, 4 ]
And overwrite by...
Code:
#EDITED TO WORK PROPERLY WITH PIXEL MOVE
SHADOWS_DIRECTION_ARRAY = Array.new
if (SDK.state('Pixelmovement') == true)
SHADOWS_DIRECTION_ARRAY[1] = [ -3, 4, -2, 1 ] #EDIT
end
SHADOWS_DIRECTION_ARRAY[2] = [ -3, 4, -2, 1 ]
if (SDK.state('Pixelmovement') == true)
SHADOWS_DIRECTION_ARRAY[3] = [ -3, 4, -2, 1 ] #EDIT
end
SHADOWS_DIRECTION_ARRAY[4] = [ 4, -2, 1, -3 ]
if (SDK.state('Pixelmovement') == true)
SHADOWS_DIRECTION_ARRAY[5] = [ 4, -2, 1, -3 ] #EDIT
end
SHADOWS_DIRECTION_ARRAY[6] = [ 1, -3, 4, -2 ]
if (SDK.state('Pixelmovement') == true)
SHADOWS_DIRECTION_ARRAY[7] = [ 1, -3, 4, -2 ] #EDIT
end
SHADOWS_DIRECTION_ARRAY[8] = [ -2, 1, -3, 4 ]
if (SDK.state('Pixelmovement') == true)
SHADOWS_DIRECTION_ARRAY[9] = [ -2, 1, -3, 4 ] #EDIT
end

I'm sure this isn't a permanent and correct solution, but for the moment it works properly with f0tz!baerchen's pixelmovement script.
If anyone can help in this fix, could be great ;)

Thanks!
ADX
 
youhouo! sorry for bringing up this old topic...
1st hey, another french guy, whowho!
Amazing script:
But
Could you make light source have their angle updated if they move, according to the direction the event is facing....
like it add 90*direction(like 0,1,2,3) to the light min and max angle.
so if the light source turns, the shadow disappear is your not in the new "light range".

Arf was quite easy actually :p

Here is my code, which just need to be paste somewhere after the Dynamic Shadows Script.
Code:
SDK.log('MobileLightSource', 'Trebor777', 1.00, '09.11.2007')
if SDK.enabled?('Shadows') and SDK.enabled?('MobileLightSource')
  class Sprite_Shadow
    alias treb_mobile_source_update update
    def update
      if @old_amin.nil? and @old_amax.nil? and @old_dir.nil?
        @old_amin= @anglemin
        @old_amax= @anglemax
        @old_dir = @source.character.direction
      end
      
      case @source.character.direction
        when 2
          @anglemin= @old_amin+270
          @anglemax= @old_amax+270
        when 4
          @anglemin= @old_amin+180
          @anglemax= @old_amax+180
        when 8
          @anglemin= @old_amin+90
          @anglemax= @old_amax+90
        when 6
          @anglemin= @old_amin
          @anglemax= @old_amax
        end
        
      if @old_dir!=@source.character.direction
        @old_dir = @source.character.direction
      end
      @anglemin%=360 ;@anglemax%=360
      treb_mobile_source_update
    end
  end
end
It makes the 0? where the event is facing.^^

Too bad isn't supporting negative angles... but it supports if min>max, so it's ok. (try 315|45 => will work, -45|45, won't).
So now, I can make light torches^^ and make my guard move around:p
 
well I have a map and it includes about 10 or 15 fake streetlights... The only thing is that the main character is able to move far away from any of those and his shadows are still visible... That kind thing looked pretty weird to me. I know I could create another streetlight to disguise these script behaviour a little bit, but...
Oh, another thing. How can I change the amount of shadows displayed on screen? Sometimes I could find about 3 or 4.
 
shadowball;316411 said:
well I have a map and it includes about 10 or 15 fake streetlights... The only thing is that the main character is able to move far away from any of those and his shadows are still visible... That kind thing looked pretty weird to me. I know I could create another streetlight to disguise these script behaviour a little bit, but...

I need to change the distance on the script prompt in order to shorten the distance from the light source the shadow will be displayed.
 
nice script

but when i use big events it only shows a shadow in the middele

so it is a gate horizontal with a vertical shadow can that be fixed

pleas
 
Can we also use all of the other scripts that our in the demo, in our games as long as we give credit for you under "scripter"? (like other scripts I mean The Sun effect and The Destruction Engine...)
 

CJF

Member

This is a wonderful script. Does anyone know where Rataime has gone to? I'm trying to track him down and ask him about using this script commercially. Any help would be great, thanks.
 
Love the scripts they are working quite nicely for me so far.  Just a bit off topic about the mirror script... is there a way to make my other NPCs reflictive as well?  Got a dance school going on (see below) and I want the students to be reflective as well.  I know it said the script is not updated yet so I am eagerly awaiting to see the result of that as well.  Great job! :thumb:
http://media5.dropshots.com/photos/4330 ... 095951.jpg[/img]
 
I have a problem. I use SCRIPT Near's SBABS and the effect only happens in the first character.

How do I fix this?

Thanks  :thumb:
 

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