Adding new custom preferences

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.
Message
Author
User avatar
chronoluminaire
Eileen-Class Veteran
Posts: 1153
Joined: Mon Jul 07, 2003 4:57 pm
Completed: Elven Relations, Cloud Fairy, When I Rule The World
Tumblr: alextfish
Skype: alextfish
Location: Cambridge, UK
Contact:

Adding new custom preferences

#1 Post by chronoluminaire » Wed Mar 28, 2007 8:33 am

Hi there. I'm wanting to add one custom preference to my NaNoRenO game, but the [reference pages] [on the subject] are a bit confusing... I've cobbled together the code below from a few different places and posts, and I'm not at all sure whether it'll work or whether it's what I should do. Can Py'Tom (or anyone else) advise?

Code: Select all

init:
 $ combatpref = _Preference("Combat Mode", DoFullCombats, ("Details (Minigame)", True, None), ("Overview (Story)", False, None))
 $ library.preferences.insert(2, combatpref) # the 2 is a guess at the position in the prefs list

label Combat:
 # We come in here each time there's a combat. 
 # If the user hasn't specified a preference for whether to use the combat minigame or not, ask them
 if _preferences.DoFullCombats == None:
 menu:
   "{I}Let me control the details of the combat{/I}":
     _preferences.DoFullCombats = True;
     jump DoCombat
   "{I}Just show me the overview of the combat{/I}":
     _preferences.DoFullCombats = False;
     jump DontDoCombat
I released 3 VNs, many moons ago: Elven Relations (IntRenAiMo 2007), When I Rule The World (NaNoRenO 2005), and Cloud Fairy (the Cute Light & Fluffy Project, 2009).
More recently I designed the board game Steam Works (published in 2015), available from a local gaming store near you!

User avatar
chronoluminaire
Eileen-Class Veteran
Posts: 1153
Joined: Mon Jul 07, 2003 4:57 pm
Completed: Elven Relations, Cloud Fairy, When I Rule The World
Tumblr: alextfish
Skype: alextfish
Location: Cambridge, UK
Contact:

#2 Post by chronoluminaire » Thu Mar 29, 2007 6:53 am

Well, I continued muddling, and seem to have muddled my way to something that seems to at least work. I'd still very much appreciate any comments on things in here that might be a bad idea to do.

I couldn't find a way to do things sensibly using a field of _preferences - I had to use a field of persistent. But that seems to work.

The most confusing bit for me was finding how to add the new preference to "an appropriate list" in library.preferences. I added an example to the Preference screen wiki page to help users similarly clueless to at least have something to work on; the example I put there may want changing by Py'Tom or someone else who knows what they're doing.

Code: Select all

init:
    $ combatpref = _Preference("Combat Mode", "DoFullCombats", (("Details (Minigame)", True, None), ("Overview (Story)", False, None)), base = persistent)
    $ library.preferences['prefs_left'].insert(3, combatpref) # the 3 is the current bottom of the prefs list


label Combat:
 # We come in here each time there's a combat.
 # If the user hasn't specified a preference for whether to use the combat minigame or not, ask them
 if persistent.DoFullCombats == None:
     menu:
       "{i}Let me control the details of the combat{/i}":
         $ persistent.DoFullCombats = True;
         jump DoCombat
       "{i}Just show me the overview of the combat{/i}":
         $ persistent.DoFullCombats = False;
         jump DontCombat 
 else:
     if persistent.DoFullCombats:
         jump DoCombat
     else:
         jump DontCombat
    

label DoCombat:
    "Let's get into the combat!"
    return
label DontCombat:
    "The combat happens."
    return
I released 3 VNs, many moons ago: Elven Relations (IntRenAiMo 2007), When I Rule The World (NaNoRenO 2005), and Cloud Fairy (the Cute Light & Fluffy Project, 2009).
More recently I designed the board game Steam Works (published in 2015), available from a local gaming store near you!

User avatar
PyTom
Ren'Py Creator
Posts: 15893
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

