I'm in the middle of writing an rpg combat system for my game, but have hit a bit of a bump in the road.
I need a way to display the normal sort of text you would see in an rpg (with optional buttons for attacking/etc) but am torn in what direction I should go.
Like this:
As it stands currently, this is what I have.
https://streamable.com/cae3l
My issue with my current system is that I'm using a normal screen and am passing dialogue to it via an arg.
I'm having a hard time with this because the label I jump to displays all this information (3 screens, the monster portraits) but will not stay in place due to me not having a dialogue box or menu up on the screen. I'm having to resort to a pause to prevent the game from immediately skipping the label.
If anyone has any sort of idea I would be open to hearing it.
Thanks!
Text Box Alternative/Preventing renpy from moving forward
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Re: Text Box Alternative/Preventing renpy from moving forward
I realize that a majority of what my script is doing is contained within a label.
I'm thinking that if I instead control the combat from within a python environment rather than a label, I can probably keep it from auto-forwarding. This may be more difficult, it may not be.
I've also looked into maybe using pygame but from what I've seen, renpy+pygame isn't a worthwhile adventure. I'll continue to search the lemmasoft forums for how other people have implemented minigames and try to glean some sort of information from there.
Edit:
So I attempted to rewrite the scene with Python. It seems like I'm in the same pickle though.
If I don't include a pause, the scene goes away. I also have this blank text box and I'm not sure what is calling it.
https://streamable.com/hof7r
I'm wanting to let the user control the game flow from their actions with textbuttons within the battleBox, but I can't do that if the game doesn't stay still.
I'm thinking that if I instead control the combat from within a python environment rather than a label, I can probably keep it from auto-forwarding. This may be more difficult, it may not be.
I've also looked into maybe using pygame but from what I've seen, renpy+pygame isn't a worthwhile adventure. I'll continue to search the lemmasoft forums for how other people have implemented minigames and try to glean some sort of information from there.
Edit:
So I attempted to rewrite the scene with Python. It seems like I'm in the same pickle though.
Code: Select all
label jankyass:
python:
renpy.scene()
battleBG = "images/battle_"+CombatEnvironment+".png"
renpy.show(battleBG)
fighting = True
if fighting:
renpy.show_screen("MobStatBoxes", Enemy.combatants)
renpy.show_screen("PartyStatBoxes")
renpy.show_screen("battleBox", "Status Message")
if len(Enemy.combatants) == 1:
renpy.show(Enemy.combatants[0].portrait, at_list=[centerMob])
if len(Enemy.combatants) == 2:
renpy.show(Enemy.combatants[0].portrait, at_list=[leftMobDouble])
renpy.show(Enemy.combatants[1].portrait, at_list=[rightMobDouble])
if len(Enemy.combatants) == 3:
renpy.show(Enemy.combatants[0].portrait, at_list=[leftMob])
renpy.show(Enemy.combatants[1].portrait, at_list=[centerMob])
renpy.show(Enemy.combatants[2].portrait, at_list=[rightMob])
renpy.pause(delay=10)
https://streamable.com/hof7r
I'm wanting to let the user control the game flow from their actions with textbuttons within the battleBox, but I can't do that if the game doesn't stay still.
Re: Text Box Alternative/Preventing renpy from moving forward
You should be able to achieve this by calling your screen that receives input instead of showing it. When you call a screen it waits for an interaction automatically based on the input received on the screen > so you can put it in a loop, call the screen, process the _return value to decide what to do (calling a different screen for example when player chooses attack, to show the targets).
Here's the documentation for it: https://www.renpy.org/doc/html/screens.html#call-screen
I have to head off to work now so can't post sample code, but hopefully you can figure something out meanwhile.
Here's the documentation for it: https://www.renpy.org/doc/html/screens.html#call-screen
I have to head off to work now so can't post sample code, but hopefully you can figure something out meanwhile.
Re: Text Box Alternative/Preventing renpy from moving forward
Hey, thanks kivik! I'm sure I haven't solved all the problems that I'm going to have with this, but calling the screen worked and I can control flow with textbuttons now!
Thanks so much! I can't wait to get home to work on this some more!
https://i.imgur.com/AYNRjpE.png
Thanks so much! I can't wait to get home to work on this some more!
https://i.imgur.com/AYNRjpE.png
Who is online
Users browsing this forum: Ahrefs [Bot], bonnie_641, Google [Bot]