Was wondering about a unique capture system I hope I can explain well enough. Maybe you can give me an idea about how this might get event/scripted? I have done a fair amount of eventing now and completed woodcutting, fishing, stores, npcs, growing plants with changing graphics, pokemon encounter grass.
Well the idea is that there would be areas with traps. Based on which bait is placed into the trap a monster may or may not be trapped randomly picked from a list. Player than chooses to catch or release the monster. If caught add to party (check for space) and if full send to storage.
Doesn't sound too incredibly difficult similiar to the fishing with setting up the wait and random select events. What I need help with is how to add the monster to party or send to storage if party is full when captured and player checks it. Adding an option to keep or release will be simple its after that where I get lost. Any help is much appreciated thank you everyone.
Here is a link to the file of what I started. It's my first time trying to event something without a tutorial so i apologize for any newbie mistakes.
Tsukihime
Nov 19 2011, 04:20 PM
Here's an outline of how I would implement it. Event means that you can just make an event for it. Scripted event means that your event will call scripts
outline
1: player approaches trap area (as an event) [Event]
2: player chooses bait to set (implementation based on the demo) [Event]
3: set the bait (need to store the bait item number somewhere, maybe a variable) [Scripted event] -note here that you will need to decide on a couple things. Will the bait still be there when you leave the map? How many trap areas will you have to keep track of?
4: when a monster touches the event, run a script that will determine whether the monster is caught or not. A possible implementation would be as follows: [Scripted event] -each bait comes with a base success rate. So for example a "weak" bait might have a base success rate of 10%, whereas a "stronger" bait may have a base success rate of 20%. -Naturally, each monster may have "preference" for certain types of bait. Perhaps if a monster really likes "apples" then the success rate increases by 50% for that monster. On the other hand, perhaps a monster hates "oranges", and so if that monster touched the trap, the success rate might go down by 50% just because the monster is uninterested. -a random number between 0 and 100 is generated -If base_success_rate + "preference" + random_number is greater or equal to 100, then the monster is caught. Otherwise, it got away. For simplicity, we treat each value as a percent.
5: Let's just assume, for simplicity, that the monster will always eat the bait, even if it doesn't like it. If the monster got away, go back to step 1. Otherwise, proceed to step 6. [Scripted event]
6: The monster is now caught. When the player approaches it, you may choose to keep it, or release it. [event]
7: If released, then go back to step 1, otherwise proceed to step 8
8: check whether the player's party has enough room for the monster [Scripted event] -If the player has room, then add it to the party [Event] OR [Scripted event] -If the player doesn't have room, add it to storage [Scripted event]
9. Done. Go back to step 1.
From what you've said and what you've done in the demo, you can tell that the steps that say [event] are all pretty simple and what you've already done.
The scripted events are not difficult. You just need to know the syntax, and it would be a matter of calling functions.
You will need to determine how you will manage the bait in the database. Easiest way would be to just create some bait, and then just reference them by index (eg: BAIT_ITEMS = [1, 8, 13, 23])
You will need a way to store some parameters for each bait. These can be constants in an array, where the indices correspond to the indices of each element in BAIT_ITEMS (eg: BASE_SUCCESS = [10, 20, 35, 40], corresponding to the items from above)
You may need an array to store monster preferences, again using monster's index as reference.
Then you just need a method to calculate success rate, which I've presented a possibility.
You will need a way to determine which monster actually touched the trap. I am not sure how it would be done and could be quite complicated. Perhaps checking the event name? or maybe a comment in the event? Those seem like common practices for checking whether an event satisfies a certain property.
A function "captured?" will look like the following, returning a boolean.
CODE
def captured? monster = get_monster_ID() b = get_base_success() p = get_preference_modifier() rn = make_random_number() return s + p + rn >= 100
The function would be called by the trap whenever a monster touches it (so like, trigger on event touch, if captured?, do stuff) If it's captured, you will somehow force the monster to stop moving (change it's move route, etc.)
For the party itself, you might write a short function that will handle this.
CODE
def what_to_do_with(monster_id) check if party is full if not full, add it to party (party.gain(monster_id) else, add_to_storage(monster_id)
Now the real problem is designing the HUD. It would be really convenient if there was some existing code that you could quickly modify and test on, such as a party switch menu.
dreads94
Nov 21 2011, 08:19 AM
That makes sense with the percentage to check if caught. The monsters aren't seen by the player except in battle though so them touching the trap to trigger it becomes more difficult.
If i was outlining what I want to try and make happen it would look like this.
1: player approaches trap area (as an event) [Event]
2: player chooses bait to set (implementation based on the demo) [Event]
3: set the bait (need to store the bait item number somewhere, maybe a variable) [Scripted event] Will the bait still be there when you leave the map? Would this slow the game down and how much harder is it to implement? How many trap areas will you have to keep track of? Uncertain depends on how many can be run without sacrificing performance. Hoping for 6-10.
4:Wait example 5minutes (player can run through battles etc and check it later)
5: Run script or event to "roll dice" based on an example of results here for Chunk of Meat:
5: If monster is caught give player choice Keep or Release.
6: If released, then go back to step 1, otherwise proceed to step 8
7: check whether the player's party has enough room for the monster [Scripted event] -If the player has room, then add it to the party [Event] OR [Scripted event] -If the player doesn't have room, add it to storage [Scripted event]
8. Done. Go back to step 1.
More or less monsters could be placed per bait simply by adding more numbers to the "dice". I think it will be something with variables but I dont fully understand how they could work and I am not entirely confident it can be done that way..
I hope this helps give a better idea on what I am trying to accomplish. Thanks Tsukihime for such a detailed and well thought out answer. If i make a ABS game ill have to remember that
dreads94
Nov 21 2011, 02:51 PM
Ok so i played with the events some more after writing out the steps I wanted in your outline Tsukihime and cleaned it up alittle. For now it only uses chunk of meat but is a working system. Right now it is 25% chance Crocodile, 25% Vampire and 50% Empty. Seems like it catches monsters alittle to often but with a few more variables I should be able to change that. All that I need to do now is figure out how to check party and if full send to storage.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.