Hey everyone,
So in my game I'm trying to implement a system where the enemies, once they get below a certain health threshold, will start a conversation with the player, usually begging for mercy. If anyone has played Persona or Shin Megami Tensei games, it's that same idea. The enemy, at the end of the turn in which their health gets low, will start talking to the player and possibly run away, give them items, or just resume battle depending on what the player chooses.
I don't think I need a plugin to do this, as battle can run events natively. However, I can't figure out how this event would randomly occur. I don't want it to always occur (maybe only 20% of the time), and would want to be able to have some enemies NOT do it, such as bosses.
I also want it to be a conversation randomly selected from a list of possibilities as well.
Anyone have any idea how I can accomplish this? Thanks in advance! 🙂
To get them to occur randomly, set a variable by selecting random and then 1 - 5. Call this variable on the troop page.
Have a second variable which checks the particular enemy's HP
Have a conditional which checks if the variable is e.g. =3
If yes, a second conditional (which is obviously nested within the first) which checks the HP variable and if it is below X (i.e. you pick an amount where you want the conversation to kick in).
If yes, then your conversation.
This would be put into whichever troops you wanted. If you don't want a boss to do this, simply don't put it in that troop page.
Okay cool! Thanks!
So how would I get it to select a random conversation from a list? Also use a variable somehow?
After setting your event I think it goes like this
CONDITION If RANDOM TALK = 1
Event: Message
ELSE IF CONDITION = 2
Event: Message
and so forth?
It's not working because you have it still on the condition "Don't Run" - so it doesn't!
Change that to Turn 1 plus 1, and the span to Turn. Then it will check every turn if the variable for HP is less than 35.
You need to have it checked every turn - 'Battle' will only check it once, and as that is at the beginning of the battle, your conversation will never happen because at that stage the enemy has full HP.
Your troop event will need 2 pages.
Page 1, set to turn 0 (i.e. this will happen the moment the battle begins.)
Turn on a switch called e.g. "Battle Conversation". Nothing else on that page.
Page 2 set as I said earlier
Conditional branch Switch Battle Conversation is ON
Put inside the condition all the stuff detailed above.
At the end of your choices set switch Battle Conversation to OFF
Leave the 'Else' part of the new conditional empty.
What this means is that each turn the engine will check to see if the battle switch is ON. If it is, it will check if the HP is below the threshold you set. If it is, it will run the conversation, followed by the choices.
If the conversation has already run, that switch will be OFF, so nothing will happen.
You do it by setting up another variable, with a range to match the number of different conversations you have. Then a conditional for each number. You can uncheck the 'Set handling conditions' box, as you don't need it.
If variable X = 1
Blah, blah
If variable X = 2
Blah de blah
If variable X = 3
Blahblahblah
You get the idea.
I use Base Troop Events a lot, and as far as I can see, there is no way that you can use it to specify individual enemies. Furthermore, it would automatically run in boss battles as well, which is what you don't want. However, once you've got this structure worked out, you can copy/paste everything except the enemy - though if you always pick enemy 1 in the troop, then probably even that bit could be copy/pasted.
Ok, I understand now! One last question, for the different conversation conditionals, do they need Else branches or not?
Yes they need the else branches. It checks each branch and goes down from there. IF not 1 then 2, if then 3 then 4 and so forth.
Edit: To clarify if you meant the random messages need the else branches, then the answer is YES.
Edit 2: ll try to explain. So let's say someone makes a variable that generates a random number between 1-2. In the event they make a conditional branch that checks if the random number generated is 1. If so, that is TRUE (and message under that branch is then displayed in game) But what if the random generated number is 2? The event checks the branch and moves on to the next ELSE in case the previous was not true. Think of it checking and moving down the tree. If you do not put an ELSE, the event stops and nothing else will be checked.
...Ah dangit. Well I tried. I may edit this later. I know I'm bad at explaining. ^^;
Edit 3: Someone please correct me if I am wrong. I'm starting to doubt myself. >_> I apologize Esterk, I was only trying to help.