Help making Phoenix Wright style UI
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.
Help making Phoenix Wright style UI
First of all, Hello everyone.
For my VN I'm wanting to make it so when you approach a character you have to hit a button for either talk, Examine, back, or tasks before you can converse or whatnot with them.
I'm trying to figure out how to make one sort of like the bottom part here
Without the court record and stuff. So any help even if just a push in the right direction would be appreciated
For my VN I'm wanting to make it so when you approach a character you have to hit a button for either talk, Examine, back, or tasks before you can converse or whatnot with them.
I'm trying to figure out how to make one sort of like the bottom part here
Without the court record and stuff. So any help even if just a push in the right direction would be appreciated
Last edited by Lekkuen on Thu Sep 11, 2014 12:46 pm, edited 1 time in total.
- OokamiKasumi
- Eileen-Class Veteran
- Posts: 1779
- Joined: Thu Oct 14, 2010 3:53 am
- Completed: 14 games released -- and Counting.
- Organization: DarkErotica Games
- Deviantart: OokamiKasumi
- Location: NC, USA
- Contact:
Re: Help making Phoenix Wright style UI
Menu choices and jumping to 'labeled' menus would accomplish this. You can also add flags to keep from repeating conversations.Lekkuen wrote:...For my NV I'm wanting to make it so when you approach a character you have to hit a button for either talk, Examine, back, or tasks before you can converse or whatnot with them.
Code: Select all
label Ms_marigold:
menu marigold_01:
if t_m01:
"Talk.":
m "You already spoke to me."
else:
"Talk.":
$ t_m01 = True
jump talk_m01
if ex_m01:
"examine:"
"You already examined this."
else:
"Examine.":
$ ex_m01 = True
jump examine_m01
"Tasks":
jump tasks_list
"Return":
pass
This is just a matter of changing the location of the buttons, and setting them up to be 2 columns.Lekkuen wrote:I'm trying to figure out how to make one sort of like the bottom part here ... Without the court record and stuff. So any help even if just a push in the right direction would be appreciated
-- You would do this in screens.rpy under screen choice.
Code: Select all
screen choice:
window:
style "menu_window"
#These are what you use to adjust the Position of the buttons. They are currently set to be in the Center.
xalign 0.5 #across
yalign 0.5 #up-down
$i = 0
hbox:
spacing 2
vbox:
style "menu"
spacing 2
for caption, action, chosen in items:
$i += 1
if i % 2 == 1:
if action:
button:
action action
style "menu_choice_button"
text caption style "menu_choice"
else:
text caption style "menu_caption"
if i % 2 == 0:
$i = 1
else:
$i = 1
vbox:
style "menu"
spacing 2
for caption, action, chosen in items:
$i += 1
if i % 2 == 1:
if action:
button:
action action
style "menu_choice_button"
text caption style "menu_choice"
else:
text caption style "menu_caption"
screen choice2:
window:
style "menu_window"
#These are what you use to adjust the Position of the buttons. They are currently set to be in the Center.
xalign 0.5 #across
yalign 0.5 #up-down
vbox:
style "menu"
spacing 5
for caption, action, chosen in items:
if action:
button:
action action
style "menu_choice_button"
text caption style "menu_choice"
else:
text caption style "menu_caption"
Ookami Kasumi ~ Purveyor of fine Smut.
Most recent Games Completed:
"No amount of great animation will save a bad story." -- John Lasseter of Pixar
Most recent Games Completed:
- The Walk[Psychological][NanoWinter] ~ PG New!
- Trap! [ModernFantasy][VN] ~ PG16
- The Adventures of Prince Ivan [Fant/Adv/VN] ~ PG
"No amount of great animation will save a bad story." -- John Lasseter of Pixar
Re: Help making Phoenix Wright style UI
First, thanks for being willing to help a nooblet out. ^_^
My first time with all this so things are confusing even with the tutorials for me.
So I would need to put both of those in for it to work?
My first time with all this so things are confusing even with the tutorials for me.
So I would need to put both of those in for it to work?
- OokamiKasumi
- Eileen-Class Veteran
- Posts: 1779
- Joined: Thu Oct 14, 2010 3:53 am
- Completed: 14 games released -- and Counting.
- Organization: DarkErotica Games
- Deviantart: OokamiKasumi
- Location: NC, USA
- Contact:
Re: Help making Phoenix Wright style UI
My pleasure. I was once a newbie too.Lekkuen wrote:First, thanks for being willing to help a nooblet out. ^_^
Perfectly understandable.Lekkuen wrote:My first time with all this so things are confusing even with the tutorials.
Well, you do need to set up a menu of some kind or the buttons won't appear. I just used what you'd posted: talk, Examine, back, and tasks. The flags ($ t_m01 = True) are there to keep from getting the same answer, over and over.Lekkuen wrote:So I would need to put both of those in for it to work?
Don't forget! Right after 'start' you'll need to list ALL of the flags used in your game as False before you can switch any of them to True.
Code: Select all
label start:
$ t_m01 = False
$ t_m02 = False
$ ex_m01 = False
$ ex_m02 = False
Ookami Kasumi ~ Purveyor of fine Smut.
Most recent Games Completed:
"No amount of great animation will save a bad story." -- John Lasseter of Pixar
Most recent Games Completed:
- The Walk[Psychological][NanoWinter] ~ PG New!
- Trap! [ModernFantasy][VN] ~ PG16
- The Adventures of Prince Ivan [Fant/Adv/VN] ~ PG
"No amount of great animation will save a bad story." -- John Lasseter of Pixar
Re: Help making Phoenix Wright style UI
Alright so I put that stuff in to look at it first before adjusting anything, and get this error
Expected menuitem
if t_m01:
A search said that is normally an indentation error but indenting it more didn't do anything.
Expected menuitem
if t_m01:
A search said that is normally an indentation error but indenting it more didn't do anything.
Re: Help making Phoenix Wright style UI
So messed around with it more, thinking it's because those labels weren't what was actually used so tried changing them to what was already in the game but still can't figure out what's wrong with the menuitem right there.
- OokamiKasumi
- Eileen-Class Veteran
- Posts: 1779
- Joined: Thu Oct 14, 2010 3:53 am
- Completed: 14 games released -- and Counting.
- Organization: DarkErotica Games
- Deviantart: OokamiKasumi
- Location: NC, USA
- Contact:
Re: Help making Phoenix Wright style UI
Post your code. It'll be easier to see what went wrong.Lekkuen wrote:So messed around with it more, thinking it's because those labels weren't what was actually used so tried changing them to what was already in the game but still can't figure out what's wrong with the menuitem right there.
Something to be aware of:
-- Renpy reads code from Top to Bottom, so if you don't have a jump taking the game elsewhere, it will automatically go to the label Below the last label it read. I keep mistakes from happening by putting most of my labeled menus Somewhere Else in the game, usually a whole other tab / .rpy file, especially for labels I use more than once. This way it won't read and show certain sections of the game until they are actually needed.
Ookami Kasumi ~ Purveyor of fine Smut.
Most recent Games Completed:
"No amount of great animation will save a bad story." -- John Lasseter of Pixar
Most recent Games Completed:
- The Walk[Psychological][NanoWinter] ~ PG New!
- Trap! [ModernFantasy][VN] ~ PG16
- The Adventures of Prince Ivan [Fant/Adv/VN] ~ PG
"No amount of great animation will save a bad story." -- John Lasseter of Pixar
Re: Help making Phoenix Wright style UI
I'm not home so can't post it for a bit. But I literally copied and pasted yours to look at it and I got error at first if
Re: Help making Phoenix Wright style UI
OK this is the part that gets an error.
it says
Code: Select all
menu:
if t_m01:
"Talk.":
m "You already spoke to me."
else:
"Talk.":
$ t_m01 = True
jump talk_m01
if ex_m01:
"Examine":
"You already examined this."
else:
"Examine.":
$ ex_m01 = True
jump examine_m01
"Tasks":
jump tasks_list
"Return":
pass
Code: Select all
File "game/script.rpy", line 26: expected menuitem
if t_m01:
^
- OokamiKasumi
- Eileen-Class Veteran
- Posts: 1779
- Joined: Thu Oct 14, 2010 3:53 am
- Completed: 14 games released -- and Counting.
- Organization: DarkErotica Games
- Deviantart: OokamiKasumi
- Location: NC, USA
- Contact:
Re: Help making Phoenix Wright style UI
Did you remember to list these flags as False right after the 'start' label?
The fastest way to check if the problem is the flags is by removing them from the menu:
If it still won't work, try this alternate way to do the same menu:
Edited:
Or this one:
Edited:
Code: Select all
label start:
$ t_m01 = False
$ ex_m01 = False
Code: Select all
label Ms_marigold:
menu:
"Talk.":
jump talk_m01
"Examine.":
jump examine_m01
"Tasks":
jump tasks_list
"Return":
pass
Edited:
Code: Select all
label Ms_marigold:
menu marigold_01:
"Talk." if talk_m01==True:
m "You already spoke to me."
jump marigold_01 #This takes you back to this same menu to try again.
"Talk." if talk_m01==False:
$ t_m01 = True
jump talk_m01
"examine" if ex_m01==True:
"You already examined this."
jump marigold_01
"Examine." if ex_m01==False:
$ ex_m01 = True
jump examine_m01
"Tasks":
jump tasks_list
"Return":
pass
Edited:
Code: Select all
label Ms_marigold:
menu marigold_01:
"Talk.":
if t_m01:
m "You already spoke to me."
jump marigold_01 #This takes you back to this same menu.
else:
jump talk_m01
"Examine.":
if ex_m01:
"You already examined this."
jump marigold_01
else:
jump examine_m01
"Tasks":
jump tasks_list
"Return":
pass
Last edited by OokamiKasumi on Sat Sep 27, 2014 5:31 am, edited 2 times in total.
Ookami Kasumi ~ Purveyor of fine Smut.
Most recent Games Completed:
"No amount of great animation will save a bad story." -- John Lasseter of Pixar
Most recent Games Completed:
- The Walk[Psychological][NanoWinter] ~ PG New!
- Trap! [ModernFantasy][VN] ~ PG16
- The Adventures of Prince Ivan [Fant/Adv/VN] ~ PG
"No amount of great animation will save a bad story." -- John Lasseter of Pixar
Re: Help making Phoenix Wright style UI
Yeah When I removed them it worked fine like you said but I have them listed
So I tried the alternate ones you listed and get this
The entire code from that is
I don't really get it as when I remove the ifs altogether it has no problem making the menu yet says the menu name is the problem
Code: Select all
label start:
$ t_m01 = False
$ t_m02 = False
$ ex_m01 = False
$ ex_m02 = False
So I tried the alternate ones you listed and get this
Code: Select all
File "game/script.rpy", line 29: expected 'name' not found.
jump menu marigold_01
^
File "game/script.rpy", line 36: expected 'name' not found.
jump menu marigold_01
^
Code: Select all
label start:
$ t_m01 = False
$ t_m02 = False
$ ex_m01 = False
$ ex_m02 = False
scene bg white
show Yi at Position(xpos=0.4, ypos=118, xanchor=0, yanchor=0)
label Ms_marigold:
menu marigold_01:
"Talk." if talk_m01==True:
m "You already spoke to me."
jump menu marigold_01 #This takes you back to this same menu to try again.
"Talk." if talk_m01==False:
$ t_m01 = True
jump talk_m01
"examine" if ex_m01==True:
"You already examined this."
jump menu marigold_01
"Examine." if if ex_m01==False:
$ ex_m01 = True
jump examine_m01
"Tasks":
jump tasks_list
"Return":
pass
Re: Help making Phoenix Wright style UI
Also I managed to get the menu low enough for my liking but I can't see any way to move the text over.
By messing with spacing I've managed to space them apart but is there anyway to move the whole block over so that the words are based in the center of the menu box instead of the end.
Code: Select all
screen choice:
window:
style "menu_window"
#These are what you use to adjust the Position of the buttons. They are currently set to be in the Center.
xalign 0.5 #across
yalign 1.0 #up-down
$i = 0
hbox:
spacing 20
vbox:
style "menu"
spacing 10
for caption, action, chosen in items:
$i += 1
if i % 2 == 1:
if action:
button:
action action
style "menu_choice_button"
text caption style "menu_choice"
else:
text caption style "menu_caption"
if i % 2 == 0:
$i = 1
else:
$i = 1
vbox:
style "menu"
spacing 10
for caption, action, chosen in items:
$i += 1
if i % 2 == 1:
if action:
button:
action action
style "menu_choice_button"
text caption style "menu_choice"
else:
text caption style "menu_caption"
screen choice2:
window:
style "menu_window"
#These are what you use to adjust the Position of the buttons. They are currently set to be in the Center.
xalign 0.5 #across
yalign 1.0 #up-down
vbox:
style "menu"
spacing 20
for caption, action, chosen in items:
if action:
button:
action action
style "menu_choice_button"
text caption style "menu_choice"
else:
text caption style "menu_caption"
- meiri
- Regular
- Posts: 177
- Joined: Wed Jun 25, 2014 6:21 pm
- Projects: Tutor Tabitha, Movement
- Organization: Blue Bottlecap Games
- Location: East Coast, US
- Contact:
Re: Help making Phoenix Wright style UI
I would try this code:
*Ps, the init -2: section at the bottom turns the buttons into textbutton-like buttons rather than hyperlink-like buttons, but that can simply be commented out.
*Ps, the init -2: section at the bottom turns the buttons into textbutton-like buttons rather than hyperlink-like buttons, but that can simply be commented out.
Code: Select all
screen choice:
window:
style "menu_window"
#These are what you use to adjust the Position of the buttons. They are currently set to be in the Center.
xalign 0.5 #across
yalign 0.5 #up-down
$i = 0
hbox:
xalign 0.5
yalign 0.5
spacing 50
vbox:
style "menu"
spacing 50
for caption, action, chosen in items:
$i += 1
if i % 2 == 1:
if action:
button:
action action
style "menu_choice_button"
text caption style "menu_choice"
else:
text caption style "menu_caption"
if i % 2 == 0:
$i = 1
else:
$i = 1
vbox:
xalign 0.5
yalign 0.5
style "menu"
spacing 50
for caption, action, chosen in items:
$i += 1
if i % 2 == 1:
if action:
button:
action action
style "menu_choice_button"
text caption style "menu_choice"
else:
text caption style "menu_caption"
init -2:
$ config.narrator_menu = True
# style menu_window is default
style menu_choice is button_text:
clear
style menu_choice_button is button:
xminimum int(config.screen_width * 0.2)
xmaximum int(config.screen_width * 0.2)
What's in a loop? A loop iterated in any other way would output as sweet.
--
Have a look at my GxG kinetic novel, Movement, if you have the chance?
--
Have a look at my GxG kinetic novel, Movement, if you have the chance?
Re: Help making Phoenix Wright style UI
Thanks! That got the menu how I wanted.
Though I still can't figure out my problem with the If/Else part of the codes in script
Though I still can't figure out my problem with the If/Else part of the codes in script
- Kia
- Eileen-Class Veteran
- Posts: 1040
- Joined: Fri Aug 01, 2014 7:49 am
- Deviantart: KiaAzad
- Discord: Kia#6810
- Contact:
Re: Help making Phoenix Wright style UI
I saw this as taught: how nostalgic! let's steal this and use it so I made a fast paste prototype of it (see attached file):
to use it just unzip it to your game folder and use "call charOpt" to call it.
it has some problem in returning where it should and since I never used "Jump" in screen code and can't spend more than 10 min on it right now you have to ask others for help on it. ^_^
to use it just unzip it to your game folder and use "call charOpt" to call it.
it has some problem in returning where it should and since I never used "Jump" in screen code and can't spend more than 10 min on it right now you have to ask others for help on it. ^_^
- Attachments
-
- ui.rar
- (4.56 KiB) Downloaded 78 times
Who is online
Users browsing this forum: Semrush [Bot]