#3 Post by PyTom » Thu Mar 29, 2007 7:54 am

I will attempt to respond later today.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
DaFool
Lemma-Class Veteran
Posts: 4171
Joined: Tue Aug 01, 2006 12:39 pm
Contact:

#4 Post by DaFool » Thu Mar 29, 2007 8:18 am

Is this a narrated-combat thing, or a full battle engine?

User avatar
chronoluminaire
Eileen-Class Veteran
Posts: 1153
Joined: Mon Jul 07, 2003 4:57 pm
Completed: Elven Relations, Cloud Fairy, When I Rule The World
Tumblr: alextfish
Skype: alextfish
Location: Cambridge, UK
Contact:

#5 Post by chronoluminaire » Thu Mar 29, 2007 9:10 am

DaFool wrote:Is this a narrated-combat thing, or a full battle engine?
Yes. :P
Specifically, *if* I have time to get it all finished within the next 3 days, Elven Relations will let people choose either to play RPG-style combats in a vaguely ToL/Heikou manner, or not to play them and instead just select a broad overall strategy.

The idea is that people can say which mode they want when the first combat comes up, but change it at any point from the Preferences menu.
I released 3 VNs, many moons ago: Elven Relations (IntRenAiMo 2007), When I Rule The World (NaNoRenO 2005), and Cloud Fairy (the Cute Light & Fluffy Project, 2009).
More recently I designed the board game Steam Works (published in 2015), available from a local gaming store near you!

User avatar
DaFool
Lemma-Class Veteran
Posts: 4171
Joined: Tue Aug 01, 2006 12:39 pm
Contact:

#6 Post by DaFool » Thu Mar 29, 2007 9:50 am

I must say I am most looking forward to your game :D

It seems all my preaching about hybrids was not in vain 8)

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

#7 Post by Jake » Thu Mar 29, 2007 10:34 am

So... coincidentally, Morning Star also incorporates FF-style (or more closely, Skies of Arcadia-style) battles (and I might note, was conceived as such before I saw the word 'hybrid' first mentioned on these forums; it's kind of dictated by the story... :P) and - as I've suggested on other discussions on the topic - I'm a little worried about how much it takes over the game. Specifically, it was put in as another element of gameplay without any intention particularly to lengthen the playthrough time, and it probably occupies about 50% of the player's attention from start to finish. I had to code a 'skip battles' flag the other day just to test some of the other stuff over the course of a game... but that could just be 'cause I've spent too long testing battle-related stuff and it's too familiar.

Have you had any similar problems with Elven Relations? How much of a playthrough do you expect to be taken up with combat?

(I must admit, it's tempting to ask my project partner (who does all the engine programming) how feasible it would be to steal your overview idea. ;-))
Server error: user 'Jake' not found

User avatar
DaFool
Lemma-Class Veteran
Posts: 4171
Joined: Tue Aug 01, 2006 12:39 pm
Contact:

#8 Post by DaFool » Thu Mar 29, 2007 11:06 am

Is Morning Star your NaNo game?

I don't want to set a precendent that people feel they should have something spiffy to offer in their game. Having random battles just for the heck of it is not a good idea, but having random battles because the characters are indeed warriors is.

Suffice to say, I am going to absorb yall's battle engines and make sure what I finally end up with on H&C will be different (and more appropriate to the circumstance)

About battles taking up 50%, well yeah that's the default divide between story and gameplay (I think it's about accurate for Magical Boutique, although there are extended simulation times that make the actual time aspect be more like 75% gameplay 25% story)

User avatar
chronoluminaire
Eileen-Class Veteran
Posts: 1153
Joined: Mon Jul 07, 2003 4:57 pm
Completed: Elven Relations, Cloud Fairy, When I Rule The World
Tumblr: alextfish
Skype: alextfish
Location: Cambridge, UK
Contact:

#9 Post by chronoluminaire » Thu Mar 29, 2007 11:23 am

Elven Relations should be 90% story, 10% battles - if I even get the battle mode finished in time for a NaNoRenO release. If not then it'll be 99% story, 1% "battle overview" (something like a brief narrated combat story). It was never going to be principally about the combats.

The principal reason I wanted to have combats was because I wanted to see Final Fantasy-style combats, but where your actions in combat have an effect on which the different girls think of you individually. I.e., who you defend, heal, or whatever, will have consequences in the rest of the story.

If I can't get battle mode finished in time then the NaNoRenO release of Elven Relations will be combat-free (well, only have narrated combat), and the minigame will have to wait for a later 1.1 release. And you should find plenty to enjoy in a combat-free Elven Relations - it's not a massive part of the game.
I released 3 VNs, many moons ago: Elven Relations (IntRenAiMo 2007), When I Rule The World (NaNoRenO 2005), and Cloud Fairy (the Cute Light & Fluffy Project, 2009).
More recently I designed the board game Steam Works (published in 2015), available from a local gaming store near you!

User avatar
DaFool
Lemma-Class Veteran
Posts: 4171
Joined: Tue Aug 01, 2006 12:39 pm
Contact:

#10 Post by DaFool » Thu Mar 29, 2007 11:41 am

My initial plans for Hardcastle and Cromwell were like Elven Relations (mostly story + oh! cool! battles) but my final plans right before I got distracted was tending to become like Magical Boutique (the story elements were designed around the Engine, in the form of events). At this point I am still not sure since I'm focusing on another project to get it done first, but I think I'm now sticking to the latter plan (design around an engine)

Instead of Final Fantasy or Skies of Arcadia, my sources of inspiration (apart from MagBou of course which just has a neat resolution system that *could* be used for battles) were Grandia and Legend of Dragoon, simply because I loved their battle systems better. (In fact I regarded the battles in FF -- I only played until VIII until I drifted apart from my Playstation) and most especially Skies of Arcadia as very tedious)

