The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Scripting => Topic started by: Blizzard on September 18, 2006, 01:28:36 PM

Title: [MISSING] Bestiary v1.2b
Post by: Blizzard on September 18, 2006, 01:28:36 PM
lol, gone
Title: Re: Bestiary v1.1
Post by: Arrow on September 18, 2006, 02:08:27 PM
Say I'm using this for an action RPG. If an enemy is killed outside of the default battle system, and on the map instead, will it appear in the beastiary?
Title: Re: Bestiary v1.1
Post by: Blizzard on September 18, 2006, 02:23:21 PM
Include a "Call script" command when the enemy "event" disappears. Write

Code: [Select]
$game_system.enable(ID)

where ID is the ID of the enemy in the database. This will add the enemy into the bestiary if he isn´t already there. Of course this means, you have to make enemies in your database be the same as on the map.
Title: Re: Bestiary v1.1
Post by: Arrow on September 18, 2006, 02:27:06 PM
Thanks a lot man, I appreciate it.
Title: Re: Bestiary v1.1
Post by: subzero on September 28, 2006, 01:31:26 AM
I got a Syntax Error
 ??????"Bestiary Script'? 584????Syntax Error????????????
Please Correct it, thank you in advance  ;D
Title: Re: Bestiary v1.1
Post by: Blizzard on September 28, 2006, 03:40:10 PM
You haven´t copied the code correctly, there is an "end" missing.
Title: Re: Bestiary v1.1
Post by: Nightwolf on October 04, 2006, 11:15:05 AM
Thias script..its awsome..
There are so many poke-a-man games, this will be useful
Title: Re: Bestiary v1.1
Post by: Kingsukasa103 on October 04, 2006, 12:23:58 PM
When I use this and load the bestiary no text or anything is shown...whats up with that??
Title: Re: Bestiary v1.1
Post by: Blizzard on October 04, 2006, 01:16:50 PM
Search for the RMXP FAQ at this forum. There you will find an answer. And I should update the code and fix that... >.<
Title: Re: Bestiary v1.1
Post by: Mirak on October 10, 2006, 03:52:57 AM
Marks a syntax error here
Code: [Select]
if not $game_system.beasts.include?(enemy.id))
Title: Re: Bestiary v1.1
Post by: Blizzard on October 10, 2006, 11:56:02 AM
Marks a syntax error here
Code: [Select]
if not $game_system.beasts.include?(enemy.id))

It should be

Code: [Select]
if not $game_system.beasts.include?(enemy.id)
Title: Re: Bestiary v1.1
Post by: &&&&&&&&&&&&& on October 13, 2006, 04:04:45 AM
I have too many penises in my mouth right now, it's hard to talk.
Title: Re: Bestiary v1.1
Post by: Blizzard on October 13, 2006, 11:54:50 AM
Oops... >.< I forgot to add that into the instructions. Use the "Call script" event command and type

Code: [Select]
$scene = Scene_Bestiary.new
Title: Re: Bestiary v1.1
Post by: Arrow on October 13, 2006, 01:38:05 PM
Say I want to make it accesible from the game menu? I've almost got it, but whenever I open the menu it opens up the script automatically. I added another option (S7) for it. How do I make it so that !. It only activates when I slect option 7 and 2. when I hit "B" it returns to the menu instead of the map?
Title: Re: Bestiary v1.1
Post by: Arrow on October 14, 2006, 02:16:06 PM
Double posting to get Blizzard's attention before he leaves for the day.
Title: Re: Bestiary v1.1
Post by: Blizzard on October 14, 2006, 02:37:04 PM
I wanted to reply yesterday, but I forgot. >.<

In the script, line 555:

Code: [Select]
      $scene = Scene_Map.new

Change it to:

Code: [Select]
      $scene = Scene_Menu.new(INDEX)

where INDEX is the choice on what the cursor should be placed when returning to the menu.

Open Scene_Menu and change

Code: [Select]
    s1 = $data_system.words.item
    s2 = $data_system.words.skill
    s3 = $data_system.words.equip
    s4 = "Status"
    s5 = "Save"
    s6 = "End Game"
    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6])

to

Code: [Select]
    s1 = $data_system.words.item
    s2 = $data_system.words.skill
    s3 = $data_system.words.equip
    s4 = "Status"
    s5 = "Bestiary"
    s6 = "Save"
    s7 = "End Game"
    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7])

