Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Satoh

41
Script Troubleshooting / Re: SO3 Style CMS... issues...
September 10, 2009, 12:40:32 pm
Spoiler: ShowHide
  def update_cursor_CMS
   @list_item = self.contents
   # If cursor position is less than 0
   if @index < 0
     
     self.cursor_rect.empty
     return
   end
   # Get current row
   row = @index / @column_max
   # If current row is before top row
   if row < self.top_row
     # Scroll so that current row becomes top row
     self.top_row = row
   end
   # If current row is more to back than back row
   if row > self.top_row + (self.page_row_max - 1)
     # Scroll so that current row becomes back row
     self.top_row = row - (self.page_row_max - 1)
   end
   # Calculate cursor width
   @cursor_width = self.width / @column_max - 32
   # Calculate cursor coordinates
   x = @index % @column_max * (@cursor_width + 32)
   y = @index / @column_max * 32 - self.oy
   # Update cursor rectangle
   black = Color.new(0,0,0)
   @item_width = self.contents.text_size(@commands[@index])
   self.contents.fill_rect(x + 4, y + 25, @item_width.width, 4, black)
   self.contents.fill_rect(x + 5, y + 26, @item_width.width - 2, 2, normal_color) # Draws your underline
 end


Ok, here is my modification to the update_cursor method...

Specifically this part is what I'm having issues with...

Spoiler: ShowHide
    black = Color.new(0,0,0)
   @item_width = self.contents.text_size(@commands[@index])
   self.contents.fill_rect(x + 4, y + 25, @item_width.width, 4, black)
   self.contents.fill_rect(x + 5, y + 26, @item_width.width - 2, 2, normal_color) # Draws your underline
 end


This draws the underline at the proper size under each choice, but, it doesn't delete the new underline cursor after the selection is changed... Basically it adds a new underline for every time the selection is changed


In case you need to see it, this is the code from my Window script (placed after the Base script I posted above)

Spoiler: ShowHide
  #--------------------------------------------------------------------------
 # * Draw Item
 #     index : item number
 #     color : text color
 #--------------------------------------------------------------------------
 def draw_item(index, color)
   self.contents.font.color = color
   rect = Rect.new(4, (32 * index), self.contents.width - 8, 32)
   self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
   self.contents.draw_text(rect, @commands[index])    
   @item_width = self.contents.text_size(@commands[index])
   self.contents.fill_rect(Rect.new(@item_width.x,@item_width.y+26,@item_width.width,2),Color.new(0,0,0))
 end


Anyone know how to remove a rectangular area from a bitmap?



EDIT: I just had an idea. I might be able to make a sprite that acts as the underline, and do away with the  standard selection cursor altogether for this type of command window... I'm gonna take a short nap and think through it...
42
Script Troubleshooting / Re: SO3 Style CMS... issues...
September 10, 2009, 01:09:28 am
So what would you recommend in order to change what the Window_Selectable class uses for a cursor?

Just use some other object in place of cursor_rect and flail about until I stop getting errors...? Essentially write a new method that uses all the properties of cursor_rect, 'simply' by trial and error?

I don't plan on replacing all instances of cursor_rect. I just want to use a different type of selection indicator in certain windows...

I'm franken-scripting a CMS_Selectable class for those windows, essentially the same as the original, but using the new cursor... What I don't know is how to set up the cursor.


I suppose I'll just mess around with it until I see a real problem... I just have to pick a place to start.
43
Script Troubleshooting / Re: SO3 Style CMS... issues...
September 09, 2009, 06:24:43 pm
I really don't trust iterations like 0..12 and 0...100, as I have had them cause errors, and I don't know exactly how they work, or in cases of error, why they don't.

There was an error in the BGImg code that took me most of the day to figure out, but I finally did, just before my afternoon class started.

Here is the fixed code:
class BGImg < Sprite
 def initialize(x, y, width, height ,name)
   super(Viewport.new(x, y, width, height))
   self.bitmap = Bitmap.new(640, 480)
   self.z = 90
   @bitmap = RPG::Cache.picture(name.to_s)
   refresh
 end
 def refresh
   self.bitmap.blt(0, 0, @bitmap, Rect.new(0, 0, 640, 480))
 end
