Pathos Prime 9 Posted January 31, 2014 Having problems with this script. Any time I try to open the bestiary, I get the error: Script 'Bestiary' line 1060: TypeError occured. nil can't be coerced into Fixnum And any time I defeat an enemy, I get the error: Script 'Bestiary' line 812: NoMethodError occured. undefined method '[]' for nil:NilClass Am I doing something wrong? Share this post Link to post Share on other sites
Shadowmaster9000 57 Posted January 31, 2014 Having problems with this script. Any time I try to open the bestiary, I get the error: Script 'Bestiary' line 1060: TypeError occured. nil can't be coerced into Fixnum And any time I defeat an enemy, I get the error: Script 'Bestiary' line 812: NoMethodError occured. undefined method '[]' for nil:NilClass Am I doing something wrong? If you're trying the script with a previously existing save file, it's trying to access stuff that doesn't exist as some data related to the Bestiary is only generated when you start a new game. So unfortunately if you want to test out the Bestiary you need to do it with new save files. Share this post Link to post Share on other sites
Pathos Prime 9 Posted January 31, 2014 Ah, so I see. Tried that and it works now. Now I have a question for you. There is a character in my game, let's call him the "monsterologist." He's the one who "gives" you the bestiary to begin with. (i.e. talk to him, flip a switch, let Yanfly's Menu script take care of the rest.) Now, what I'd like to have him do is give you prizes for completing parts of the Bestiary. At the very least, I'd like him to be able to sense when you've completed 10%, 50%, and 100% of the Bestiary. Is there a way for me to take an in-game variable and have it be equal to the Bestiary completion percentage? I can see that I can go the other way - define an in-game variable and have the Bestiary display THAT number instead of the actual completion percentage. Ideally, I'd like to be able to go more complicated - say, have him give you a prize for defeating one of every "bird" type enemy, one of every enemy in dungeon X, etc. Share this post Link to post Share on other sites
Shadowmaster9000 57 Posted January 31, 2014 Ah, so I see. Tried that and it works now. Now I have a question for you. There is a character in my game, let's call him the "monsterologist." He's the one who "gives" you the bestiary to begin with. (i.e. talk to him, flip a switch, let Yanfly's Menu script take care of the rest.) Now, what I'd like to have him do is give you prizes for completing parts of the Bestiary. At the very least, I'd like him to be able to sense when you've completed 10%, 50%, and 100% of the Bestiary. Is there a way for me to take an in-game variable and have it be equal to the Bestiary completion percentage? I can see that I can go the other way - define an in-game variable and have the Bestiary display THAT number instead of the actual completion percentage. Ideally, I'd like to be able to go more complicated - say, have him give you a prize for defeating one of every "bird" type enemy, one of every enemy in dungeon X, etc. There's a way of doing the former (checking for percentage in Bestiary) with eventing. @>Control Variables: [0001] = $game_party.enemies_found @>Control Variables: [0001] *= 100 @>Control Variables: [0001] /= $game_party.enemies_total Unfortunately there's no way I know of doing the latter without updating the script because I messed up on giving an array the same name as a function so that is something I need to fix. Share this post Link to post Share on other sites
Apostrophe 2 Posted February 1, 2014 Oh, good. You're still around. @>Control Variables: [0001] = $game_party.enemies_found @>Control Variables: [0001] *= 100 @>Control Variables: [0001] /= $game_party.enemies_total I'm not a coder, but based on searches I've found since I read the above, I imagine that I could do the same from within a script with the following?: $game_variables[1] = $game_party.enemies_found$game_variables[1] *= 100$game_variables[1] /= $game_party.enemies_total Is there a place where it could be inserted into your script to do this? My issue is that I need the variable up-to-date with the percentage before the user saves their game. Since I can't predict when a user will open the menu and go to save, I can't make the variable update via an event... Not to be a pest, but do you have any input on my other question from above, on how to get the Bestiary to work with Yanfly's New Game+ so that it doesn't wipe the bestiary every time the player starts a new game? This is the only issue really holding me up as far as finishing my game, and I'm pretty clueless when it comes to RGSSx. Share this post Link to post Share on other sites
Pathos Prime 9 Posted February 1, 2014 (edited) Oh, good. You're still around. @>Control Variables: [0001] = $game_party.enemies_found @>Control Variables: [0001] *= 100 @>Control Variables: [0001] /= $game_party.enemies_total I'm not a coder, but based on searches I've found since I read the above, I imagine that I could do the same from within a script with the following?: $game_variables[1] = $game_party.enemies_found $game_variables[1] *= 100 $game_variables[1] /= $game_party.enemies_total Is there a place where it could be inserted into your script to do this? My issue is that I need the variable up-to-date with the percentage before the user saves their game. Since I can't predict when a user will open the menu and go to save, I can't make the variable update via an event... Doing it in the script, you could just make it one line, like: $game_variables[1] = (100*$game_party.enemies_found/$game_party.enemies_total) I've found the relevant lines within the script itself: 1059 if FantasyBestiary::Completion_Percent 1060 percent = (100*$game_party.enemies_found/$game_party.enemies_total) + $game_party.completion_bonus 1061 percent = $game_variables[FantasyBestiary::Completion_Variable] if FantasyBestiary::Completion_Variable > 0 1062 text = sprintf(FantasyBestiary::Completion_Name + "%1.0f%%", percent) 1063 else 1064 found = $game_party.enemies_found.to_s 1065 found = $game_variables[FantasyBestiary::Completion_Variable] if FantasyBestiary::Completion_Variable > 0 1066 total = $game_party.enemies_total.to_s 1067 text = FantasyBestiary::Completion_Name + found + "/" + total The script uses the word "percent" to define the same thing. Would it be possible to insert a line between 1061 and 1062 that reads something like: $game_variables[1] = percent Or even define a new thingy around like 360 where "Completion_Variable" is defined, that's like Completion_Ingame = whatever number the player wants to put here And then make the line between 1061 and 1062 $game_variables[FantasyBestiary::Completion_Ingame] = percent if FantasyBestiary::Completion_Ingame > 0 This would also let you add a line between 1065 and 1066 that reads: $game_variables[FantasyBestiary::Completion_Ingame] = found if FantasyBestiary::Completion_Ingame > 0 So the same thing would work for people who are using the "found out of total" completion marker instead of the "percentage." Judging from the syntax of Shadowmaster's code, this looks to me like it would work, but I know little about Ruby, so correct me if I'm wrong. Edited February 1, 2014 by Pathos Prime Share this post Link to post Share on other sites
Shadowmaster9000 57 Posted February 1, 2014 (edited) Ah I didn't notice the New Game Plus question. Doesn't seem like it should be too difficult to make an Add-On or it so I'll give it a go whenever I can get round to it. And no you don't need to script in what's below: @>Control Variables: [0001] = $game_party.enemies_found @>Control Variables: [0001] *= 100 @>Control Variables: [0001] /= $game_party.enemies_total Those are just commands from the eventing window because I felt too lazy to do a screenshot. 1) Go to Control Variables, set operation to 'Set' and operand to 'Script' then type in: $game_party.enemies_found 2) Go to Control Variable, set operation to 'Mul' and operand to 'Constant' then type in: 100 3) Go to Control Variables, set operation to 'Div' and operand to 'Script' then type in: $game_party.enemies_total BTW I tried putting in 100*$game_party.enemies_found/$game_party.enemies_total to begin with but sadly the box in Control Variables won't fit the whole thing in hence why I needed to split it up into 3 parts. Unfortunately it's not as simple as using the percent variable found in the refresh method under the Window_Completion class because it's a local variable that only exists whenever that method is running and will likely crash if you try to access it from elsewhere. Even if it didn't crash, the value would remain empty until the Bestiary was viewed, so if say you had an event that activated upon getting 50% completion, even if you did reach that number it wouldn't activate until you viewed the Bestiary. Edited February 1, 2014 by Shadowmaster9000 Share this post Link to post Share on other sites
Apostrophe 2 Posted February 1, 2014 (edited) Ah I didn't notice the New Game Plus question. Doesn't seem like it should be too difficult to make an Add-On or it so I'll give it a go whenever I can get round to it. Thanks, very much appreciated, I totally love the bestiary and really want to be able to include it. And no you don't need to script in what's below: @>Control Variables: [0001] = $game_party.enemies_found @>Control Variables: [0001] *= 100 @>Control Variables: [0001] /= $game_party.enemies_total Those are just commands from the eventing window because I felt too lazy to do a screenshot. 1) Go to Control Variables, set operation to 'Set' and operand to 'Script' then type in: $game_party.enemies_found 2) Go to Control Variable, set operation to 'Mul' and operand to 'Constant' then type in: 100 3) Go to Control Variables, set operation to 'Div' and operand to 'Script' then type in: $game_party.enemies_total Oh, I know they were just even commands. That method would work great if I was trying to talk to a character, or use another item, to display what the percentage number was. My issue is trying to automatically assign the variable the percentage number immediately after it changes without the use of an event. Yanfly's Ace Save Engine allows you to assign variables to display on your save file, and I'd like one of them to be the bestiary percentage completed. That means it always needs to be up to date, because for all I know, the player could defeat an enemy and then immediately save his progress. Unless there was a way to make a common event run whenever a player go to "Save" in his menu, I have no idea how to make it work outside of having it included in the actual script code itself. Edit: Fixed Typo Edited February 1, 2014 by Apostrophe Share this post Link to post Share on other sites
Jeffafa 0 Posted February 19, 2014 So here's a dumb question... It's related to a question above, but sadly it's quite primitive... lol Say that the Bestiary key item is received from a quest/treasure chest, etc... How would I set it so that the Bestiary option doesn't even appear in the menu until the Key Item (or whatever) is received? I know it's going to involve switches, but I can't figure it out on my own. I apologize for my lack of knowledge in this. :/ Share this post Link to post Share on other sites
Shadowmaster9000 57 Posted February 19, 2014 So here's a dumb question... It's related to a question above, but sadly it's quite primitive... lol Say that the Bestiary key item is received from a quest/treasure chest, etc... How would I set it so that the Bestiary option doesn't even appear in the menu until the Key Item (or whatever) is received? I know it's going to involve switches, but I can't figure it out on my own. I apologize for my lack of knowledge in this. :/ That's fine I don't think even I would be able to find out how with the current version because unfortunately I did not set the action of enabling access to the Bestiary to data that can be saved so it's a feature I'll have to add in future. Share this post Link to post Share on other sites
Jeffafa 0 Posted February 19, 2014 So here's a dumb question... It's related to a question above, but sadly it's quite primitive... lol Say that the Bestiary key item is received from a quest/treasure chest, etc... How would I set it so that the Bestiary option doesn't even appear in the menu until the Key Item (or whatever) is received? I know it's going to involve switches, but I can't figure it out on my own. I apologize for my lack of knowledge in this. :/ That's fine I don't think even I would be able to find out how with the current version because unfortunately I did not set the action of enabling access to the Bestiary to data that can be saved so it's a feature I'll have to add in future. Wow you're fast to respond haha. Thanks! And extraordinary script by the way! I love it! Share this post Link to post Share on other sites
ArkhamVI 1 Posted March 2, 2014 I do have a question, is it possible to modify this so it shows elemental absorption? Share this post Link to post Share on other sites
Shadowmaster9000 57 Posted March 2, 2014 If you don't mind forfeiting any of the other categories then yes you can change one of the existing categories to show elemental absorption. Share this post Link to post Share on other sites
Pathos Prime 9 Posted March 2, 2014 So here's a dumb question... It's related to a question above, but sadly it's quite primitive... lol Say that the Bestiary key item is received from a quest/treasure chest, etc... How would I set it so that the Bestiary option doesn't even appear in the menu until the Key Item (or whatever) is received? I know it's going to involve switches, but I can't figure it out on my own. I apologize for my lack of knowledge in this. :/ That's fine I don't think even I would be able to find out how with the current version because unfortunately I did not set the action of enabling access to the Bestiary to data that can be saved so it's a feature I'll have to add in future. Wow you're fast to respond haha. Thanks! And extraordinary script by the way! I love it! I did this using Yanfly's Ace Menu Engine. I added the bestiary under "Commands" as such: COMMANDS =[ :item, # Opens up the item menu. Default menu item. :skill, # Opens up the skill menu. Default menu item. :equip, # Opens up the equip menu. Default menu item. :status, # Opens up the status menu. Default menu item. :fantasy_bestiary, :save, # Opens up the save menu. Default menu item. :game_end, # Opens up the shutdown menu. Default menu item. Then, later in the script, under "Custom Commands," I put: CUSTOM_COMMANDS ={ # :command => ["Display Name", EnableSwitch, ShowSwitch, Handler Method], :fantasy_bestiary => [ "Bestiary", 82, 82, :command_fantasy_bestiary], So that Bestiary would appear in the menu once switch 82 was activated. Share this post Link to post Share on other sites
Thunderhawk 0 Posted April 7, 2014 Hey, just wanted to say that your scripts sounds like what I'm looking for, but I have a slight problem whenever I click any of the links to get to the script I get a 404ed page. I tried using multiple browsers and keep getting this problem. Is the website down? Or am I just doing something wrong? Share this post Link to post Share on other sites
Shadowmaster9000 57 Posted April 7, 2014 Yes unfortunately the website's down and is likely to not come back up until after 2 weeks time. The scripts might come back sooner if I do decide to upload the website back up in segments. Share this post Link to post Share on other sites
Shadowmaster9000 57 Posted April 13, 2014 Okay I have some good news, all of my scripts are back online now. Bad news is I haven't done any updates since then. =P Don't worry I still plan on adding new features to the Bestiary and my other scripts but I've been busy doing other things (like getting my website back online). Share this post Link to post Share on other sites
cazziuz 9 Posted April 13, 2014 I havent yet Dled the script , but it looks like something i am looking for , but before i do dl it , i need to know is it or would it be possible to add a creature from the bestiary to your party? , like the bestiary is at a central location ,not in your menu, and you flipped through the pages and found a beast you wanted to be in your party is there a way to add that beast to the party ? Share this post Link to post Share on other sites
Shadowmaster9000 57 Posted April 13, 2014 No I don't have that feature yet, I could try adding it but I don't know how difficult it will be. But one you can do is you can disable the Bestiary from being accessed in the menu and you can use the below script call in an event: SceneManager.call(Scene_Bestiary) Share this post Link to post Share on other sites
cazziuz 9 Posted April 13, 2014 Yeah i tried that , that part works great , now if i could figure out how to add a creature to the party from the book i would be set ,lol thanks for your help Share this post Link to post Share on other sites
+ DarthVollis 59 Posted April 13, 2014 There is a creature recruitment script out there. Try it. Share this post Link to post Share on other sites
cazziuz 9 Posted April 13, 2014 Thanks ill see if i can find it , thank you again Share this post Link to post Share on other sites
+ DarthVollis 59 Posted April 13, 2014 There is an Event Monster Capture System. It can be found here : http://www.rpgmakervxace.net/topic/9793-event-monster-capture-system/ Here is a scripted system. http://www.rpgmakervxace.net/topic/3905-monster-hunter/ Share this post Link to post Share on other sites
cazziuz 9 Posted April 13, 2014 Again thank you , i really dont think i would have been able to find then with out hours of searching , at least thats what the time normally feels like Share this post Link to post Share on other sites
+ DarthVollis 59 Posted April 13, 2014 I just Googled what I was looking for. Hope that helps. Share this post Link to post Share on other sites