Jump to content
New account registrations are disabed. This website is now an archive. Read more here.
  • 0
Sign in to follow this  
Elvshire

Quick Scripting Problem with an amazing CASH PRIZE

Question

So I've recently begun working in RMXP on a small project with a friend and I've been struggling to start learning how to use the scripting system to allow for greater customization. I'm currently using the Atoa CBS with the Chrono Trigger addon and I've come to a point of real difficulty for me, though I'm sure for anyone with a shred of scripting knowledge will laugh at the simplicity of my problem. What I'm trying to do is display an image onscreen whenever the item window is shown in combat. The idea is to simply reduce the opacity of the default item box until it is invisible and use the displayed image file as the new background. If someone could show me how to write a couple of lines to display the image and where to place them in what I assume will be Window_Item, it would be a HUGE help to me.

 

Thanks in advance.

 

Oh yeah, CASH PRIZES

If anyone can help me get this going I will paypal them $5. Not much, but hey, more then you're getting in other threads smile.png

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

I never laugh at the simplicity of ANYONE's problems. We all gotta start somewhere don't we? (besides, you're already half way there!) :D

 

Anyways, I'll tell you how to do this. But I require ONE SINGLE CONDITION.....and that is you don't give me money.

 

So, first off, this won't be the most efficient way to solve this...however, it will be the simplest, and it will be easiest to implement.

Now, I can't promise this will work right away -- it will depend on whether/how any other scripts you have might affect the Window_Item class.

 

Anyways, try this on for size (add below all other scripts):

class Window_Item < Window_Selectable
 # =========================
 # Image Name Configuration
 # =========================
 BG_IMG = "filename"  # Set to the name of picture, in pictures folder

 alias :new_init_bg :initialize unless method_defined? :new_init_bg

 def initialize
   new_init_bg
   if $game_temp.in_battle
       @background_sprite = Sprite.new
       @background_sprite.bitmap = RPG::Cache.picture(BG_IMG)
       @background_sprite.x, @background_sprite.y = self.x, self.y
       self.opacity = 0
   end
 end

 # Just in case the window gets repositioned
 # these methods will trigger the background image 
 # to move with it
 def x=(x)
   super
   if @background_sprite
     @background_sprite.x = x
   end
 end

 def y=(y)
   super
   if @background_sprite
     @background_sprite.y = y
   end
 end

 # Dispose background when window is disposed
 def dispose
   super
   if @background_sprite
     @background_sprite.dispose
   end
 end
end

 

Just change BG_IMG = "filename" to the filename of the background you would like to use. (MUST be in quotations " ", the file extension (.bmp/.png/etc) is not necessary though.)

 

Lemme know if that works, and works the way you want it. This *SHOULD* work in a default script environment, but I can't guarantee its behaviour with custom scripts (should still be okay though)

 

Some tweaking may be required in terms of size -- though if your background image is the same size as the battle item window, then it should be okay.

Share this post


Link to post
Share on other sites
  • 0

Uh Stop agree.gif , Atoa ACBS already does that by default:

 

Just look at his Custom Windows Setting Script that basically allows you to move the window, change the opacity and add a background image. You should probably read the whole CBS first as he add alot of customizable components. How I Know this because I'm look at it right now, plus I have my own custom background I made in photoshop.

Share this post


Link to post
Share on other sites
  • 0

Uh Stop agree.gif , Atoa ACBS already does that by default:

 

Just look at his Custom Windows Setting Script that basically allows you to move the window, change the opacity and add a background image. You should probably read the whole CBS first as he add alot of customizable components. How I Know this because I'm look at it right now, plus I have my own custom background I made in photoshop.

 

I had actually messed around quite a bit with the custom window settings but never of them ever applied correctly. That is until I took a second pass at it right now and realized I simply needed to move the location of the custom window script to get it to load right. Damn it! So much time wasted. Thanks to both of you, though.

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...