end


Thank you all for your help so far, and while I'd like to say you can all rest, I have a long way to go before my CMS does all that I want it to.

Anyway, one step at a time. I'm also learning a lot through this project. Ok, so next question, is there an underlined text function, or would I need to create one myself?



EDIT:

does anyone have the definition for "cursor_rect" ? I want to change the 'Window_Command's selection cursor to an underline beneath the text, but I'm not sure how to do that aside from replacing cursor_rect, but I don't know what is included in it, as it isn't defined in the editable scripts.

I see a few listings of "self.cursor_rect.set" but there is no "cursor_rect" defined anywhere...

I haven't tried searching for "set" because I'd assume it's defined under "cursor_rect" somewhere.

But I will shortly.
44
Script Troubleshooting / Re: SO3 Style CMS... issues...
September 09, 2009, 01:31:39 am
class RPG::Item
  def item_type
    case @id
    when [1,2,3,4,5,6,7,8,9,10,11,12] then return 1
    when [17,18,19,20,21,22] then return 2
    when [33] then return 3
    when [23,24,25,26,27,28,29,30,31,32] then return 4
    when [13,14,15,16] then return 5
    else return 6
    end
    return 0
  end
end


This is intended to separate the items into categories which will later be filtered by the CMS. Can I use the [] to encase multiple ID's as I've done here, or do I need to address each ID with a separate 'when'?

Also, can 'else' be used with 'case'?
45
Script Troubleshooting / Re: SO3 Style CMS... issues...
September 09, 2009, 12:43:11 am
Much as I hate to think I wrote all that crap for the character slots over the course of 4 hours for nothing... I think I should probably just start over... or mess with some other part of the menu.


Is there a way to create an image that isn't inside a Window? I want a backdrop image for the empty space behind my Windows.

I tried just doing a bgimg = Bitmap.new('Graphics/Pictures/bmpname.png') but that just spits out all sorts of complaints. I tried placing the image in a window and making the image much larger that the window, but the window just clips it. I would use Bitmap.new(width - 1, height - 1) but I'm no sure how to assign it a file after it's been called and given parameters.

Any help with that?
46
Spoiler: ShowHide
#==============================================================================
# ** Window_Command
#------------------------------------------------------------------------------
#  This window deals with general command choices.
#==============================================================================

class Window_Command < Window_Selectable
 #--------------------------------------------------------------------------
 # * Object Initialization
 #     width    : window width
 #     commands : command text string array
 #--------------------------------------------------------------------------
 def initialize(width, commands)
   # Compute window height from command quantity
   super(4, 60, width, commands.size * 32 + 32)
   @item_max = commands.size
   @commands = commands
   self.contents = Bitmap.new(width - 32, @item_max * 32)
   refresh
   self.index = 0
 end
 #--------------------------------------------------------------------------
 # * Refresh
 #--------------------------------------------------------------------------
 def refresh
   self.contents.clear
   for i in 0...@item_max
     draw_item(i, normal_color)
   end
 end
 #--------------------------------------------------------------------------
 # * Draw Item
 #     index : item number
 #     color : text color
 #--------------------------------------------------------------------------
 def draw_item(index, color)
   self.contents.font.color = color
   rect = Rect.new(4, 32 * index, self.contents.width - 8, 32)
   self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
   self.contents.draw_text(rect, @commands[index])
 end
 #--------------------------------------------------------------------------
 # * Disable Item
 #     index : item number
 #--------------------------------------------------------------------------
 def disable_item(index)
   draw_item(index, disabled_color)
 end
end

#==============================================================================
# ** Window_PlayTime
#------------------------------------------------------------------------------
#  This window displays play time on the menu screen.
#==============================================================================