Now find this part further below in the same script:

Code: [Select]
      when 4  # save
        if $game_system.save_disabled
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        $game_system.se_play($data_system.decision_se)
        $scene = Scene_Save.new
      when 5  # end game
        $game_system.se_play($data_system.decision_se)
        $scene = Scene_End.new
      end

(I removed the comments.) Change it to:

Code: [Select]
      when 4  # Bestiary
        $game_system.se_play($data_system.decision_se)
        $scene = Scene_Bestiary.new
      when 5  # save
        if $game_system.save_disabled
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        $game_system.se_play($data_system.decision_se)
        $scene = Scene_Save.new
      when 6  # end game
        $game_system.se_play($data_system.decision_se)
        $scene = Scene_End.new
      end

That works with anything, not just my Bestiary. You can add i.e. a Party Switcher that way or any other scene.
Title: Re: Bestiary v1.1
Post by: Arrow on October 14, 2006, 02:43:00 PM
Thanks a lot man! That's a big, BIG help.
Title: Re: Bestiary v1.1
Post by: Starrodkirby86 on October 16, 2006, 11:22:11 PM
Awesome script, loved the fact you can view monsters' stats. I have a question though. How do you make the events and the Hero temporaily disappear? Whenever my besitary opens, all the events (Objects and NPCs) and my hero appear over the besitary window. It annoys me a little since the event might be possibly be blocking some of the text. I would like to know any way of making them disappear (As I said earlier). Thanks!
Title: Re: Bestiary v1.1
Post by: Blizzard on October 17, 2006, 08:13:08 AM
You can the window's opacity with ENTER/SPACE. Tell me if the problem is still there.
Title: Re: Bestiary v1.1
Post by: Starrodkirby86 on October 17, 2006, 11:05:30 PM
You can the window's opacity with ENTER/SPACE. Tell me if the problem is still there.
I tried your Opacity option on the besitary, and the events still block the text. I'll show you an example:
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fimg105.imageshack.us%2Fimg105%2F3797%2Fquickierb6.png&hash=8b56618f574a46f4f35b7dad6cb7205a7bbee223)
As you can see, the NPC is blocking the name and the pawn is blocking the HP. Please tell me what to do from here.
Title: Re: Bestiary v1.1
Post by: Blizzard on October 18, 2006, 08:23:49 AM
Find these lines:

Code: [Select]
    get_enemies
    @bestiary_size_now = @enemies.size
    refresh

put a self.z = 10000 under them, so it looks like this here:

Code: [Select]
    get_enemies
    @bestiary_size_now = @enemies.size
    refresh
    self.z = 10000

