Main Menu
  • Welcome to The RPG Maker Resource Kit.

[VXA] Monster Catalogue

Started by modern algebra, February 05, 2012, 12:49:04 AM

0 Members and 1 Guest are viewing this topic.

modern algebra

It's an incompatibility with another script - a Yanfly script I believe and probably one that has something to do with classes. It can be fixed by going to that line and replacing:


       if enemy.class.method_defined?(:mamc_analyze_now) && enemy.mamc_analyze_now


with:


       if Game_Enemy.method_defined?(:mamc_analyze_now) && enemy.mamc_analyze_now

Tuomo L

How do I store the amount of monsters completed? I'd want to make use of this for an achievement and giving equipment sort of purposes.  :)

(Such as rewarding the player when they've killed 10 unique monsters, again when 30 and so on and forth)

modern algebra

I actually don't have completion data stored in any particular variable. Instead, it appears that it calculates it each time.

I'm not overly happy with the way it's done, but I'll assume for the moment that I had good reasons for doing it that way, so I could write a method in Interpreter that could get it for you. Basically, you would need a method like this.


  def completed_monsters(cat_id = 0)
   a = 0
   $data_enemies.compact.each { |enemy|
     if enemy.category_ids.include?(cat_id) && !$game_system.mamc_hide_ary.include?(enemy.id)
       a += 1 if $game_system.mamc_data_conditions_met?(MAMC_CONFIG[:complete_when], enemy.id)
     end
   }
   return a
end


However, where you put it depends on how you want to use it. In other words, if you intend to do it in an event by script call, you would need to put it in Game_Interpreter. However, if you wanted to retrieve it in some other script, it would probably be better off in some other class. So let me know.

Tuomo L

For dual purposes really. Like I said, in both event call (When you talk to the guy who gives rewards based on it) but also in a script to check when you've completed all the stuff to award the achievement. Is why I said it'd be simple to do it via variable and conditional branches.

modern algebra

Alright, well insert the following code into its own slot somewhere between Main and Materials:


class Game_System
  def completed_monsters(cat_id = 0)
   a = 0
   $data_enemies.compact.each { |enemy|
     if enemy.category_ids.include?(cat_id) && !$game_system.mamc_hide_ary.include?(enemy.id)
       a += 1 if $game_system.mamc_data_conditions_met?(MAMC_CONFIG[:complete_when], enemy.id)
     end
   }
   return a
end
end


The code:

$game_system.completed_monsters(cat_id)

will return the number of monsters completed in the category with cat_id. If you exclude cat_id, then it will give you the number in total.

Examples:


a = $game_system.completed_monsters(4)
$game_variables[9] = a


That would put into variable 9 the number of monsters completed in category 4.


a = $game_system.completed_monsters
$game_variables[13] = a


That would put in Variable 13 the number of monsters completed in total.

Caveras

I just expanded this method with the two marked lines

  def get_completion
    a, b = 0, 0
    $data_enemies.compact.each { |enemy|
      if enemy.category_ids.include?(@category) && !$game_system.mamc_hide_ary.include?(enemy.id)
        b += 1
        a += 1 if $game_system.mamc_data_conditions_met?(MAMC_CONFIG[:complete_when], enemy.id)
        $game_variables[28] = a
        $game_variables[29] = b

      end
    }
    return a, b
  end

Seems to work just fine, too. Is there anything I would be overlooking?

modern algebra

That will work fine, but mind you, the variables will only update when that method is called, which I believe it is when one of the windows is shown. So, whenever the player kills a new monster, those variables will be off until he or she actually checks his or her catalogue.

Caveras

That's correct. I'm only using the variables for something like a summary window, so that's alright. Thanks for the quick reply!

modern algebra

Then it should be fine. Ordinarily, it wouldn't be good practice to rely on global variables changed in an unrelated method in some other class, but where you're just doing a rough patch, it is fine. What I should have done was keep an array and just updated it when a new monster was completed. Calculating it like that everytime is a waste. But for now, it's how I did it.

Brady

Is there any reason why the species icon wouldn't be showing up underneath the name?

I put in all the species id's in the noteboxes, but it just doesn't show up at all:
http://rpgmaker.net/games/4865/images/35284/

Also, (but not really important, but possibly relevant) when I checked the "show icon next to enemy name" line, the icon was persistently species #5, no matter what the enemy notetag had it as.

Not a huge thing; just something that's been bugging me mainly since I just can't figure out why.  Can live without it though, if it's some complicated problem; other than that, loving the script.  Nice and simple, looks clean and concise and I oh-so-love plug'n'play scripts!

modern algebra

#85
It looks like it was an error in my instructions. The noteboxes should use:

\species[n]

not:

\species_id[n]

Brady

Ah, such a simple thing. 

Cheers for the fix, and cheers again for the pretty script :)