class Window_PlayTime < Window_Base
 #--------------------------------------------------------------------------
 # * Object Initialization
 #--------------------------------------------------------------------------
 def initialize
   super(0, 0, 640, 64)
   self.contents = Bitmap.new(width - 32, height - 32)
   refresh
 end
 #--------------------------------------------------------------------------
 # * Refresh
 #--------------------------------------------------------------------------
 def refresh
   self.contents.clear
   self.contents.font.color = system_color
   self.contents.draw_text(4, 0, 64, 32, "Time")
   @total_sec = Graphics.frame_count / Graphics.frame_rate
   hour = @total_sec / 60 / 60
   min = @total_sec / 60 % 60
   sec = @total_sec % 60
   text = sprintf("%02d:%02d:%02d", hour, min, sec)
   self.contents.font.color = normal_color
   self.contents.draw_text(64, 0, 120, 32, text, 2)
   cx = contents.text_size($data_system.words.gold).width
   self.contents.font.color = normal_color
   self.contents.draw_text(282, 0, 120-cx-2, 32, $game_party.gold.to_s, 2)
   self.contents.font.color = system_color
   self.contents.draw_text(256-cx, 0, cx, 32, $data_system.words.gold, 2)
 end
 #--------------------------------------------------------------------------
 # * Frame Update
 #--------------------------------------------------------------------------
 def update
   super
   if Graphics.frame_count / Graphics.frame_rate != @total_sec
     refresh
   end
 end
end

#==============================================================================
# ** Window_MenuStatus
#------------------------------------------------------------------------------
#  This window displays party member status on the menu screen.
#==============================================================================

class Window_MenuStat2 < Window_Selectable
 #--------------------------------------------------------------------------
 # * Object Initialization
 #--------------------------------------------------------------------------
 def initialize(chara)
   super(0, 0, 446, 116)
   @chara = chara
   self.contents = Bitmap.new(width - 16, height - 16)
   refresh
   self.active = false
   self.index = -1
   return chara
 end
 #--------------------------------------------------------------------------
 # * Refresh
 #--------------------------------------------------------------------------
 def refresh
   self.contents.clear
   @item_max = 1 #$game_party.actors.size
   #for i in 0...$game_party.actors.size
     x = 0
     y = 0 #i * 116
     actor = @chara
   if actor != nil
     #actor = $game_party.actors[0]
     draw_actor_graphic(actor, x + 24, y + 80)
     draw_actor_name(actor, x, y - 8)
     #draw_actor_class(actor, x - 64, y)
     draw_actor_level(actor, x, y + 32)
     #draw_actor_state(actor, x + 90, y + 32)
     draw_actor_exp(actor, x, y + 56)
     draw_actor_hp(actor, x + 192, y + 32)
     draw_actor_sp(actor, x + 192, y + 56)
   else
     self.contents.draw_text(width / 2, height / 2, 32, 120, "Empty")
   end
   
 end
 #--------------------------------------------------------------------------
 # * Cursor Rectangle Update
 #--------------------------------------------------------------------------
 def update_cursor_rect
   if @index < 0
     self.cursor_rect.empty
   else
     self.cursor_rect.set(0, @index * 116, self.width - 32, 96)
   end
 end
end

Spoiler: ShowHide
class Scene_Menu < Window_Selectable
 #--------------------------------------------------------------------------
 # * Object Initialization
 #     menu_index : command cursor's initial position
 #--------------------------------------------------------------------------
 def initialize(menu_index = 0)
   @menu_index = menu_index
 end
 #--------------------------------------------------------------------------
 # * Main Processing
 #--------------------------------------------------------------------------
 def main
   # Make command window
   s1 = $data_system.words.skill
   s2 = COMBO_SETUP_NAME
   s3 = $data_system.words.item
   s4 = $data_system.words.equip
   s5 = "Status"
   s6 = "Config"
   s7 = "Tactics"
   s8 = "Dictionary"
   s9 = ""
   s10 = "File"
   @command_window = Window_Command.new(192, [s1, s2, s3, s4, s5, s6, s7, s8, s9, s10])
   @command_window.index = @menu_index
   # If number of party members is 0
   if $game_party.actors.size == 0
     # Disable items, skills, equipment, and status
     @command_window.disable_item(0)
     @command_window.disable_item(1)
     @command_window.disable_item(2)
     @command_window.disable_item(3)
     @command_window.disable_item(4)
     @command_window.disable_item(6)
   end
   # If save is forbidden
   if $game_system.save_disabled
     # Disable save
     @command_window.disable_item(9)
   end
   # Make play time window
   @playtime_window = Window_PlayTime.new
   @playtime_window.x = 0
   @playtime_window.y = 416
   # Make steps window
   #@steps_window = Window_Steps.new
   #@steps_window.x = 0
   #@steps_window.y = 320
   # Make gold window
   #@gold_window = Window_Gold.new
   #@gold_window.x = 0
   #@gold_window.y = 416
   # Make status window
   #if $game_party.actors[0] != nil
     @status_window1 = Window_MenuStat2.new($game_party.actors[0])
     @status_window1.x = 192
     @status_window1.y = 62
     @status_window1.z = @command_window.z - 10
   #else
    # @nilchar_window1 = Window_Nilchar.new
     @status_window2 = Window_MenuStat2.new($game_party.actors[1])
     @status_window2.x = 192
     @status_window2.y = 62 + (118)
     @status_window2.z = @command_window.z - 10
     @status_window3 = Window_MenuStat2.new($game_party.actors[2])
     @status_window3.x = 192
     @status_window3.y = 62 + (236)
     @status_window3.z = @command_window.z - 10
   # Execute transition
   Graphics.transition
   # Main loop
   loop do
     # Update game screen
     Graphics.update
     # Update input information
     Input.update
     # Frame update
     update
     # Abort loop if screen is changed
     if $scene != self
       break
     end
   end
   # Prepare for transition
   Graphics.freeze
   # Dispose of windows
   @command_window.dispose
   @playtime_window.dispose
   #@steps_window.dispose
   #@gold_window.dispose
