Making a DanganRonpa Trial System (Opinions)

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
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.
Post Reply
Message
Author
User avatar
Westeford
Regular
Posts: 151
Joined: Mon Jun 19, 2017 4:43 pm
Completed: 12 Hours to Die
Projects: Project Premonition
itch: westeford
Location: United States
Contact:

Making a DanganRonpa Trial System (Opinions)

#1 Post by Westeford »

I'm looking for some opinions on developing a trial system like in DanganRonpa. Specifically the nonstop debates.
I'm currently working on it already and this is what I've come up with so far with some help.

How it works:
Phase 1: (Intro)
1. Transitions from Dialogue to Debate [Done]
2. Showcases the available truth bullets (Evidence) [Working on]
3. Transition to debate. [Done]
Phase 2: (Debates)
4. Debate Loop: Everyone says their piece, statements float on the screen. Then after the debate it jumps back to the MC who will think something then the loop repeats [Done]
5. Weak points: Some statements contain a weakpoint. The player must click on the right weakpoint while the right evidence is selected. [Done]
6. Truth Bullets: During the debate a truth bullet will always be selected. The player can press a button to switch out the current truth bullet with another. (The player can pause the game and check the evidence.) [Working on]
Phase 3: (After Clicking Weakpoint)
7. If right weakpoint is selected with right bullet, then calls transition then moves story further. [Working on]

I'm focusing on the truth bullets right now. Later on I will add a life meter and a way to fast-forward.
This is my current code so far. This is the debate without the truth bullets.

This keeps track of the debate's progress

Code: Select all

screen sta_count:
    vbox xalign 0.0 yalign 0.0:
    	text "Current Speaker: [speaker]"
        text "Remaining Statements: [stat]"
        

Code: Select all

screen st_display(sta, trans):
    text sta at trans #display the text at the transform
    timer 3 action Return() #after 3 seconds passed, return/exit the screen

Code: Select all

label db1:
    label .a:
        call present #Transition from story to debate
    
    label .loop:
        window hide
        show screen sta_count
        $ stat = 6 #Remaining statements: 6
        $ speaker == "Taka"
        $ renpy.call_screen('st_display', sta="{size=50}I assert that the one who was murdered was REDACTED!", trans=dissolve_leftcenter)
        $ renpy.pause(0.5)
        
        $ stat -= 1 #Remaining statements: 5
        $ speaker == "Hiro"
        $ renpy.call_screen('st_display', sta="{size=50}Yeah, we know that already.", trans=dissolve_leftup)
        $ renpy.pause(0.5)

	$ stat -= 1
        $ speaker == "Byakuya"
        $ renpy.call_screen('st_display', sta="{size=50}And the murder took place in Makoto's room.", trans=dissolve_rightcenter)
        $ renpy.pause(0.5)
        
        $ stat -= 1
        $ speaker == "Hina"
        $ renpy.call_screen('st_display', sta="{size=50}In the bathroom...", trans=dissolve_rightdown)
        $ renpy.pause(0.5)
        
        $ stat -= 1
        $ speaker == "Chihiro"
        $ renpy.call_screen('st_display', sta="{size=50}The killer must have taken them by surprise while they were in the bathroom.", trans=dissolve_rightdown)
        $ renpy.pause(0.5)
        
        $ stat -= 1
        #This statement contains a clickable hyperlink that jumps to a label, in this case, the label is c
        $ renpy.call_screen('st_display', sta="{size=50}{a=jump:db1.c}{color=#FF8F00}They didn't even have a chance to resist{/a}", trans=dissolve_zoom)
        pause(0.5)
        #once all statements have been displayed, if the player didn't click any, jump to label b 
    
    label .b:
        "Naegi" "(Wait...that sounds wrong...)"
        "Naegi" "(I should present the evidence of a struggle)"
        pause(1)
        jump .loop
    
    label .c: #end and continue
        call debate_end #Transition from debate to story
I've gotten this to work so far.
It's very incomplete, but close to finished. I decided to take out the aesthetic parts and focus only on the function for this post.

My pseudo-code thoughts:
Phase 1: (Intro)
2. Showcases the available truth bullets (Evidence)
The code I imagine would look something like this.

Code: Select all

label db1:
	label .a:
		call present #Transition
		show evidenceofstruggle
		show bullet2
		show bullet3
		pause(1)
		hide bullet1
		hide bullet2
		hide bullet3
		jump .loop
Phase 2: (Debates)
6. Truth Bullets: During the debate a truth bullet will always be selected. The player can press a button to switch out the current truth bullet with another. (The player can pause the game and check the evidence.)
This part I'm a bit iffy on how I should do this.

Code: Select all

	label .loop:
		show screen truth_cylinder
		#Debate

Code: Select all

define bullet_selected = 1

screen truth_cylinder():
	textbutton "Up" action (bullet_selected += 1)
	textbutton "Down" action (bullet_selected -= 1)
	if bullet_selected = 1:
		show evidenceofstruggle
		hide bullet2
		hide bullet3
	if bullet_selected = 2:
		show bullet2
		hide evidenceofstruggle
		hide bullet3
	if bullet_selected = 3:
		show bullet3
		hide bullet2
		hide evidenceofstruggle
	if bullet_selected > 3:
		bullet_selected = 1
	else:
		bullet_selected = 3
This might work, but I'd rather not have to make a screen for each debate. I also have more than three pieces of evidence in game


Phase 3: (After Clicking Weakpoint)
7. If right weakpoint is selected with right bullet, then calls transition then moves story further.
It might look like this.

