[XP] Journal

Started by ForeverZer0, July 06, 2010, 09:26:47 pm

Previous topic - Next topic

Cates

Hi ForeverZer0.

This is a great script! Exactly what I've been looking for. Easy to configure and looks great!

However, something odd is happening . . . when a weapon, armor, shield, etc. is unequipped, it vanishes, and nothing else shows up that is available for the player to equip--even the sword/shield/etc. you just unequipped.

For instance, I started a new game just by copying and pasting the journal script into the editor. No other scripts involved in this test. I started the game, unequipped Aluxes's bronze sword and it vanished. It can no longer be seen on the equip screen. You can't see it even on the "item" menu.

I'm a novice, and managed to find a way to add a your journal to the default menu before I realized what was happening. That's when I tested it on a generic game start and still saw the same "vanishing de-equipped item" effect.

Am I doing something wrong?

ForeverZer0

December 30, 2010, 07:43:53 pm #21 Last Edit: December 30, 2010, 07:58:41 pm by ForeverZer0
I'm looking into right now. I just tested it real quick and had the same problem.  :shy:

EDIT:

* Updates to 2.1 *
Fixed the bug, I used the wrong method name when aliasing "gain_weapon" in Game_Party.
That was the only change made, so if you don't feel like repasting the script, you can easily just make the edit yourself. You simply need to change one word. Find the "Game_Party" section in the script and look at the first method, which looks like this:

  alias zer0_auto_add_weapon gain_item
  def gain_weapon(weapon_id, n)
    # Unlock weapon ID if recieved.
    Journal.add_weapon(weapon_id) if Journal::AUTO_WEAPONS
    zer0_auto_add_weapon(weapon_id, n)
  end


You simply need to change the "gain_item" in the first line to "gain_weapon".
alias zer0_auto_add_weapon gain_weapon


That should do it.  ;)
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Cates

Thanks for the fix - that did it for the weapons, but not for the other equipment slots. Sorry to be a pain!

ForeverZer0

* Updates to 2.2 *

Your not being a pain.  I appreciate you letting me know.
I'm the idiot who didn't look a few lines below the last bug.
The script is updated, but once again, if you want to change it yourself, do this.

Find the Game_Party class within the script, and find the aliased method "gain_armor" within it.
Change the line that reads:
zer0_auto_add_weapon(weapon_id, n)

and change it to...
zer0_auto_add_armor(weapon_id, n)


Sorry for all the little bugs.

@cates:
Thanks a bunch for pointing it out!  ;)

I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Cates

OK! That error seems to be fixed.

Here's another issue, when I have the auto updates set to "true" in the config of the script, I'm getting a method error on the line that relates to whatever equipment I'm trying to change. (such as 332 for weapons).

This was happening with the default items equipped on Aluxes and the gang, so I thought maybe that's because I hadn't defined anything in the lower journal entries.  So, I deleted everyone but aluxes and gave him only a single sword. I had an event call that journal addition and it was so far, so good. Then I added another event to give him a second sword to test the auto-update, the method error came up again.

When I set the auto updates to false, and called the scripts for each of those two individual swords, everything worked smoothly. Let me know if you'd like me to upload my little testing demo for you to check out.

Thanks for your quick responses! This is such a useful and versatile script!

ForeverZer0

December 31, 2010, 02:35:22 am #25 Last Edit: December 31, 2010, 02:47:25 am by ForeverZer0
I found the problem. It occurs when an ID of 0 gets passed as the weapon ID. I'm fixing it now.

EDIT::

* update to 2.3 *

...and yet another bug fixed. I didn't think that if the player unequips a weapon, it passes an ID of 0 to the array, which throws an error when the game attempts to see what weapon/armor that is. I couldn't get the error to repeat at first because I kept switching back and forth between two weapons, and not just straight unequipping to nothing.

Either way, another big thanks and a level up to Cates for pointing it out.  :D
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Cates

Awesome, man. It now works perfectly. Thanks!

elmangakac

GIves me an error:

