Charas-Project
Game Creation => Requests => RPG Maker Programming => Topic started by: Linkforce on May 01, 2007, 03:06:16 AM
-
Okay, well, here's my problem.
There are many different save points in my game, and one of them involves the ability to revive a fallen party member. But only once per save point of that kind. But that's just detail.
Basically, I need to have a system that displays a choice of what character you want to revive. But only for characters who are down, and are currently in your party. I got half of this down, but I cant make it list all the available choices at once. Can anyone help?
-
You'll need a shitload of condictional forks seeing if a character is in the party or not, and then if they are dead or not, and then if other people are dead or not.
Really, this isn't worth it because you'll need so many forks. If this is just a one time use like you say, it would be better to just put a revival item in a chest next to the save point.
-
Hm....you raise a good point. Perhaps I'll just make it see if any character is dead...and then an item appears. Coolness. Thanks.
-
Err yeah, making all those show choice commands wouldn't be worth it, it'd be easier to make a custom system for this.
Basically test for which character is in your party and dead like this.
If hero 1 is in party
-If hero 1 is dead
-- swith [hero1 dead] turn on
-else hero1 dead turn off
else hero1 dead turn off
Do it for every hero.
Then display a menu box somwhere, and list everyone who is dead in that menu (it'd be easiest to make it just one big box instead of a smaller scrolling box). And you go from there.
This is basically gonna be a very simple cms, if you need help with it, let me know.
-
Meh, you guys are thinking the brute-force approach. For this sort of thing I use hero names.
Say there are 10 heroes. Heros 11, 12, and 13 are left blank as names. You need only three since there can only be a total of three possible dead people in the party (four = game over!) You then run through the checking of heroes something like...
If Skylar is in party
- If Skylar is dead
- - Hero name 11 = Skylar
- - Variable DeadChara1 = 1 (1 for Skylar being the first hero on the list)
If Bob is in party
- If Bob is dead
- - If DeadChara1 = 0 (to prevent it from writing over Skylar)
- - - Hero name 11 = Bob
- - - Variable DeadChara1 = 2
- - Else
- - - Hero name 12 = Bob
- - - Variable DeadChara2 = 2
The benefit of doing it this way is that you only need ONE show choices box, referncing the names you made for heroes 11, 12, and 13.
Show choices
[n11]
If DeadChara1 = 1
- Full heal Skylar
If DeadChara1 = 2
- Full heal Bob
[n12]
If DeadChara2 = 2
- Full heal Bob
etc...
[n13]
etc...
Works pretty snazzy.
-
Originally posted by SaiKar
Meh, you guys are thinking the brute-force approach. For this sort of thing I use hero names.
Say there are 10 heroes. Heros 11, 12, and 13 are left blank as names. You need only three since there can only be a total of three possible dead people in the party (four = game over!) You then run through the checking of heroes something like...
If Skylar is in party
- If Skylar is dead
- - Hero name 11 = Skylar
- - Variable DeadChara1 = 1 (1 for Skylar being the first hero on the list)
If Bob is in party
- If Bob is dead
- - If DeadChara1 = 0 (to prevent it from writing over Skylar)
- - - Hero name 11 = Bob
- - - Variable DeadChara1 = 2
- - Else
- - - Hero name 12 = Bob
- - - Variable DeadChara2 = 2
The benefit of doing it this way is that you only need ONE show choices box, referncing the names you made for heroes 11, 12, and 13.
Show choices
[n11]
If DeadChara1 = 1
- Full heal Skylar
If DeadChara1 = 2
- Full heal Bob
[n12]
If DeadChara2 = 2
- Full heal Bob
etc...
[n13]
etc...
Works pretty snazzy.
You could simplify that by getting rid of the DeadChara variables. Simply check if what the hero name is, hero names can be used very much like strings. :p
Show Choices \n[11] | \n[12] | \n[13]
[\n[11]] Case
>If Hero11 = "Skylar" then
>>Revive Skylar
>If Hero11 = "Bob" then
>>Revive Bob
[\n[12]] Case
>If Hero12 = "Skylar" then
>>Revive Skylar
>If Hero12 = "Bob" then
>>Revive Bob
[\n[12]] Case
>If Hero12 = "Skylar" then
>>Revive Skylar
>If Hero11 = "Bob" then
>>Revive Bob
-
Good call Daetyrnis, forgot you can check that. That cuts down on things a little bit. I've been mucking around with the battle system lately and the conditional branch in battle doesn't have that option.
-
Originally posted by SaiKar
Good call Daetyrnis, forgot you can check that. That cuts down on things a little bit. I've been mucking around with the battle system lately and the conditional branch in battle doesn't have that option.
You could always call a common event. Using those you can do pretty much anything in battle.
-
Originally posted by Daetyrnis
Originally posted by SaiKar
Meh, you guys are thinking the brute-force approach. For this sort of thing I use hero names.
Say there are 10 heroes. Heros 11, 12, and 13 are left blank as names. You need only three since there can only be a total of three possible dead people in the party (four = game over!) You then run through the checking of heroes something like...
If Skylar is in party
- If Skylar is dead
- - Hero name 11 = Skylar
- - Variable DeadChara1 = 1 (1 for Skylar being the first hero on the list)
If Bob is in party
- If Bob is dead
- - If DeadChara1 = 0 (to prevent it from writing over Skylar)
- - - Hero name 11 = Bob
- - - Variable DeadChara1 = 2
- - Else
- - - Hero name 12 = Bob
- - - Variable DeadChara2 = 2
The benefit of doing it this way is that you only need ONE show choices box, referncing the names you made for heroes 11, 12, and 13.
Show choices
[n11]
If DeadChara1 = 1
- Full heal Skylar
If DeadChara1 = 2
- Full heal Bob
[n12]
If DeadChara2 = 2
- Full heal Bob
etc...
[n13]
etc...
Works pretty snazzy.
You could simplify that by getting rid of the DeadChara variables. Simply check if what the hero name is, hero names can be used very much like strings. :p
Show Choices n[11] | n[12] | n[13]
[n[11]] Case
>If Hero11 = "Skylar" then
>>Revive Skylar
>If Hero11 = "Bob" then
>>Revive Bob
[n[12]] Case
>If Hero12 = "Skylar" then
>>Revive Skylar
>If Hero12 = "Bob" then
>>Revive Bob
[n[12]] Case
>If Hero12 = "Skylar" then
>>Revive Skylar
>If Hero11 = "Bob" then
>>Revive Bob[/B]
I'm very confused. X_X
-
*Ahem* Can someone help? Maybe elaborate more? Or put a step by step sorta thing please?
-
Okay, first of all, you should realize that there should only be a maximum of three dead heroes in your party, after all, if all four are dead, the game is over!
Now, let us presume that you have 10 heroes in your game, doesn't matter if they're in your party, just know how many are in your game (in the heroes tab in the database). Now, we shall make three extra heroes, which we will only be using to store a string.
A string is much like a variable, the only difference is that instead of storing numerical values, strings hold letters. Essentially, strings hold words, such as names!
So, you should already know about the change hero name command, right? What you may or may not know about is that you can check if a certain hero's name is equal to something, using conditional forks. Create a conditional fork, and go to the second tab. You should see an option "Hero", which when clicked will have a drop-down menu for which hero to inquire about, and another menu (which you click the [...] button to go to) to decide what to check. One of these is "Hero name is equal to [_______], or something like that. Make sense?
Now, on to the actual implementation!
The first thing you need to do is create the three extra heroes. While what you name them is not important per say, just make it something easy to remember. For this tutorial we shall name them HERO1, HERO2, and HERO3 (simple enough). You should also note their ID number. Assuming that you already have 10 heroes, these heroes will be 11, 12, and 13 respectively.
The first thing to do in your save event is to reset these hero names to what they were in the first place, for example, set HERO1's name to HERO1, HERO2's name to HERO2, and HERO3's name to HERO3. We change them in this event, so we need to reset them so the event works properly every time. You can also do this reseting at the end of the event, either way works (just remember to do it!).
The next thing to do is to determine which heroes have kicked the bucket. This concerns your actual characters, which for the purpose of the tutorial we will have 5 (too lazy to write out 10 ) heroes. They shall be Adam, Barry, Carl, Diane, and Edith. We first check if each hero is in the party, and then if they are dead.
<>If hero Adam is in Party
    <>If hero Adam HP is 0
        <>
    <>End if
<>End if
The we check if HERO1's name is HERO1. Why? Well, say our party is our first four people, with Adam, Barry, and Carl being dead. We would change HERO1's name to Adam (for later), but we need to make sure that Barry's name isn't inserted into HERO1. If HERO1's name is still HERO1, then nobody's name is in it! We do this for our first two pseudo-heroes, since only three heroes can be dead, so if the first two spots are taken, they must need the third. Anyways, we put the given hero's name into the first free space.
<>If hero Adam is in Party
    <>If hero Adam HP is 0
        <>If HERO1 name is HERO1 then
            <>HERO1: name = Adam
        <>ELSE
            <>If HERO2 name is HERO2 then
                <>HERO2: name = Adam
            <>ELSE
                <>HERO3: name = Adam
            <>End if
        <>End if
    <>End if
<>End if
We repeat this for each character (adjusting to their actual name of course), which results in HERO1, HERO2, and HERO3 containing the names of your dead people. After this we have a simple choice given to the player (notice how we use \n[X] to show the names of the dead people, which are held in heroes 11 - 13).
<>Show Message: Which party member would you like to revive?
<>Show Choice: [\n[11]] | [\n[12]] | [\n[13]]
<>[\n[11]] Case:
    <>
<>[\n[12]] Case:
    <>
<>[\n[13]] Case:
    <>
Then we merely check who's name is held in HERO1, HERO2, and HERO3, and heal them. ^_^ (this is just for \n[11], or HERO1)
<>[\n[11]] Case:
    <>If HERO1 name is Adam then
        <>Adam: Revive
    <>Else if HERO1 name is Barry then
        <>Barry: Revive
    <>Else if HERO1 name is Carl then
        <>Carl: Revive
...
You get the point?
-
Originally posted by Daetyrnis
<>If hero Adam is in Party
<>If hero Adam HP is 0
<>If HERO1 name is HERO1 then
<>HERO1: name = Adam <------Confused over here
<>ELSE
<>If HERO2 name is HERO2 then
<>HERO2: name = Adam
<>ELSE
<>HERO3: name = Adam
<>End if
<>End if
<>End if
<>End if
We repeat this for each character (adjusting to their actual name of course), which results in HERO1, HERO2, and HERO3 containing the names of your dead people. After this we have a simple choice given to the player (notice how we use n[X] to show the names of the dead people, which are held in heroes 11 - 13).
<>Show Message: Which party member would you like to revive?
<>Show Choice: [n[11]] | [n[12]] | [n[13]]
<>[n[11]] Case:
<>
<>[n[12]] Case:
<>
<>[n[13]] Case:
<>
Then we merely check who's name is held in HERO1, HERO2, and HERO3, and heal them. ^_^ (this is just for n[11], or HERO1)
<>[n[11]] Case:
<>If HERO1 name is Adam then
<>Adam: Revive
<>Else if HERO1 name is Barry then
<>Barry: Revive
<>Else if HERO1 name is Carl then
<>Carl: Revive
...
You get the point?
Sorry, its been a while, but I'm stuck.
-
Pleeeeeeaaaaase?!?!?!
-
*Ahem*
-
:p Linkforce, they've helped you loads. You're just going to have to take some real effort to understand the posts above. You're a regular user of rm2k3, I can't see why you won't be able to work it out by really reading them carefully and messing about with some eventing.
-
Well you were right Moose, and I figured it out. It works great! :D Thanks a lot Daetyrnis! :D