stucko

Hey modern algebra. I was just wondering if you might be able to make a script that's similar to this, but is used to keep track of the treasure chests that you've collected in the game. Instead of a list, it would be small boxes in rows along the screen. While the chest hasn't been opened, it's entry would have question marks, just like the monster catalogue, but when you open the chest, the question marks will be replaced with the name of the item found in it. I've been looking for a script like this for ages, but haven't had any luck. This was featured in Kingdom Hearts II, and i've really enjoyed the whole collection side quest part of games. This is just an thought, and not an actual request, so I thought I'd post it here instead of the script requests.

Caveras

Quote from: stucko on May 16, 2013, 11:50:10 AM
Hey modern algebra. I was just wondering if you might be able to make a script that's similar to this, but is used to keep track of the treasure chests that you've collected in the game. Instead of a list, it would be small boxes in rows along the screen. While the chest hasn't been opened, it's entry would have question marks, just like the monster catalogue, but when you open the chest, the question marks will be replaced with the name of the item found in it. I've been looking for a script like this for ages, but haven't had any luck. This was featured in Kingdom Hearts II, and i've really enjoyed the whole collection side quest part of games. This is just an thought, and not an actual request, so I thought I'd post it here instead of the script requests.

Gambit just released something like that in the other forum: http://www.rpgmakervxace.net/topic/15788-gambit-icon-list/ =)

rubydragon44

Is there a possibility that you could make it so that the user can scroll through the description text of an enemy, say with like Insert-Delete, Home-End, Page Up-Page Down?
You've done 'scroll description text on another script before.
Reason being is that I'd like to have more room for just 2 lines of description, simply because there's often just more to say than that.
Perhaps?

rubydragon44

#90
 ::)Say? I, as well as i'd think some others, have more to say than the text space limit you've imposed. Things like habitat, time of day/ seasons it appears, things like strategies that it changes to (like a healer strategy when in the presence of lesser allies versus a striker strategy when actors are gaurding to break guard, i would want to describe these things), special characteristics like heals from thunder, has a very high critical hit ratio, drops and stealable items, types of attacks it uses...
The default doesn't give you enough room to put all that. I'd say it's not very trivial of request.

rubydragon44

Or does this sound trivial to you?

yuyu!


[Spoiler=My Games and Art]
ℒℴѵℯ❤


My Artwork Thread

The Lhuvia Tales [Current]

Ambassador [Complete]

The Postman [Complete]

The Wyvern [Complete]

Phoenix Wright: Haunted Turnabout [Complete]

Major Arcana [Cancelled]

[/Spoiler]

&&&&&&&&&&&&&

Hey rubydragon44. Please stop PM'ing me naked photographs of yourself. Being as I am only 14 years of age (well turning 15 ;o) this is illegal in most countries.

Thank you.
&&&&&&&&&&&&&&&&

rubydragon44

I'm not PMing anyone. Huh? How would my account be hacked? And idk I think if you're going to give the ability to descibe an enemy and if there's enemies with more complicated traits then I'd say more than just a couple lines would be needed

&&&&&&&&&&&&&

I understand that people have their own tastes, but I don't understand why you would insert a smurf doll into your, hmmm...

Anyway, I've already asked you to stop sending me those photos. If this continues, I'll be forced to contact the moderators of the forum.
&&&&&&&&&&&&&&&&

rubydragon44

#96
Am I being trolled? I have no messages and I see no sent box to confirm that my account has sent any messages. That and I don't know how to change my password.
-I changed my password. I have sent nothing.

yuyu!

Quote from: rubydragon44 on November 22, 2013, 01:00:40 AM
Am I being trolled?

Yes.

Quote from: rubydragon44 on November 22, 2013, 12:54:35 AM
And idk I think if you're going to give the ability to descibe an enemy and if there's enemies with more complicated traits then I'd say more than just a couple lines would be needed

Now to be serious. You're coming across as rather demanding, dude. At least be nicer when asking someone to dedicate their time into making something better for you.

[Spoiler=My Games and Art]
ℒℴѵℯ❤


My Artwork Thread

The Lhuvia Tales [Current]

Ambassador [Complete]

The Postman [Complete]

The Wyvern [Complete]

Phoenix Wright: Haunted Turnabout [Complete]

Major Arcana [Cancelled]

[/Spoiler]

Irock

Okay, I just got an an obscene image from rudy in my inbox too.

yuyu!

Oh.

I, a humble moderator, should do something about this!!


* yuyubabe does something about this.

[Spoiler=My Games and Art]
ℒℴѵℯ❤


My Artwork Thread

The Lhuvia Tales [Current]

Ambassador [Complete]

The Postman [Complete]

The Wyvern [Complete]

Phoenix Wright: Haunted Turnabout [Complete]

Major Arcana [Cancelled]

[/Spoiler]