That should do it.
Title: Re: Bestiary v1.1
Post by: Starrodkirby86 on October 19, 2006, 11:25:54 PM
Thank you! It works now!!!  ;D
Title: Re: Bestiary v1.1
Post by: oneray on October 25, 2006, 08:53:22 PM
Sorry guys but I am a complete noob. I copied and pasted the script before and main and...nothing happened. I also have the detect ability but the window just ends being blank. Please don't tell me to read the configuration cause i have no idea what to do. Please help me. :(
Title: Re: Bestiary v1.1
Post by: Starrodkirby86 on October 25, 2006, 09:21:44 PM
Sorry guys but I am a complete noob. I copied and pasted the script before and main and...nothing happened. I also have the detect ability but the window just ends being blank. Please don't tell me to read the configuration cause i have no idea what to do. Please help me. :(
Did you create an event (Whether common event or not) that has the Call Script command containing
Code: [Select]
$scene = Scene_Bestiary.new
?
If you did not, that is why you cannot open it. Also, the way I corrected the blank words and stuff was when I got a CMS script (Blizzard's). I don't know how to correct it w/out using the CMS script.
Title: Re: Bestiary v1.1
Post by: oneray on October 25, 2006, 10:08:20 PM
No, i just took the script and stuck it right above main. What i am trying to say is that when battling, i don't know how to activate bestiary
Title: Re: Bestiary v1.1
Post by: Blizzard on October 26, 2006, 12:27:51 PM
Opening the bestiary in the battle scene and returning to it will automatically reset the battle and is therefore not recommened. Adding enemies into the bestiary is exectued automatically.
Title: Re: Bestiary v1.1
Post by: oneray on October 26, 2006, 08:29:57 PM
So there is no way of viewing the beasts after? Also, how to do i input information about the monsters?
Title: Re: Bestiary v1.1
Post by: Blizzard on October 27, 2006, 02:54:53 PM
Use a "Call script" command in an event. Type

Code: [Select]
$scene = Scene_Bestiary.new

to view the bestiary/all the monsters inside. Monsters are automatically added if you encounter them in a fight. The stats from the database (where you create enemies and such) are automatically used in the bestiary. You don't need to do anything, everything is automatic. You only need to use that event script call if you want to see it, that's all.
Title: Re: Bestiary v1.1
Post by: killeryunran on January 28, 2007, 10:56:15 PM
Can someone help me...I have been experimenting a lot with RMXP, and i followed the things said in this topic over the bestiary, but when I open my bestiary through a event, this will pop up:

NameError occurred while running script.
uninitialized constant Interprenter::INDEX

Can someone help me ??? ??? ???
PLEASE ??? :tpg: :'(
Title: Re: Bestiary v1.1
Post by: Blizzard on January 29, 2007, 09:40:36 AM
Find in all your scripts where it says "Interprenter" and change it to "Interpreter". This could have been caused by any script.
Title: Re: Bestiary v1.1
Post by: auronmotomo on February 21, 2007, 11:24:33 PM
make a common event with the "open beastiary code"

make an item, and make that its common event.

make it not consumable.
Title: Re: Bestiary v1.2b
Post by: Blizzard on February 23, 2007, 06:16:36 PM
*updates*
Title: Re: Bestiary v1.2b
Post by: skyrune83 on March 18, 2007, 12:16:00 AM
Neato script!  Is there a way to have the item drops start off displaying as "?? ??", and then display the item only AFTER the enemy drops it (i.e. in Castlevanias)?
Title: Re: Bestiary v1.2b
Post by: Blizzard on March 18, 2007, 02:09:49 PM
Yes, it's possible. You need to turn "all unknown". Then use a parallel process event. Check if that specific item is in the inventory and if it is, make it execute this call script commands:

Quote
$game_system.enable(ENEMY_ID)

Note that you need one item for each enemy. There will be as many conditional branches as you have enemies.
Title: Re: Bestiary v1.2b
Post by: skyrune83 on March 18, 2007, 06:00:47 PM
That's not quite what I meant.  This is what I want to do (added code that needs fixing):
In Scene_Battle 2:
# Determine if treasure appears
        if rand(100) < enemy.treasure_prob
          if enemy.item_id > 0
            treasures.push($data_items[enemy.item_id])  ## Enemy drops the item after battle           
            ## Take enemy's drop item and draw over "??" already in Bestiary
            # drop = $data_items[enemy.item_id].name
            # _DROP = drop + " (" + enemy.treasure_prob.to_s + "%)"
            # RPG.contents.draw_text(x_offset, 320, 256, 32, _DROP)
          end
        ...

I know what to do, I just don't know all that ridiculous crap about accessors, scope, and references.
Title: Re: Bestiary v1.2b
Post by: punishermark13 on March 18, 2007, 11:09:55 PM
Can this work for abs?
Title: Re: Bestiary v1.2b
Post by: Kokowam on March 18, 2007, 11:15:56 PM
Monsters are automatically added if you encounter them in a fight. The stats from the database (where you create enemies and such) are automatically used in the bestiary. You don't need to do anything, everything is automatic. You only need to use that event script call if you want to see it, that's all.

I bolded that part because I'm guessing that means that the monsters get added once you encounter them in a regular fight.
Title: Re: Bestiary v1.2b
Post by: Blizzard on March 19, 2007, 12:12:24 PM
Exactly.
Turning on "ALL_UNKNOWN" will make them all ??? until "something else" happens. This "something else" can be defined with different methods. One would be using my Analyze script, another one would be the common event with the item. And yes, as soon as the enemy drops the item, the common event will add it into the bestiary fully.
Title: Re: Bestiary v1.2b
Post by: Aster on March 19, 2007, 10:51:24 PM
how can i open the bestiary with a item?
Title: Re: Bestiary v1.2b
Post by: skyrune83 on March 20, 2007, 02:04:49 AM
@Blizzard(or other): I don't want all aspects to be "unknown".  I want just the item to intitially say "Drops ? ? ? (10% chance)", and then when the enemy drops its item the first time (in Scene_Battle 2), I want to be able to change the "? ? ?" to "<Item Name>".  Is there a way I can draw text into the Bestiary directly from Scene_Battle 2? 

@Aster: Create a common event that calls a script:  $scene = Scene_Bestiary.new 
Then make an item that calls that common event.
Title: Re: Bestiary v1.2b
Post by: Blizzard on March 20, 2007, 12:53:05 PM
[whoops, gone]
Title: Re: Bestiary v1.2b
Post by: Aster on March 20, 2007, 09:06:04 PM
hey when i have the bestiary empty i press < or > and say error in line 232 a zero divison error
Title: Re: Bestiary v1.2b
Post by: skyrune83 on March 20, 2007, 11:42:37 PM
@ Blizzard:
THANK YOU!!! Just what I was looking for!  :D
---------------------------------------------

@ Aster:
Replace the following code:
Code: [Select]
    if Input.trigger?(Input::RIGHT)
      $game_system.se_play($data_system.cursor_se)
      @index_enemy = (@index_enemy + 1) % @bestiary_size_now
      refresh
    end
    if Input.trigger?(Input::LEFT)
      $game_system.se_play($data_system.cursor_se)
      @index_enemy = (@index_enemy + @bestiary_size_now - 1) % @bestiary_size_now
      refresh
    end

with this code:
Code: [Select]
    if Input.trigger?(Input::RIGHT)
      $game_system.se_play($data_system.cursor_se)
      ## Added "if" to prevent divide by 0
      if @bestiary_size_now > 0
      @index_enemy = (@index_enemy + 1) % @bestiary_size_now
      end
      refresh
    end
    if Input.trigger?(Input::LEFT)
      $game_system.se_play($data_system.cursor_se)
      ## Added "if" to prevent divide by 0
      if @bestiary_size_now > 0
      @index_enemy = (@index_enemy + @bestiary_size_now - 1) % @bestiary_size_now
      end
      refresh
    end
Title: Re: Bestiary v1.2b
Post by: skyrune83 on March 21, 2007, 12:12:54 AM
One more question... How do you add the picture icon of the item next to the name in the Bestiary?
Title: Re: Bestiary v1.2b
Post by: Irgna on March 27, 2007, 02:27:16 PM
Ok, this is going to sound like an extreamely n00bish question. It doesn't show any words. I'm a PKE user. I tried using th font script, but it isn't working. What do I do?
Title: Re: Bestiary v1.2b
Post by: JFloyd on March 28, 2007, 02:31:07 AM
Can someone copy and paste the original scene_menu, cuase i got pk, and the script u have is for the legal version becuase not all of the script is translated in pk.
So i screwed my menu over.
Title: Re: Bestiary v1.2b
Post by: Rune on April 01, 2007, 09:16:36 AM
Say... Blizzard... is there a way to implant this into your CMS... it's just... i've been having trouble with it and wanted to see if you could help...

Thanks ;)
Title: Re: Bestiary v1.2b
Post by: Blizzard on April 01, 2007, 12:13:43 PM
Tutorials Section, stickied topic "Blizzard's little tricks", look under 6. a).
Title: Re: Bestiary v1.2b
Post by: Rune on April 01, 2007, 12:24:52 PM
I know how to do that... it's just... your menu system kinda works differently...
I've tried that but it doesn't work...
Title: Re: Bestiary v1.2b
Post by: Irgna on April 01, 2007, 05:12:50 PM
Anybody gunna answer my question?

~Irgna
Title: Re: Bestiary v1.2b
Post by: Blizzard on April 03, 2007, 09:59:05 AM
Under

Code: [Select]
self.contents = Bitmap.new(width - 32, height - 32)

in class Window_Beast in def initialize add this below:

Code: [Select]
  if $fontface != nil
    self.contents.font.name = $fontface
    self.contents.font.size = $fontsize
  elsif $defaultfonttype != nil
    self.contents.font.name = $defaultfonttype
    self.contents.font.size = $defaultfontsize
  end
Title: Re: Bestiary v1.2b
Post by: skyrune83 on May 12, 2007, 09:32:25 PM
Hey Blizzard, did you find a way to add the picture icon of the item next to the name in the Bestiary?