But regardless of the system, I always love the Japanese RPGs for getting to surround yourself with cute girls who are highly resilient in magic -- perfect for boss battles! I don't play western rpgs much because they offer less oppurtunity for harems.

User avatar
chronoluminaire
Eileen-Class Veteran
Posts: 1153
Joined: Mon Jul 07, 2003 4:57 pm
Completed: Elven Relations, Cloud Fairy, When I Rule The World
Tumblr: alextfish
Skype: alextfish
Location: Cambridge, UK
Contact:

#11 Post by chronoluminaire » Thu Mar 29, 2007 12:24 pm

DaFool wrote:Instead of Final Fantasy or Skies of Arcadia, my sources of inspiration (apart from MagBou of course which just has a neat resolution system that *could* be used for battles) were Grandia and Legend of Dragoon, simply because I loved their battle systems better. (In fact I regarded the battles in FF -- I only played until VIII until I drifted apart from my Playstation) and most especially Skies of Arcadia as very tedious)
Just out of interest, what was it about the battles in Grandia / LoD that are better / less boring? I haven't played either, and especially if I'm not having to finish this combat system in the next 2 days, I might like some ideas for how to make it interesting.
I released 3 VNs, many moons ago: Elven Relations (IntRenAiMo 2007), When I Rule The World (NaNoRenO 2005), and Cloud Fairy (the Cute Light & Fluffy Project, 2009).
More recently I designed the board game Steam Works (published in 2015), available from a local gaming store near you!

User avatar
DaFool
Lemma-Class Veteran
Posts: 4171
Joined: Tue Aug 01, 2006 12:39 pm
Contact:

#12 Post by DaFool » Thu Mar 29, 2007 12:41 pm

