Card Folder - XP

Started by TjtheFox, October 03, 2012, 01:52:27 am

Previous topic - Next topic

TjtheFox

October 03, 2012, 01:52:27 am Last Edit: October 03, 2012, 10:45:14 am by TjtheFox
Hello
Ive looked all over the sight for a script which is a bestiary.
But i want my game to be able to collect cards and open the folder and view the cards.
I dont wish to have a card battle system, just a book you open and you can view all the cards you have collected.
is that possible at all?

thank you

Memor-X

http://forum.chaos-project.com/index.php?topic=121.0 is a bestiary system here but the function your looking for would have to be added,

i'm assuming that when you said you want to be able to collect cards and open the folder to view the cards your talking about when you beat a monster you get a card which acts as a page for a bestiary which you view outside the game right? or are you talking about viewing the entries as cards in game in which case it would just be a window skin change to make the monster details window look like it's on a card (display the information differently would be slightly more involved but not impossible since it's just changing how the information is displayed

RoseSkye

He could just use pictures that look like cards within the bestiary.

TjtheFox

I added in that Bestiary script, it works only problem is I dont know how to have it show cards I receive,
it only shows monsters than you battle monsters. p.s. im using the more advanced bestiary with numbered slots,

KK20

Quote# enemy IDs from enemies, that are unknown (e.g. bosses), to make an enemy
# known use $game_system.enable(ENEMY_ID) through the event command
# "Call Script" to enable the display of information
Did you ever try to use that?

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

TjtheFox

I wouldnt even know to where to begin doing that, im fairly new at this like im not an amateur but im not a pro either

Memor-X

Quote from: KK20 on October 03, 2012, 11:13:13 pm
# enemy IDs from enemies, that are unknown (e.g. bosses), to make an enemy
# known use $game_system.enable(ENEMY_ID) through the event command
# "Call Script" to enable the display of information


Quote from: TjtheFox on October 04, 2012, 05:28:33 am
I wouldnt even know to where to begin doing that, im fairly new at this like im not an amateur but im not a pro either


most scripts here (if not all) have clear instructions at the top and bellow them is a configuration part to the script where you just add/remove/change some values

in order to use
$game_system.enable(ENEMY_ID)

the easiest way is to use the Call Script event command (i think it's on the third page) and past that line in replacing ENEMY_ID with the ID of the enemy you want from the Enemy Tab in the Database (right next to each enemy is a series of 4 numbers starting at 0001, that's the enemy id), if you want players to find cards and not buy them, you can simply do this in an event


Condition Branch: Local Switch A is OFF
    Call Script: $game_system.enable(ENEMY_ID)
    Change Local Switch: A to ON
End


in English, when you got to activate an event, it checks if it's Local Switch A is on, if not, it then calls the function $game_system.enable(ENEMY_ID) (replacing ENEMY_ID with the ID of the monster) then turns Local Switch A to on so that if you want to trigger the event again it wont repeat the code again

if you however want players to buy the cards i do have a way but this method is very inefficient so it does need refining

in Blizzard's script set it so every monster is disabled so that if you kill any of them their information will not show up, to do this find
ALL_UNKNOWN = false

and change false to true

next, we create an item for every monster you want a card off, after you created your cards, create a Common Event, set it as a Parallel Process and select a switch to turn it on and off, now in there create the following Event Commands


Condition Branch: Item [ID] is in inventory
    Call Script: $game_system.enable(ENEMY_ID)
    Remove Item: [ID]
End


in English, if Item [ID] (a particular card, say Goblin Card) is owned, then called the function $game_system.enable(ENEMY_ID), then remove that very same item. repeat this code for every card changing ID and ENEMY_ID each time

now this is, as i already stated inefficient, foir the following reasons
- i'm utilizing the default item system in RPG Maker XP and the Item and Enemy Databases have the exact same maximum size so as such if you had 9999 enemies you will need 9999 items which measn you will have no room for normal items (ARCed will solve that when it's out)
- if you sell the cards in a shop, a player can buy 99 of them and waste money, as the item is removed they can keep wasting money like that (though the player is an idiot if they don't realize this sooner)
- it'll take forever to set up if you have a lot of enemies, trust me, i'm trying to make 5,000 skills which only a slight difference between them and it's a major pain in the ass (would like to do SQL injection or something like that with the database files to speed it up, got programs that can generate it for me)

however, this is the basic idea of what you want to pull off using Blizzard's script, ideally what you would want if you want to sell cards is a custom shop which when you buy an item, a variable relating to that item is changed from false to true and you would be checking that in a Common Event of Script however though i have a rough idea on that i have by no means the skills to script it, someone like KK20 could do that

KK20

Quote
Condition Branch: Local Switch A is OFF
    Call Script: $game_system.enable(ENEMY_ID)
    Change Local Switch: A to ON
End

You actually don't need to make a conditional check--the method enable already prevents duplicates from being added.

As for making cards an item, that will definitely be tedious. Best way is to probably script the whole thing and not eat up all the spaces in the item database. Sounds like a good script for the Script Database.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

G_G

A script wouldn't be too hard at all. Here's my idea.

First, since these items are cards and will be used to unlock items in the bestiary, they should only be using a few attributes. Name, description, icon, price, occasion. This leaves a numerous amount of attributes we can use to utilize this. We could use Recover HP for Enemy ID. Make all cards call the same common event. This common event will have a script snippet, more on that later. Make a slight mod to Game_Temp and Scene_Item. Add an attribute to Game_Temp called "common_event_item".
class Game_Temp
 attr_accessor: common_event_item
end

Then in Scene_Item we'll mode these lines.
        if @item.common_event_id > 0
         # Common event call reservation
         $game_temp.common_event_id = @item.common_event_id
         # RIGHT HERE
         $game_temp.common_event_item = @item
         # Switch to map screen
         $scene = Scene_Map.new
         return
       end

This will allow us to use the item in script calls now. So in this common event, we can have a script call that grabs the Recover HP parameter from the item and use it to add the enemy to the bestiary.
item = $game_system.common_event_item
$game_system.enable(item.recover_hp)


This is the simplest solution I can think of without heavy scripting modifications.