#    if @status_window1.exists?
     @status_window1.dispose
#    else
#     @nilchar_window1.dispose
#    end
#    if @status_window2.exists?
     @status_window2.dispose
#    else
#      @nilchar_window2.dispose
#    end
#    if @status_window3.exists?
     @status_window3.dispose
#    else
#      @nilchar_window3.dispose
#    end
 end
 #--------------------------------------------------------------------------
 # * Frame Update
 #--------------------------------------------------------------------------
 def update
   # Update windows
   @command_window.update
   @playtime_window.update
   #@steps_window.update
   #@gold_window.update
   @status_window1.update
   @status_window2.update
   @status_window3.update
   # If command window is active: call update_command
   if @command_window.active
     update_command
     return
   end
   # If status window is active: call update_status
   if @status_window1.active || @status_window2.active || @status_window2.active
     update_status
     return
   end
 end
 #--------------------------------------------------------------------------
 # * Frame Update (when command window is active)
 #--------------------------------------------------------------------------
 def update_command
   # If B button was pressed
   if Input.trigger?(Input::B)
     # Play cancel SE
     $game_system.se_play($data_system.cancel_se)
     # Switch to map screen
     $scene = Scene_Map.new
     return
   end
   # If C button was pressed
   if Input.trigger?(Input::C)
     # If command other than save or end game, and party members = 0
     if $game_party.actors.size == 0 and @command_window.index < 4
       # Play buzzer SE
       $game_system.se_play($data_system.buzzer_se)
       return
     end
     # Branch by command window cursor position
     case @command_window.index
     when 0  # item
       # Play decision SE
       $game_system.se_play($data_system.decision_se)
       # Switch to item screen
       $scene = Scene_Item.new
     when 1  # skill
       # Play decision SE
       $game_system.se_play($data_system.decision_se)
       # Make status window active
       @command_window.active = false
       @status_window1.active = true
       @status_window1.index = 0
     when 2  # equipment
       # Play decision SE
       $game_system.se_play($data_system.decision_se)
       # Make status window active
       @command_window.active = false
       @status_window1.active = true
       @status_window1.index = 0
     when 3  # status
       # Play decision SE
       $game_system.se_play($data_system.decision_se)
       # Make status window active
       @command_window.active = false
       @status_window1.active = true
       @status_window1.index = 0
     when 4  # save
       # If saving is forbidden
       if $game_system.save_disabled
         # Play buzzer SE
         $game_system.se_play($data_system.buzzer_se)
         return
       end
       # Play decision SE
       $game_system.se_play($data_system.decision_se)
       # Switch to save screen
       $scene = Scene_Save.new
     when 5  # end game
       # Play decision SE
       $game_system.se_play($data_system.decision_se)
       # Switch to end game screen
       $scene = Scene_End.new
     when 6
       $game_system.se_play($data_system.decision_se)
       $scene = Scene_Equimage.new
     end
     return
   end
 end
 #--------------------------------------------------------------------------
 # * Frame Update (when status window is active)
 #--------------------------------------------------------------------------
 def update_status
   # If B button was pressed
   if Input.trigger?(Input::B)
     # Play cancel SE
     $game_system.se_play($data_system.cancel_se)
     # Make command window active
     @command_window.active = true
     @status_window1.active = false
     @status_window1.index = -1
     return
   end
   # If C button was pressed
   if Input.trigger?(Input::C)
     # Branch by command window cursor position
     case @command_window.index
     when 1  # skill
       # If this actor's action limit is 2 or more
       if $game_party.actors[@status_window.index].restriction >= 2
         # Play buzzer SE
         $game_system.se_play($data_system.buzzer_se)
         return
       end
       # Play decision SE
       $game_system.se_play($data_system.decision_se)
       # Switch to skill screen
       $scene = Scene_Skill.new(@status_window.index)
     when 2  # equipment
       # Play decision SE
       $game_system.se_play($data_system.decision_se)
       # Switch to equipment screen
       $scene = Scene_Equip.new(@status_window.index)
     when 3  # status
       # Play decision SE
       $game_system.se_play($data_system.decision_se)
       # Switch to status screen
       $scene = Scene_Status.new(@status_window.index)
     end
     return
   end
 end
