More complex DSE-style menu - help

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
Confused314
Newbie
Posts: 2
Joined: Sat Dec 15, 2007 11:05 am
Contact:

More complex DSE-style menu - help

#1 Post by Confused314 »

I've been looking around here all afternoon and some last night, and I haven't found anything about this, so here goes!

I want to create a menu in the game like the DSE menu, but slightly more complex. It would do something like this:
Time Period
Location1
Activity1
Activity2
Location2

etc. because I'm really anal about organization for anything related to the computer. XD

I tried tweaking the DSE code, and I think I might be heading in the right direction.

Here's the code for the day planner (the only part I tweaked - the rest is the same):
python:
#Experiment:
dp_period_names = [ "Morning", "Afternoon", "Evening" ]
dp_period_vars = [ "morning_act",
"afternoon_act",
"evening_act", ]

dp_period_acts = {
'Morning': [
( 'Academy', "academy_act" ),
( 'Garden', "garden_act" ),
],
'Afternoon': [
( 'River', "river_act" ),
( 'Forest', "forest_act" ),
],
'Evening': [
( 'Ichiraku', "ichiraku_act" ),
]
}

dp_location_names = [ "Academy", "Garden", "River", "Forest", "Ichiraku" ]
dp_location_vars = [ "academy_act", "garden_act", "river_act", "forest_act", "ichiraku_act" ]
dp_location_acts = {
'Academy': [
( 'Study', "study" ),
( 'Tutor', "tutor"),
],
'Garden': [
( 'Plant', "plant" ),
( 'Shop', "shop" ),
],
'River': [
( 'Chakra Train', "chakratrain" ),
],
'Forest': [
( 'Strength Train', "strengthtrain" ),
],
'Ichiraku': [
( 'Work', "work" ),
( 'Chat', "chatwithcharacters" ),
]
}
And yes, I'm making a Naruto Dating Sim 8B I'm not really sure how I should have the code for the events that take place after the Done button is clicked...like, what variables I should use, and the type of event. ><;;; Also, the different locations are shown on buttons underneath the time periods, but when one clicks them...you can't access the activities under them, so I know I'm doing something wrong. XD

Any suggestions? Maybe I'm just aiming too high for a beginner like myself. @_@

JQuartz
Eileen-Class Veteran
Posts: 1265
Joined: Fri Aug 31, 2007 7:02 am
Projects: 0 completed game. Still haven't made any meaningfully completed games...
Contact:

Re: More complex DSE-style menu - help

#2 Post by JQuartz »

I don't really know how the DSE works but I think I could replicate its function (though it won't be as efficient). So if you need some coding done just tell me what you need and I'll see what I can do (I'm no programmer though, just a Naruto manga fan, I think).
I suspect somebody is stealing my internet identity so don't believe everything I tell you via messages. I don't post or send messages anymore so don't believe anything I tell you via messages or posts.

Jake
Support Hero
Posts: 3826
Joined: Sat Jun 17, 2006 7:28 pm
Contact:

Re: More complex DSE-style menu - help

#3 Post by Jake »

JQuartz wrote:I don't really know how the DSE works but I think I could replicate its function (though it won't be as efficient).
I seem to recall the DSE code being pretty neat and pretty easy to extend, so if you're offering programming help it would probably be easier to do that than code a similar solution from scratch!
Server error: user 'Jake' not found

Confused314
Newbie
Posts: 2
Joined: Sat Dec 15, 2007 11:05 am
Contact:

Re: More complex DSE-style menu - help

#4 Post by Confused314 »

Thanks for the help and offered help! :DDD I think I figured out what I'm going to do - I really don't think that what I wanted to create originally was actually possible. XD Or at least until I take some classes.

For the dse menu, something like:
dp_period_names = [ "Morning", "Afternoon", "Evening" ]
dp_period_vars = [ "morning_act", "afternoon_act", "evening_act", ]
dp_period_acts = {
'Morning': [
( 'Academy', "academy"),
( 'Garden', "garden"),
],
'Afternoon': [
( 'River', "river" ),
( 'Forest', "forest" ),
],
'Evening': [
( 'Ichiraku', "ichiraku" ),
]
}

With the variables on the event page like:
$ event("academy", "act == 'academy'")
$ event("garden", "act == 'garden'")
$ event("river", "act == 'river'")
$ event("forest", "act == 'forest'")
$ event("ichiraku", "act == 'ichiraku'")

Each location triggers an "event" where the user is presented with a menu to choose what activity they want to do (which "calls" a certain section of code after it's chosen):
label academy:
menu:
"What do you want to do at the academy?"
"Study":
call study
"Tutor":
$ intelligence_points +=3
call tutor

I haven't checked yet to be *sure* that it absolutely positively works, but it looks like it would, yeah? I don't have the dialogue and such worked out yet...because I thought that the coding would take the longest - turns out it was the other way around. XD Thank you again, guys!

JQuartz
Eileen-Class Veteran
Posts: 1265
Joined: Fri Aug 31, 2007 7:02 am
Projects: 0 completed game. Still haven't made any meaningfully completed games...
Contact:

Re: More complex DSE-style menu - help

#5 Post by JQuartz »

Since the problem had already been solved I'll hijack the topic.
Jake wrote:I seem to recall the DSE code being pretty neat and pretty easy to extend, so if you're offering programming help it would probably be easier to do that than code a similar solution from scratch!
It's probably easy for programmers but not for a non-programmer like me. I tried tweaking DSE before but realize it was too complex for me. The way I code (I use mostly renpy, using jump) and the way DSE is coded (mostly python, using objects) is very different. It might be okay if I just wanted to change the words here and there (like Confused314's second post) but when new features are needed, I can't really do it without pulling all my hair out.
I suspect somebody is stealing my internet identity so don't believe everything I tell you via messages. I don't post or send messages anymore so don't believe anything I tell you via messages or posts.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], piinkpuddiin