Jump to content
New account registrations are disabed. This website is now an archive. Read more here.
NightmareFelix

Bush opacity?

Recommended Posts

Hey guys! First I want to thank you all for the amount of help you've been for developing my first game. I owe so much to you guys promptly answering my questions.

 

Now, new game, new ideas. I'm trying to create an autotile for standing water, which the character can walk through. I've made my tile, but im using the bush flag to look like you're in the water, however, the character's legs are way too visible. I'm trying to find where in the scripts it specifies just how much to lower the sprite's opacity while on a bush tile but so far to no avail. Anyone knowledgable on this?

Share this post


Link to post
Share on other sites

As I understand it the sprite's lower portion opacity when using bush flags is not processed by RMXP's scripts (as can be read in the script editor), but is a RGSS core feature (from the RGSS####.DLL file). It's a property of the Sprite class, which has no Ruby script to define it, just like you can't find a Ruby script for Bitmaps or Tilemaps. So I'm afraid you have to go with wht you currently have, or ask for someone to write a custom script which would substitute for RMXP's featured bush flag.

Share this post


Link to post
Share on other sites

Then I guess I could figure out a way to just arrange the tile priority to be above the sprite legs but beneath its head. Somehow. Thanks though!

Share this post


Link to post
Share on other sites

Could just change the graphic of characters, though that could become a pain in the ass. A simple script to do it using terrain tags or something as flags could automate it for you, and shouldn't require much more than 20-30 lines of code.

Share this post


Link to post
Share on other sites

What fZero said:

WATER_TERRAIN_TAG = 1
WATER_BUSH_DEPTH  = 24

class Game_Character
 alias :new_bush_depth :bush_depth
 def bush_depth
depth = new_bush_depth
if depth > 0 && self.terrain_tag == WATER_TERRAIN_TAG
  return WATER_BUSH_DEPTH
else
  return depth
end
 end
end

 

Try playing with this, set the "terrain tag" of the water tiles to 1 and set the bush flag.

 

Then you can play the WATER_BUSH_DEPTH value. The larger the number, the more of the character will be "transparent." The standard bush depth is 12. I picked 24 arbitrarily, and it looks alright with the RTP characters.

 

You can change which tag is used, by changing the WATER_TERRAIN_TAG value.

 

Note: This is a very simple + naive approach and could easily be modified to give a whole range of custom bush depths for various terrain tags in probably a more efficient manner, but for what you want, this is the simplest approach I think.

Share this post


Link to post
Share on other sites

Kell, I'm starting to think you created RMXP.

 

Oh, should that just go in its own script?

Edited by NightmareFelix

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...