chronoluminaire wrote:Just out of interest, what was it about the battles in Grandia / LoD that are better / less boring? I haven't played either, and especially if I'm not having to finish this combat system in the next 2 days, I might like some ideas for how to make it interesting.
The battles in Grandia are set to a timeline, so it's a semi-turn-based / semi-real-time battle. You see your opponents and allies queued up on the timeline and advancing towards you on that timeline. Depending on their attack speed as well as physical proximity, you can gauge whose turn is next (which may be different from the actual order you set their actions). For example, you can't expect a lumbering polar bear from the other end of the battlefield to reach you without you noticing, so you can plan ahead and set an evasive manuever. Or you can set up a counterattack...that's called "Critical" when an opponent is most vulnerable just when it's about to strike you.

The battles in LoD are more controversial...I like it because I've mastered it. It's basically glorified button-mashing, but heck, it's fun. By hitting the button at the exact time you strike, you can deal additional damage by adding extra sequences. If you are able to complete the full sequences, you are able to deal the most damage as well as build up enough stored energy to more easily transform into Dragoon mode.

Of course, you can't really expect to implement all these in a fully-turn-based system (such as in a visual novel engine).

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

#13 Post by Jake » Thu Mar 29, 2007 12:47 pm

chronoluminaire wrote:Just out of interest, what was it about the battles in Grandia / LoD that are better / less boring?
I can only speak for Grandia II (the only one I've played) but I have to agree with DaFool that it's probably the best battle system I've seen in a JRPG by a fair margin. The two things which are good about it from my point of view were:

- The activation/initiative system: You have a bar along the bottom of the screen which each combatant moves along from left to right; when they hit three-quarters of the way along, you have to select an action for them, but they don't perform that action until they're right at the end. Additionally, depending on the action their speed along that last quarter changes, and some attacks knock the target back towards the left. So it's entirely plausible sometimes to say "I'll just hit that enemy with a quick stab that won't do much damage, because it'll knock him back quarter of the bar and out of activation and give my spellcaster time to activate and cast a really damaging spell" - if you're careful, you can sometimes manage battles so that the enemy barely gets a look-in, but it takes planning.

- The non-fixed positioning: G2, at least, had a 2-D field which the battle took place in, and your characters ran around inside that. You couldn't directly control them, if you told them to physically attack a target then they'd run over to next to that target, hit them and stay there until their next activation. If they were right the way over the other side of the field, or if the enemy coincidentally moves away from them as part of its own activation, they might run out of time and not get an attack in at all. Area of effect spells existed, so again, with careful planning you could manoeuvre all the bad guys into a group and hit them all with the same explosion or whatever.

Unfortunately, both of those things were deemed far too complex to get into a NaNaRenO entry. :/

(And personally, I quite liked the battle engine in Skies of Arcadia; the reason it was bloody tedious was because the random battle incidence rate was far too high; in one section, fighting against a headwind, I was making backwards progress at times 'cause I didn't have time to hold down 'forwards' after one battle and before the next and got blown back a bit. :/)
Server error: user 'Jake' not found

User avatar
PyTom
Ren'Py Creator
Posts: 15893
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

#14 Post by PyTom » Thu Mar 29, 2007 4:32 pm

Just to confirm, the example of a preference here looks like a good one. I apologize for not getting a chance to look it over in more detail earlier.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
chronoluminaire
Eileen-Class Veteran
Posts: 1153
Joined: Mon Jul 07, 2003 4:57 pm
Completed: Elven Relations, Cloud Fairy, When I Rule The World
Tumblr: alextfish
Skype: alextfish
Location: Cambridge, UK
Contact:

#15 Post by chronoluminaire » Thu Mar 29, 2007 8:49 pm

That's great, Py'Tom - thanks. It looks like I just about managed to get there on my own. And don't worry about not having been able to look at it yesterday - you had a kinda important place to be! Speaking of which, congrats on your PhD prelim ^.^
I released 3 VNs, many moons ago: Elven Relations (IntRenAiMo 2007), When I Rule The World (NaNoRenO 2005), and Cloud Fairy (the Cute Light & Fluffy Project, 2009).
More recently I designed the board game Steam Works (published in 2015), available from a local gaming store near you!

Post Reply

Who is online

Users browsing this forum: Google [Bot]