end

Here is the code I'm having issues with...

I tried changing the way in which the character's status is displayed on the main menu page, and finally got most stuff working... however I have a few issues:

1 Now that I have done this, all my menus are broken, probably due to how I rewrote the status method.

2 My message for non existing party member slots should read "Empty" in the center of the frame, but instead it is just blank.
47
RPG Maker Scripts / Re: General RGSS/RGSS2/RGSS3 Help
September 06, 2009, 03:56:22 pm
I'm attempting to write a custom 'break damage/level/stat barrier' script. I think the caps are set in Game_Battler1, correct? I'm not sure if these are the enemy or actor values... Are actors stored separately?

Though it's mainly an aesthetic thing, I want level values up to 255, HP up to 99999, and stats up to 9999...

I'm not sure whether I need to change the setups in Game_Actor or Game_Battler1... GB1 has an HP value up to 999999, so I'm assuming that's the enemy setup. The GA setup seems to be setup differently though... and I'm not sure how to go about changing this...



Also, as I mentioned in another thread, I want to know how to interface weapons with status effects... or scripts... I want weapons/equipment to change the actor's state permanently, on equip and on unequip...

EDIT: Ok I changed the setups in those  two places but it doesn't seem to work...
48
I'll look into it, thanks.


Now I need to figure out how to execute scripts through equipment...
49
I've seen a few Iso battle scripts... and I found a broken link to a supposed iso map script... but I've yet to actually see an actual script...

So here's what I want to know... it it possible to make an isometric map movement script? By that I mean, would it be possible to get a script that replaces standard Up down left right with Northwest Southeast Northeast Southwest respectively?

This being a movement of 2,1 X,Y.




For the Second part of my request, I'd like to know how to attach status effects to weapons and equipment. Specifically I want to add an invulnerability status to a sword...

I want to add an 'always max damage' status to another sword...

and I want to add a status that has a 50% chance to save the player from a killing blow, while at the same time giving a regeneration effect, on an accessory...

(I should note that I also need to know how to make such effects... It shouldn't be hard to do with a script, but I don't know how to attach a script to either a status effect or a weapon...)

EDIT: Before I get to hasty... Thanks for any help you can provide.


EDIT2: Ok Looks like Tons has two of the status effects I need... all I really need now is 50% chance of keeping 1HP on fatal attacks, and 'always max damage'....

(Speaking of maximums.... is there a way to break damage/level limits?)
50
Well the attitude about my return is certainly not doing anything to drive me away...


And I noticed that RMX OS there... I see what you did there, and I likes it. You get +57 Internets and a toss vodka.

I will be testing that out in a while... after I finish up(or scrap) my new project...


EDIT: (Oh god I just realized how much HELL the mapping for this game is gonna be...)
51
Thanks, I'll try it out.

