Author Topic: How to fix this script?  (Read 1721 times)

Offline fjshrr5

  • Trained Member
  • *
  • Posts: 46
  • LV: 2
    • View Profile
How to fix this script?
« on: October 02, 2014, 09:22:59 PM »
I've been toying with Mog hunters character selection script.
And i've got it to do most of what i wanted. But i'm trying to get it so there is just two character's to choose from.
I got the two i want set up. but have no clue how to delete the other ones that came script the script..

Here is the edit that i did... It's probably a fail lol
(click to show/hide)


And here is the original script.

(click to show/hide)
« Last Edit: October 03, 2014, 07:19:42 PM by KK20 »

Offline KK20

  • Master Scripter Fixer
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3038
  • LV: 372
  • Gender: Male
  • Bringer of Salt
    • View Profile
Re: How to fix this script?
« Reply #1 on: October 03, 2014, 07:27:13 PM »
Thank you for spoilering the code, but you forgot the code tags, so I added them for you.

Because I don't have the graphics required, can you post screenshots of what is happening?



Other Projects
RPG Maker XP AceUpgrade RMXP to RMVXA performance!
XPA TilemapTilemap rewrite with many features, including custom resolution!


NNID: KK20-CP
Discord: KK20 Tyler#8901
Join the CP Discord Server

Offline fjshrr5

  • Trained Member
  • *
  • Posts: 46
  • LV: 2
    • View Profile
Re: How to fix this script?
« Reply #2 on: October 03, 2014, 07:50:49 PM »
Okay, Here are the pictures. When i change from the male option, to the female option, the names clash, And it still acts as if there are more then just those two options to pick from. (by default there were) But i tried to edit it out, and it appears i did a poor job. I also can't find where to change the names that it displays (This is for learning xp) So if you can fix this problem for me, could you tell me what the problem actually was?



(click to show/hide)


(click to show/hide)
« Last Edit: October 03, 2014, 07:53:46 PM by fjshrr5 »

Offline KK20

  • Master Scripter Fixer
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3038
  • LV: 372
  • Gender: Male
  • Bringer of Salt
    • View Profile
Re: How to fix this script?
« Reply #3 on: October 04, 2014, 09:19:12 PM »
To make it so that the cursor knows there are only 2 options to select, you have to change the @item_max variable from 8 to 2 in class Win_Char.

You removed this bit of code that was supposed to be clearing the actor names rather than creating that overlapping:
Code: [Select]
  if Input.press?(Input.dir4)
    @char_name.x = -300
    @name.y = 500
    @name.opacity = 0
    @name2.y = 502
    @name2.opacity = 0
    @char_name.opacity = 0
    @name.bitmap.clear
    @name2.bitmap.clear
  end
It basically says "if the user presses any of the arrow keys, reposition the name and turn it invisible so that it will later scroll back on screen and fade in, and clear the name's text so that we can draw the NEW name text (and thus prevent overlap)".

You also forgot to change in class Scene_Char, under def main, the initially drawn battler graphic
Code: [Select]
    @char_name = Sprite.new
    @char_name.bitmap = RPG::Cache.battler("001-Fighter01",0)  #<====== should be "yep"
    @char_name.z = 100

The names that it displays are based on your Database Actors' names. Namely, these lines:
Code: [Select]
        @name.bitmap.draw_text(2, 22, 160, 64, actor.name.to_s)   
        @name2.bitmap.draw_text(2, 22, 160, 64, actor.name.to_s)
For you, you can simply change it to be like
Code: [Select]
        @name.bitmap.draw_text(2, 22, 160, 64, "Male")   
        @name2.bitmap.draw_text(2, 22, 160, 64, "Male")

I pretty much fixed it up all for you anyways:
(click to show/hide)
If you study the code, you will notice I added another variable called @last_index. Every item the window cursor highlights has a numeric value assigned to it (in your case, male = 0, female = 1). If you test MOG's original script, you start off on Aluxes. Press the Left Arrow key and you will see that it redraws everything for...Aluxes again. I find this awkward. @last_index takes the current value your cursor is currently over. If the player moves the cursor (and thus change its value), the script will detect this and apply the changes (as usual). But say if the player is on Male (or Aluxes), and presses left. The cursor's value doesn't change, so there is no need to redraw everything again.



Other Projects
RPG Maker XP AceUpgrade RMXP to RMVXA performance!
XPA TilemapTilemap rewrite with many features, including custom resolution!


NNID: KK20-CP
Discord: KK20 Tyler#8901
Join the CP Discord Server

Offline fjshrr5

  • Trained Member
  • *
  • Posts: 46
  • LV: 2
    • View Profile
Re: How to fix this script?
« Reply #4 on: October 04, 2014, 10:17:25 PM »
Oh man i really appreciate you fixing that! Thanks a ton.