Code: Select all

	label .loop:
		$ renpy.call_screen('st_display', sta="{size=50}{a=jump:db1.check}{color=#FF8F00}They didn't even have a chance to resist{/a}", trans=dissolve_zoom)
	label .check:
		if bullet_selected = 1:
			jump .c
		else:
			jump .wrong
	
	label .wrong:
		Naegi "Shoot! I was wrong!"
		jump .loop
		
	label .c:
		call debate_end #Transition back to story.
For reference this is what it looks like in DanganRonpa
https://youtu.be/wWlegT06gDo?t=2m46s

Closing:
I think that just about covers everything. I'm interested in seeing what you think. Any ideas? Any places I can improve the code? I'd love to see. Thank you very much for reading this far!
Last edited by Westeford on Thu Sep 27, 2018 5:20 pm, edited 2 times in total.

DannX
Regular
Posts: 99
Joined: Mon Mar 12, 2018 11:15 am
Contact:

Re: Making a DanganRonpa Trial System (Opinions)

#2 Post by DannX »

You have the logical steps (phases) outlined pretty well, nice work, I think what you need right now (in my modest opinion, of course) is to add some functions and objects to your code to make it easier for you to setup each debate. As it is now, it can be made to work but you'll probably have to repeat a lot of code and that could be time very consuming and error-prone.

One thing that comes to mind is the truth_cylinder screen. You don't need to make one for each debate, you could pass it a list of truth_bullets as a parameter and then reuse it on each debate, changing it's contents beforehand in label .a for example. You also must make sure that the bullet_selected variable doesn't get bigger or lower than the size of your list (the amount of truth bullets) to avoid unexpected errors.

Speaking of truth bullets, it could be useful to make them python objects. That's the way I was doing it in a similar game. Each piece of evidence would be an object with properties like name, image (to show in the evidence screen), description, a "correct" label that would be called if it was selected and the player was in the correct statement, and a "selected" property that you would set to True or False in the truth_cylinder screen. You could make it so when you set a truth bullet as selected (True), the others are automatically deselected (False). Or you could assign them an id number like you've done so far, and change how they are displayed accordingly.

I will later write some basic example code to better explain what I mean, for now if you're interested do look into how to create your own python functions and objects, it will probably be really helpful.

User avatar
Westeford
Regular
Posts: 151
Joined: Mon Jun 19, 2017 4:43 pm
Completed: 12 Hours to Die
Projects: Project Premonition
itch: westeford
Location: United States
Contact:

Re: Making a DanganRonpa Trial System (Opinions)

#3 Post by Westeford »

DannX wrote: Sat Sep 15, 2018 10:04 am I will later write some basic example code to better explain what I mean, for now if you're interested do look into how to create your own python functions and objects, it will probably be really helpful.
Will do.
Thanks for the input.

User avatar
Westeford
Regular
Posts: 151
Joined: Mon Jun 19, 2017 4:43 pm
Completed: 12 Hours to Die
Projects: Project Premonition
itch: westeford
Location: United States
Contact:

Re: Making a DanganRonpa Trial System (Opinions)

#4 Post by Westeford »

Added to the code.
The following shows how many statements remain before the debate loops and it also shows who's currently speaking.
I thought it might be better to use numbers instead of a map or a progress bar or whatever.
Here's the screen I use.

Code: Select all

screen sta_count:
    vbox xalign 0.0 yalign 0.0:
    	text "Current Speaker: [speaker]"
        text "Remaining Statements: [stat]"
And here's the debate using this screen.

Code: Select all

label db1:
    label .a:
        call present #Transition from story to debate
    
    label .loop:
        window hide
        show screen sta_count
        $ stat = 6 #Remaining statements: 6
        $ speaker == "Taka"
        $ renpy.call_screen('st_display', sta="{size=50}I assert that the one who was murdered was REDACTED!", trans=dissolve_leftcenter)
        $ renpy.pause(0.5)
        
        $ stat -= 1 #Remaining statements: 5
        $ speaker == "Hiro"
        $ renpy.call_screen('st_display', sta="{size=50}Yeah, we know that already.", trans=dissolve_leftup)
        $ renpy.pause(0.5)

	$ stat -= 1 #Remaining statements: 4
        $ speaker == "Byakuya"
        $ renpy.call_screen('st_display', sta="{size=50}And the murder took place in Makoto's room.", trans=dissolve_rightcenter)
        $ renpy.pause(0.5)
        
        $ stat -= 1 #Remaining statements: 3
        $ speaker == "Hina"
        $ renpy.call_screen('st_display', sta="{size=50}In the bathroom...", trans=dissolve_rightdown)
        $ renpy.pause(0.5)
        
        $ stat -= 1 #Remaining statements: 2
        $ speaker == "Chihiro"
        $ renpy.call_screen('st_display', sta="{size=50}The killer must have taken them by surprise while they were in the bathroom.", trans=dissolve_rightdown)
        $ renpy.pause(0.5)
        
        $ stat -= 1 #Remaining statements: 1
        #Speaker is still Chihiro
        #This statement contains a clickable hyperlink that jumps to a label, in this case, the label is c
        $ renpy.call_screen('st_display', sta="{size=50}{a=jump:db1.c}{color=#FF8F00}They didn't even have a chance to resist{/a}", trans=dissolve_zoom)
        pause(0.5)
        #once all statements have been displayed, if the player didn't click any, jump to label b 
    
    label .b:
        "Naegi" "(Wait...that sounds wrong...)"
        "Naegi" "(I should present the evidence of a struggle)"
        pause(1)
        jump .loop
    
    label .c: #end and continue
        call debate_end #Transition from debate to story
I'm still debating whether to have the last statement be number 1, or number 0. I think most people will assume 1 means last. I don't want to count upwards (1-6) since it doesn't tell the player how far they've progressed.

Post Reply

Who is online

Users browsing this forum: Google [Bot]