That and Tankentai(I guess it's a script XD?) if I can find it...

If anyone else has any good suggestions, please post them as well...


(Am I really that missed? O.o; )
52
I'm in need of a script that mimics RM2K3's sprite battle system... (one that can support RM2k3 battle sprites)

It must be RMXP compatible...

Preferably compatible with Tons of Add-ons.

I started looking, but I couldn't find much, and I've lost all my old resource links... Not to mention I have no idea how to tell if the script I might find is a good one... or incredibly bad one... aside from wasting large amount of time and frustration...

So I put this forth to you all... I'm sure you know more about this than I(especially since I haven't messed with RM for a long time...)

Can anyone give me some suggestions?

Thanks.
53
RMXP Script Database / Re: [XP] Blizz-ABS
March 15, 2009, 03:11:16 pm
Ok, it's been a while...

I decided to check out the latest on the B-ABS scene.

A few tings I noticed (which are giving me hell to no end)

Apparently the party can act freely now... that isn't bad my itself, but, I don't have all my animations for the party yet, so when they attack I crash XD;;

I have a suggestion to fix this... a final solution to this issue. Default attack, skill, weapon, etc animations that are called automatically when a specific file is not found.

Also, there seems to be an error when I try to access the save menu... it tells me something about:
"Script 'Window_SaveFile' line 30: ArgumentError occurred.

undefined class/module Game_Controls"

An issue I have perpetually run into is B-ABS tries to call attack/skill/item animations for enemies and characters even when I have them disabled.

Example: I have character attack animations active, character skill/item animations and ALL enemy animations disabled...
but when a character uses a skill or an enemy does... well.. anything... I get a missing file error.

as for any new features... I haven't messed with them yet... but I certainly hope it's everything I've come to expect from your work previous.

I may hang around a while... I may not... college is pretty busy for me right now.
54
Chat / Re: The Vodka Thread
December 22, 2008, 08:10:10 pm
Toss Vodka!!

(Ulta, I agree, I don't much care for alcohol either...)
55
Resource Database / Re: Satoh's Resources(11-26-08)
December 22, 2008, 06:37:26 pm
Well... my initial sketches for the face set turned out positively WRETCHED... So, I won't be posting those... instead.. I will try again later and hopefully they will be better....
56
Resource Database / Re: Satoh's Resources(11-26-08)
December 20, 2008, 01:27:59 pm
umm... yeah, go ahead and try things...(?)
57
Resource Database / Re: Satoh's Resources(11-26-08)
December 18, 2008, 07:24:48 am
I can't draw Alucard worth a shit basically... Alright... I'll try to do some faces for the random guy...

And Dark Gaia, welcome to the Chaos Project, but could you shrink your signature a bit, it's a little tall.
58
Resource Database / Re: Satoh's Resources(11-26-08)
December 17, 2008, 06:37:41 pm
Brandon Random Guy O.o? You mean the spiky haired dude? I... could... but I'd rather do that when I have enough characters for a full 'Down' sheet... and since Tsukihime characters are kinda their own continuum... (I just don't like putting random characters on the same sheet together....)

As for speaking poses... I cant do Alucard... the random guy I might try, you prefer more stylized or more realistic...? (note: it'll be anime styled either way, but it could be 'cuter' or more defined...)
59
Resource Database / Re: Satoh's Resources(11-26-08)
December 17, 2008, 11:57:26 am
I do recognize a lot of things that I can improve upon on my own, but criticism can't ever become obsolete either.

A lot of times I have to ask someone else what's wrong when everything in my picture looks fine by itself but the image as a whole looks strange to me...

It isn't an everyday occurrence but it does happen.

@Taharo... I'm not sure what you're wanting... could you be a little more specific? (note that I'm in a bit of a slump and I don't post anything I'm not satisfied with, so I may not be able to do it right now.)
60
News / Suggestions / Feedback / Re: ABS Showdown Contest
December 15, 2008, 01:23:45 pm
Sorry Blizz, but this is my official secession from the contest... I just can't focus on RMXP anymore right now... I tried to do too much in too little time, and now I'm regretting it.

Besides, if NAMKCOR's confidence is well founded, then I didn't stand a chance anyway.

So from here on in, consider my cheers to you, NAMKCOR, good luck.