????????? "Journal" 396???? No Method Error????

private method "split" called for Nil:Class


:'(

ForeverZer0

You're not configuring it properly. From the sounds of it, something in one of the ?????_bio(id) methods is not set up right. Basically this method needs a string passed to it, which is not being done if you're getting that error. Since the string is retrieved from the config, this is your likely problem.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

elmangakac

I understand it!!! That is because i change the words... (My game its spanish) and i change the word "People" by "Gente" and also the others... I delete my script with spanish words and i put the original and works good....

Thank you very much...

elmangakac

Exist a limit of elements in the list? Or can shows all the items... Because just shows some items and not all that i get.... O_O ?

OracleGames

Hey Foreverzer0, it would be really nice to add this to the game menu, is it even possible?

ForeverZer0

Yes, you can link it to a menu option the same as any any other scene. The only edit that will need to be made is it to change the scene it returns to after exit. At the bottom of the script find the line that reads:
$scene = Scene_Map.new

and change the scene to Scene_Map or whatever scene you would like for it to go to after it ends.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

TJ01

I`ve got a question, can it be done, that you can remove an entry?

ForeverZer0

April 07, 2011, 07:16:09 pm #34 Last Edit: April 07, 2011, 07:20:40 pm by ForeverZer0
You can, though there is no method to do it easily by default. I wrote this code real quick, its untested, but should do the job. Just add it to your scripts any old where.

Spoiler: ShowHide

module Journal
 
 def self.delete_character(id)
   $game_system.journal['People'].delete(id)
   $game_system.journal['People'].sort!
 end
 
 def self.delete_location(id)
   $game_system.journal['Places'].delete(id)
   $game_system.journal['Places'].sort!
 end
 
 def self.delete_weapon(id)
   $game_system.journal['Weapons'].delete(id)
   $game_system.journal['Weapons'].sort!
 end
 
 def self.delete_armor(id)
   $game_system.journal['Armors'].delete(id)
   $game_system.journal['Armors'].sort!
 end
 
 def self.delete_item(id)
   $game_system.journal['Items'].delete(id)
   $game_system.journal['Items'].sort!
 end
end


Use the methods the same as you would with Journal.add_PARAMETER(id), except use the word "delete", like this:

Journal.delete_weapon(ID)


Let me know how that works out for you.  ;)

I made add it to the script when I'm not feeling so lazy.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

nathmatt

April 07, 2011, 07:19:18 pm #35 Last Edit: April 07, 2011, 07:21:04 pm by nathmatt
Quote from: ForeverZer0 on April 07, 2011, 07:16:09 pm
Spoiler: ShowHide

 def self.delete_character(id)
   $game_system.journal['People'].delete(id)
   $game_system.journal['People'].push(id)
 end



use this lol just fixed that

Spoiler: ShowHide
module Journal
 
 def self.delete_character(id)
   $game_system.journal['People'].delete(id)
   $game_system.journal['People'].sort!
 end
 
 def self.delete_location(id)
   $game_system.journal['Places'].delete(id)
   $game_system.journal['Places'].sort!
 end
 
 def self.delete_weapon(id)
   $game_system.journal['Weapons'].delete(id)
   $game_system.journal['Weapons'].sort!
 end
 
 def self.delete_armor(id)
   $game_system.journal['Armors'].delete(id)
   $game_system.journal['Armors'].sort!
 end
 
 def self.delete_item(id)
   $game_system.journal['Items'].delete(id)
   $game_system.journal['Items'].sort!
 end
end
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


ForeverZer0

 :P
Thanks, nathmatt.

I just edited the "add" methods real fast, apparently I did that one wrong. Fixed now.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

TJ01

Jeah, it works, thank you!
But if I call the Journey, there comes a warning message, like them from windows:
Spoiler: ShowHide

Before, there is an other just with armors.

elmangakac

I have the same "window" problem O:O

ForeverZer0

Okay, I fixed that.
I had accidentally left a few lines in it that were there for debugging it.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.