Hi I wanted to find out is it possible to create an item (similar to a Zelda Fairy) that revives a party member on use, but also is automatically used when all members of the party are knocked out? Does this have to be a plugin? Is there a plugin available that already does this? The idea was that I wanted to make 2 in game items that would be able to do something similar to this. One would be a 'revive one' item and would be able to revive one character, but if not used before the whole party is knocked out would revive one character (preferable the main character). The other would be a 'revive all' item that would do the same thing except in terms of reviving all of the party and automatically reviving all on full knockout. Both of these items would bring whatever revived characters to full stats (HP, Mana, Ex.) as well. I'm sure there must be a way to do something like this I just don't know how to do it myself. Any help is appreciated. Thank you very much for your time.
Revival Item
RPG Maker MV SupportThe way I can think of to do this is:
- At the beginning of each battle have a troop event apply an immortal state to each actor
- Have a troop event check for any actor to have no HP. Then, in that event:
-- See if there are other actors still alive. If yes, let this actor die. If no, try to use this item.
You could also do it using a passive state reacting to incoming damage, but going that method would require you to know/look up all of the JavaScript to do the above, rather than just using event commands in troop events.
- At the beginning of each battle have a troop event apply an immortal state to each actor
- Have a troop event check for any actor to have no HP. Then, in that event:
-- See if there are other actors still alive. If yes, let this actor die. If no, try to use this item.
You could also do it using a passive state reacting to incoming damage, but going that method would require you to know/look up all of the JavaScript to do the above, rather than just using event commands in troop events.
How do you have an event check for 0 HP?
So I tried to figure out how to put in the conditional branches, but I do believe I just got myself very confused. Reading it back it makes sense to me, but instead of working when you went into battle it just froze.
I had pages 2 and 3 activated by switches and left page 1 blank with the don't run condition.
Then put the Actor's Hp condition like you showed me. Next I put the if party has item then check actors' Hp. I could figure out how to have it check for the actors' Hp all simultaneously so I put them in conditionals one after the other. I then repeated this format until I had all the possible combinations that they could die in so that hopefully I had all my bases covered.
I should explain that in my game I have two possible characters that you can start out with. In no point during the game do you have both of these characters, but you do get three other characters in your party by the end of the game.
I basically repeated what I did on page 4 on page 5, but replaced the instants where it would be specific to Actor 1 to Actor 2.
Page 6 I did the same, but since characters 3 - 5 don't actually do anything if you only have the revive 1 item I just included the conditionals for if the party had the revive all item. Again I repeated this in ever combination so as not to miss any then repeated what I did on page 6 on pages 7 and 8 for their respective actors.
I'm afraid I have gotten myself completely lost and that all of this work I just put in was a waste. I'm sure there must be a simpler way to do this I'm just clueless as to how to do it. Again any help is appreciated and thank you for your time.
I had pages 2 and 3 activated by switches and left page 1 blank with the don't run condition.
Then put the Actor's Hp condition like you showed me. Next I put the if party has item then check actors' Hp. I could figure out how to have it check for the actors' Hp all simultaneously so I put them in conditionals one after the other. I then repeated this format until I had all the possible combinations that they could die in so that hopefully I had all my bases covered.
I should explain that in my game I have two possible characters that you can start out with. In no point during the game do you have both of these characters, but you do get three other characters in your party by the end of the game.
I basically repeated what I did on page 4 on page 5, but replaced the instants where it would be specific to Actor 1 to Actor 2.
Page 6 I did the same, but since characters 3 - 5 don't actually do anything if you only have the revive 1 item I just included the conditionals for if the party had the revive all item. Again I repeated this in ever combination so as not to miss any then repeated what I did on page 6 on pages 7 and 8 for their respective actors.
I'm afraid I have gotten myself completely lost and that all of this work I just put in was a waste. I'm sure there must be a simpler way to do this I'm just clueless as to how to do it. Again any help is appreciated and thank you for your time.
I don't know everything about how your game is set up, so I'm just going to mention things and you go appropriately.
As for the rest of the event, you're never actually giving a default command where you just remove the immortal state and let them die, so that's an error you just haven't gotten to.
I'm going to suggest a restructuring of your events in a way that should function, then you can adapt it to your preferences if you want it to work differently. Just to be clear with the goals here:
- If the entire party dies and you have a "revive 1," it will be used on the main character.
- If the entire party dies and you have a "revive all," it will be used on the party.
I'm going to put the priority in that order, but you can simply swap lines if you need. So here's the pseudo-event-code:
Event 1 - Condition: Turn 0 + 0. Span: Battle
Event 2 - Condition: Actor 1 HP <= 0%. Span: Moment
(you don't need to waste all those variables on everybody's HP)
Then you just copy that and replace Actor 1 with Actor 2.
When you make the copies that are triggered by each of your named party members being at 0, you'll need one of the conditional branches to be checking your main character being dead, but you want to check both possible main characters. To do that, do Conditional -> Tab 4 -> Script and enter
In those party member events, where you use the revive 1, you'll just do a conditional asking if actor 1 is in the party heal and revive him, else heal and revive actor 2. The rest of the event is the same.
Hopefully this is quite clear for you.
Why? What's the point of having a blank page? And what's the point of the switches - where are they coming from, how are they being set?
Again, I don't know what you're managing with your Revive State switches, but what's the point of this page? Your next page gives everyone Immortal. Also, you don't want this to have a span of Moment, that means that as long as the switch is on, the game is continually running this battle event - that's why it's freezing up. It should have a span of Battle.
As for the rest of the event, you're never actually giving a default command where you just remove the immortal state and let them die, so that's an error you just haven't gotten to.
I'm going to suggest a restructuring of your events in a way that should function, then you can adapt it to your preferences if you want it to work differently. Just to be clear with the goals here:
- If the entire party dies and you have a "revive 1," it will be used on the main character.
- If the entire party dies and you have a "revive all," it will be used on the party.
I'm going to put the priority in that order, but you can simply swap lines if you need. So here's the pseudo-event-code:
Event 1 - Condition: Turn 0 + 0. Span: Battle
Code:
Give the party Immortal
Event 2 - Condition: Actor 1 HP <= 0%. Span: Moment
(you don't need to waste all those variables on everybody's HP)
Code:
Conditional -> Tab 2 -> Actor [Airys] -> State [Knockout]
Conditional Arya State Knockout
Conditional Gilwen State Knockout
// Entire party is dead
Conditional -> Tab 4 -> Item [Revive 1 Rune]
Change Items -> Revive 1 Rune -1
Change HP -> Actor 1 -> whatever amount you want
Show Text -> "Actor 1's name has been healed by the Revive 1 Rune!"
Exit Event Processing
Conditional -> Item [Revive All Rune]
Change Items -> Revive All Rune -1
Change HP -> Entire Party -> whatever amount you want
Change State -> Entire Party -> Remove [Knockout]
Change State -> Entire Party -> Add [Immortal]
Show Text -> "Everyone has been healed by the Revive All Rune!"
Exit Event Processing
Conditional End
Conditional End
Conditional End
// Other people are alive, or we don't have the items, so we let this actor die
Change State -> Actor 1 -> Remove [Immortal]
Then you just copy that and replace Actor 1 with Actor 2.
When you make the copies that are triggered by each of your named party members being at 0, you'll need one of the conditional branches to be checking your main character being dead, but you want to check both possible main characters. To do that, do Conditional -> Tab 4 -> Script and enter
$gameActors.actor(1).isDead() || $gameActors.actor(2).isDead()In those party member events, where you use the revive 1, you'll just do a conditional asking if actor 1 is in the party heal and revive him, else heal and revive actor 2. The rest of the event is the same.
Hopefully this is quite clear for you.
Is the final step the same for the named actor's pages with it still changing the actor 1's state?
No? The condition for each event is looking at a specific actor to be at 0% health. If none of the conditions for the revival items are met, you want that actor to die, right?
Sounds right.
Tried to put it in, but when knocked out in battle it still froze up. I must've messed something up I just don't know what.
I realize that I'm probably missing some very basic things, but I do appreciate any help.
You need to give more information on the situation. When who is knocked out? Actor 1? One of the others? Is the entire party dead? Do you have either of the revival items? What should be happening?
That will point out what part of the event code is incorrect.
That will point out what part of the event code is incorrect.
I have it made out (or at least I think I did) so that page 1 is the don't run for the length of the battle because I don't want the enemy to be able to run away in this case, then I have page 2 with turn 0 give party the immortal status like you pointed out before, then page 3 I have the if actor 1 reaches 0hp (moment length) then check to see if Airys, then Arya, then Gilwen are knocked out then check if player has Revive Rune 1, if party has the rune then remove 1 revive rune 1 and give actor 1 +9999hp then show text "(Actor 1's name) has been healed by Revive Rune 1." Exit event processing after that. Else If the party has Revive All Rune, minus 1 revive all rune, change entire party's hp to +9999, remove state knock out on entire party, show text "The party has been healed by Revive All Rune .", Exit event processing. Remove immortal state from actor 1. page 4 does the same thing, but replaces instances of Actor 1 with Actor 2. Page 5 checks if actor 3 (Airys) drops to 0hp (Moment length) then uses the bit of script you sent me in a conditional of if "script" then if Arya, then Gilwen are knocked out if party has revive 1 rune then if party has actor 1 then minus 1 revive 1 rune, change actor 1 hp to +9999, and show text "(Actor 1's name) has been healed by Revive Rune 1." Else if Actor 2 is in party then do the same thing except for actor 2 instead of 1. If party does not have Revive rune 1 then check if party has revive all rune, change item to remove 1 revive all rune, change hp of entire party to +9999, Remove knock out state from entire party, show text "The party has been healed by Revive All Rune .", then exit event processing. Remove immortal state from Airys. Page 6 does the same as page 5, but for Arya instead of Airys. Page 7 does the same as pages 5 and 6 but for Gilwen.
The idea for what is supposed to be happening is that page 2 gives party immortal state for the duration of the battle, page 3 is suppose to check the hp status of actor 1 and then if it falls to 0 check if the rest of the party is down as well then check for revive 1 rune. If party has revive 1 rune then it revives actor 1 to full health removing the knocked out state from them, it also removes the immortal state if they do not possess revive rune 1 or revive all rune. The following page, page 4, is supposed to do the same thing, but with actor 2 being checked and revived if they are in the party. Page 5, 6 , and 7 are supposed to check if each of the other actor's hp drops to 0 then check the rest of the party for their hp and if all are at 0 then check if party has a revive 1 rune. If they do then check if actor 1 is in party then revive them or if actor 2 is in party then revive them. then if the party is all knocked out and does possess a revive 1 rune check to see if party has a revive all rune. If they do then use it and bring entire party back to full health removing the state knocked out.
The way this is supposed to go is from the players viewpoint is that if all of their party goes down then the game should automatically check and use a revive rune (if they have it) instead of going to game over just yet. The revive 1 rune should have priority use over the revive all rune. And since the player gets to choose which actor they have in party at the beginning of the game between actor 1 or 2 that should determine which actor the revive 1 will effect when the whole party is knocked out if they still have one. Then the chosen actor should be revived to full health.
I hope I didn't confuse you too much. I tried to write this out as simply as I could.
That's not what that means. Don't Run is the condition for the troop event, so any commands in the event will never be run because there's no condition to activate them.
If you don't want your enemies to flee, then don't give them a skill that would allow them to, or use a turn 0 battle event to apply a state that seals that skill.
I'm sorry, and I hope there wasn't a pertinent bit in there, but once I realized you were writing out in English the entire sequence of all of your events, I skipped it.
I understand perfectly what the events are supposed to do, I coded them for you.
I asked, in your testing, what are the specific circumstances you're testing that results in the game hanging.
To quote what I asked last time:
I'm not asking you to explain again what you're trying to achieve, I'm asking the specifics of the situation when you see an error.
Oh, my bad, I misunderstood. Sorry. In the battle the way I've been testing it I have an event setup that when I click the action button it takes me into a battle with the troop that has all the code. In this case 3 bats. At this time I only have one actor in the party which I have guard the entire battle until they take the character down to 0hp. Once the character reaches 0hp the game freezes, but oddly enough I can still see the actor's foot twitching.
And the rest? Which actor is it? Do you have one of the revival items in your inventory?
The problem could be that you don't have the other actors in your party that it's checking for. I wouldn't think that would make it hang, just go to the end where the present actor loses immortal and dies, but it would certainly never work in terms of activating the revival item.
The problem could be that you don't have the other actors in your party that it's checking for. I wouldn't think that would make it hang, just go to the end where the present actor loses immortal and dies, but it would certainly never work in terms of activating the revival item.
It was actor 1. I had a revive all rune in inventory.
Tried adding everyone that would be in the party and it still froze as soon as one of them got knocked out.
I'm guessing it's probably because not all of the conditional branches meet their conditions so it's just running the event on "moment" timing over and over again without it ever being able to do anything to stop itself.
It's due to having and removing the immortal state. That works with enemies, but it apparently doesn't with actors.
I've been testing various things, and I can get it to not hang (by making the span Turn and applying the Knockout state manually), but the actor won't actually fall and die until the beginning of the next turn.
I can't figure out how to get around that...I tried calling refresh() and performCollapse(), and neither did anything.
Edit: Disregard.
Original thread: https://forums.rpgmakerweb.com/threads/revival-item.144454/