Mod: New Game Plus

Warning - Enter at your own risk! This is an area for people to experiment with changing the way the game works.
Message
Author
SET
Posts: 22
Joined: Sat Dec 28, 2013 9:59 pm

Mod: New Game Plus

#1 Postby SET » Sun Jan 12, 2014 2:43 am

This mod allows you to start again after winning the game and keeping 25% of your skills. It's an unlockable easy mode, essentially.
Image
Yes, it's cheating. Don't use it if that offends you.
I do have an idea for an actually useful mod, so that'll be next.
Create a new text file in your LongLiveTheQueen/game directory, call it newgameplus.rpy and dump the following wall of text in there. To get rid of it delete both newgameplus.rpy and newgameplus.rpyc from that directory.

Code: Select all

# newgameplus
# Allows you to start over after winning the game and keeping 25% of your skills.
# Written for version 1.2.13
# WARNING: UNOFFICIAL AND BARELY TESTED, USE AT YOUR OWN RISK!

init 1:
  python:
    def mod_newgameplus_unlock_lumen_powers():
      global lumen_unlocked
      lumen_unlocked = True
      global pre_lumen_meditation
      pre_lumen_meditation = meditation_
      checklist_unlock('lumen')
      if mod_newgameplus:
        global sense_magic_, resist_magic_, wield_magic_
        sense_magic_ = flags.get('mod_newgameplus_sense_magic', 0)
        resist_magic_ = flags.get('mod_newgameplus_resist_magic', 0)
        wield_magic_ = flags.get('mod_newgameplus_wield_magic', 0)
        if sense_magic_ >= 25 and resist_magic_ >= 25 and wield_magic_ >= 25:
          unlocked_outfits.add('Lumen')
        update_adjusted_stats()

    try:
      mod_newgameplus = 0

      epilogue = reversed(renpy.game.script.lookup('epilogue').get_children())
      for statement in epilogue:
        if isinstance(statement, renpy.ast.With):
          if not isinstance(statement.next, renpy.ast.Call):
            raise Exception('Something went wrong finding the call to the end game menu')
          break
      else:
        raise Exception('Unable to find the call to the end game menu')
      my_epilogue_ending = renpy.game.script.lookup('mod_newgameplus_epilogue_ending').get_children()[0]

      # Just hijack the entire function/label, it's easier that way.
      unlock_lumen_powers = mod_newgameplus_unlock_lumen_powers
      renpy.config.label_overrides['init_stats'] = 'mod_newgameplus_init_stats'

      # Some proper code injection in the epilogue because it's one big label.
      statement.chain(my_epilogue_ending)
    except Exception, e:
      raise Exception('Exception "%s" while trying to apply mod "newgameplus".\nPlease delete the files newgameplus.rpy and newgameplus.rpyc from your game directory to get rid of this error.' % (e, ))

label mod_newgameplus_init_stats:
  python:
    weeknum = 0
    cruelty = 0
    commoner_approval = 0
    noble_approval = 0
    lassi = 10000
    unlocked_outfits = set()

    readback_log_line = []
    readback_log_data = []

    unroller.last_save_caption = ''

    if not persistent.game_successfully_started_in_gl:
      if renpy.get_renderer_info()['renderer']=='gl':
        persistent.game_successfully_started_in_gl = True

    if mod_newgameplus:
      composure_ *= mod_newgameplus
      elegance_ *= mod_newgameplus
      presence_ *= mod_newgameplus
      if composure_ >= 25 and elegance_ >= 25 and presence_ >= 25:
        unlocked_outfits.add('Royal Demeanor')

      public_speaking_ *= mod_newgameplus
      court_manners_ *= mod_newgameplus
      flattery_ *= mod_newgameplus
      if public_speaking_ >= 25 and court_manners_ >= 25 and flattery_ >= 25:
        unlocked_outfits.add('Conversation')

      decoration_ *= mod_newgameplus
      instrument_ *= mod_newgameplus
      voice_skill_ *= mod_newgameplus
      if decoration_ >= 25 and instrument_ >= 25 and voice_skill_ >= 25:
        unlocked_outfits.add('Expression')

      dance_ *= mod_newgameplus
      reflexes_ *= mod_newgameplus
      flexibility_ *= mod_newgameplus
      if dance_ >= 25 and reflexes_ >= 25 and flexibility_ >= 25:
        unlocked_outfits.add('Agility')

      swords_ *= mod_newgameplus
      archery_ *= mod_newgameplus
      polearms_ *= mod_newgameplus
      if swords_ >= 25 and archery_ >= 25 and polearms_ >= 25:
        unlocked_outfits.add('Weapons')

      running_ *= mod_newgameplus
      climbing_ *= mod_newgameplus
      swimming_ *= mod_newgameplus
      if running_ >= 25 and climbing_ >= 25 and swimming_ >= 25:
        unlocked_outfits.add('Athletics')

      horses_ *= mod_newgameplus
      dogs_ *= mod_newgameplus
      falcons_ *= mod_newgameplus
      if horses_ >= 25 and dogs_ >= 25 and falcons_ >= 25:
        unlocked_outfits.add('Animal Handling')

      novan_history_ *= mod_newgameplus
      foreign_affairs_ *= mod_newgameplus
      world_history_ *= mod_newgameplus
      if novan_history_ >= 25 and foreign_affairs_ >= 25 and world_history_ >= 25:
        unlocked_outfits.add('History')

      internal_affairs_ *= mod_newgameplus
      foreign_intelligence_ *= mod_newgameplus
      ciphering_ *= mod_newgameplus
      if internal_affairs_ >= 25 and foreign_intelligence_ >= 25 and ciphering_ >= 25:
        unlocked_outfits.add('Intrigue')

      herbs_ *= mod_newgameplus
      battlefield_medicine_ *= mod_newgameplus
      poison_ *= mod_newgameplus
      if herbs_ >= 25 and battlefield_medicine_ >= 25 and poison_ >= 25:
        unlocked_outfits.add('Medicine')

      accounting_ *= mod_newgameplus
      trade_ *= mod_newgameplus
      production_ *= mod_newgameplus
      if accounting_ >= 25 and trade_ >= 25 and production_ >= 25:
        unlocked_outfits.add('Economics')

      strategy_ *= mod_newgameplus
      naval_strategy_ *= mod_newgameplus
      logistics_ *= mod_newgameplus
      if strategy_ >= 25 and naval_strategy_ >= 25 and logistics_ >= 25:
        unlocked_outfits.add('Military')

      meditation_ *= mod_newgameplus
      divination_ *= mod_newgameplus
      lore_ *= mod_newgameplus
      if meditation_ >= 25 and divination_ >= 25 and lore_ >= 25:
        unlocked_outfits.add('Faith')

      # Just saving the Lumen skills in some flags for now.
      # They will be reset to 0 and restored once the crystal is unlocked.
      # Otherwise we might be passing lumen skill checks without being a Lumen. Oops.
      flags['mod_newgameplus_sense_magic'] = sense_magic_ * mod_newgameplus
      flags['mod_newgameplus_resist_magic'] = resist_magic_ * mod_newgameplus
      flags['mod_newgameplus_wield_magic'] = wield_magic_ * mod_newgameplus
    else:
      composure_ = elegance_ = presence_ = 0
      public_speaking_ = court_manners_ = flattery_ = 0
      decoration_ = instrument_ = voice_skill_ = 0

      dance_ = reflexes_ = flexibility_ = 0
      swords_ = archery_ = polearms_ = 0
      running_ = climbing_ = swimming_ = 0
      horses_ = dogs_ = falcons_ = 0

      novan_history_ = foreign_affairs_ = world_history_ = 0
      internal_affairs_ = foreign_intelligence_ = ciphering_ = 0
      herbs_ = battlefield_medicine_ = poison_ = 0
      accounting_ = trade_ = production_ = 0
      strategy_ = naval_strategy_ = logistics_ = 0

      meditation_ = divination_ = lore_ = 0

    sense_magic_ = resist_magic_ = wield_magic_ = 0

    update_adjusted_stats()
    update_bonuses()

  return

# Reinitialize some variables that the game itself only assigns in init blocks, which will *not* be executed again.
label mod_newgameplus_restart:
  hide screen credits
  python:
    # Fraction of skill points we're allowed to keep.
    mod_newgameplus = 0.25
    # Otherwise Lumen skills might be preselected, allowing the study of Lumen skills before the crystal was unlocked.
    current_morning_activity_group = current_evening_activity_group = None
    current_morning_activity = current_evening_activity = None
    # Because apparently Novan queens have to strip during coronation?
    current_outfit = 'boarding_school'
    # Locking Lumen powers again, skills will be returned on unlock.
    mentor = 'ursul'
    lumen_unlocked = False
  jump start

# Haven't figured out yet how to modify existing screens, so here's the whole thing.
screen mod_newgameplus_epilogue_menu:
    modal False
    vbox:
        yanchor 0
        xpos 693
        xanchor 0.5
        ypos 430
        textbutton ('Save Story'):
            action Return('save')
            style style.menu_choice_button
            xminimum 400
            xmaximum 400
        null:
            height 2
        textbutton ('New Game Plus'):
            action Return('ngp')
            style style.menu_choice_button
            xminimum 400
            xmaximum 400
        null:
            height 2
        textbutton 'Done':
            action Return()
            style style.menu_choice_button
            xminimum 400
            xmaximum 400

# Changing a lot of stuff here, so let's just make a new one for displaying this screen.
label mod_newgameplus_epilogue_save_log:
  # Show our own end screen with the New Game Plus option on it instead.
  show screen mod_newgameplus_epilogue_menu
  show epilogue_menu_hider onlayer screens:
    pos (483,420)
    on hide:
      linear 0.6 alpha 0.0
  hide epilogue_menu_hider onlayer screens
  $ ret = ui.interact()
  if ret=='save':
    python:
      if readback_log_line:
        readback_log_newline()
      log_written = save_log(filename='victory.html')
    if log_written:
      python:
        log_file_name = renpy.config.savedir+'/victory.html'
        open_log(filename=log_file_name)
        log_file_name = log_file_name.decode('utf-8')
      "Log saved to %(log_file_name)s\nStarting browser."
    else:
      "An error occurred saving the log.\n%(log_write_error)s"
    jump mod_newgameplus_epilogue_save_log
  elif ret=='ngp':
    hide screen mod_newgameplus_epilogue_menu
    return
  jump end_menu_jump_to_title

label mod_newgameplus_epilogue_ending:
  call mod_newgameplus_epilogue_save_log
  # The call will only return if New Game Plus was selected, otherwise it restarts RenPy.
  jump mod_newgameplus_restart

User avatar
gleeful54
Posts: 11
Age: 19
Joined: Wed Jan 15, 2014 9:27 pm

Re: Mod: New Game Plus

#2 Postby gleeful54 » Sat Jan 18, 2014 9:12 pm

So I tried this out and.... LLTQ wouldn't start! It would show the loading icon then the icon would disappear and NO GAME! D: It works now that I've deleted the mod though. My computer's horrible. Any ideas at all why it wouldn't work?

SET
Posts: 22
Joined: Sat Dec 28, 2013 9:59 pm

Re: Mod: New Game Plus

#3 Postby SET » Sat Jan 18, 2014 10:54 pm

Sorry, no idea just from that, but a few things to consider:
In another thread you mentioned that you were playing an older version of the game. Have you updated now? This mod was made for version 1.2.13 and I'm pretty sure it wouldn't work with other versions. I also only tested it with the Steam version, but I think that shouldn't really matter. Probably.
If it still doesn't work, have you tried the tutorial autoskip mod I posted in the other thread ("What about modding?")? It's way smaller and a lot less invasive, so it should have a better chance of working.
One interesting piece of information would also be if you had to delete only the .rpy file to remove the mod or if there was also a .rpyc file.
Also, what's you operating system? Windows, Mac, Linux, Android?

I'm still confused why this happened, even if everything goes very wrong, at the very least the game should leave some kind of error message.

User avatar
gleeful54
Posts: 11
Age: 19
Joined: Wed Jan 15, 2014 9:27 pm

Re: Mod: New Game Plus

#4 Postby gleeful54 » Wed Jan 22, 2014 5:41 pm

SET wrote:Sorry, no idea just from that, but a few things to consider:
In another thread you mentioned that you were playing an older version of the game. Have you updated now? This mod was made for version 1.2.13 and I'm pretty sure it wouldn't work with other versions. I also only tested it with the Steam version, but I think that shouldn't really matter. Probably.
If it still doesn't work, have you tried the tutorial autoskip mod I posted in the other thread ("What about modding?")? It's way smaller and a lot less invasive, so it should have a better chance of working.
One interesting piece of information would also be if you had to delete only the .rpy file to remove the mod or if there was also a .rpyc file.
Also, what's you operating system? Windows, Mac, Linux, Android?

I'm still confused why this happened, even if everything goes very wrong, at the very least the game should leave some kind of error message.

Not sure how to tell what version I have, and how do I update it?

SET
Posts: 22
Joined: Sat Dec 28, 2013 9:59 pm

Re: Mod: New Game Plus

#5 Postby SET » Thu Jan 23, 2014 1:33 am

I don't think the game version is mentioned anywhere in the actual game. There is a file called "game_version" that contains it, it might be the only place where it's mentioned. Says "LongLiveTheQueenRetail-1.2.13" for me.
As for updating, depends where you bought it:
Steam: Should update automatically.
GOG: Just download the game again. The download page should also tell you which version they have.
Directly from the author: Sorry, no idea. Someone who did that would have to answer that.

User avatar
Spiky Caterpillar
Posts: 402
Joined: Thu Dec 04, 2008 3:34 am
Contact:

Re: Mod: New Game Plus

#6 Postby Spiky Caterpillar » Sat Feb 01, 2014 2:50 pm

For direct purchases, Preferences: Check for updates will also show you what version you currently have.

User avatar
Ariel Schnee
Posts: 148
Age: 46
Joined: Wed May 23, 2007 3:51 am
Location: USA In The Northern Part Of Louisiana
Contact:

Re: Mod: New Game Plus

#7 Postby Ariel Schnee » Sat Feb 08, 2014 7:08 am

SET wrote:I don't think the game version is mentioned anywhere in the actual game. There is a file called "game_version" that contains it, it might be the only place where it's mentioned. Says "LongLiveTheQueenRetail-1.2.13" for me.
As for updating, depends where you bought it:
Steam: Should update automatically.
GOG: Just download the game again. The download page should also tell you which version they have.
Directly from the author: Sorry, no idea. Someone who did that would have to answer that.


Start the game.

Click on 'Preferences'.

Click 'Check For Updates' tab.

Click 'Check for updates' tab.

Make sure 'Beta' is enabled and 'Alpha' is disabled.

Then it should let you know if a new version is available for it now.

My current version is : "LongLiveTheQueenRetail-1.2.20.1".
---

Signature

If you are a believer of Jesus Christ, and are 100% proud of it, put this in your sig!!

- Ariel Schnee, twin sister of Weiss Schnee, Loyal Servant of The Royal Pony Sisters Princess Celestia and Princess Luna... Forever Equestria!

User avatar
Ariel Schnee
Posts: 148
Age: 46
Joined: Wed May 23, 2007 3:51 am
Location: USA In The Northern Part Of Louisiana
Contact:

Re: Mod: New Game Plus

#8 Postby Ariel Schnee » Tue Jan 20, 2015 4:41 pm

It doesn't seem to work with 1.2.24.
---

Signature

If you are a believer of Jesus Christ, and are 100% proud of it, put this in your sig!!

- Ariel Schnee, twin sister of Weiss Schnee, Loyal Servant of The Royal Pony Sisters Princess Celestia and Princess Luna... Forever Equestria!

SET
Posts: 22
Joined: Sat Dec 28, 2013 9:59 pm

Re: Mod: New Game Plus

#9 Postby SET » Wed Jan 21, 2015 7:01 pm

What exactly isn't working? I have 1.2.24 (Steam Edition) now and it seems to work. But I haven't played in a year and just reloaded a old savegame, that might have influenced things. I might have to actually play through the whole game from the beginning to get a good picture. Still ann error message or description might help.

User avatar
Ariel Schnee
Posts: 148
Age: 46
Joined: Wed May 23, 2007 3:51 am
Location: USA In The Northern Part Of Louisiana
Contact:

Re: Mod: New Game Plus

#10 Postby Ariel Schnee » Wed Jan 21, 2015 11:02 pm

SET wrote:What exactly isn't working? I have 1.2.24 (Steam Edition) now and it seems to work. But I haven't played in a year and just reloaded a old savegame, that might have influenced things. I might have to actually play through the whole game from the beginning to get a good picture. Still ann error message or description might help.


I played through an ending.

Went to the menu thing.

But there was no new game+ option, just the normal options that are usually there.
---

Signature

If you are a believer of Jesus Christ, and are 100% proud of it, put this in your sig!!

- Ariel Schnee, twin sister of Weiss Schnee, Loyal Servant of The Royal Pony Sisters Princess Celestia and Princess Luna... Forever Equestria!

SET
Posts: 22
Joined: Sat Dec 28, 2013 9:59 pm

Re: Mod: New Game Plus

#11 Postby SET » Thu Jan 22, 2015 11:09 pm

I just tried playing through a new game in 1.2.24 and it worked for me.
So here's a few things to try to figure this out:
    1. Are you sure the newgameplus.rpy file is still in your game directory? The update to the new version might have deleted it.
    2. Did you actually win the game? The option is only available if get make it to coronation.
    3. Try rightclicking, going to Preferences, Video Settings, Debugging Console and enter

    Code: Select all

    say(str(mod_newgameplus), "")
    and press enter twice. What does the console say?

User avatar
Ariel Schnee
Posts: 148
Age: 46
Joined: Wed May 23, 2007 3:51 am
Location: USA In The Northern Part Of Louisiana
Contact:

Re: Mod: New Game Plus

#12 Postby Ariel Schnee » Fri Jan 23, 2015 3:38 am

SET wrote:I just tried playing through a new game in 1.2.24 and it worked for me.
So here's a few things to try to figure this out:
    1. Are you sure the newgameplus.rpy file is still in your game directory? The update to the new version might have deleted it.


C:\Program Files\Long Live The Queen\newgameplus.rpy

SET wrote:2. Did you actually win the game? The option is only available if get make it to coronation.


Yep. Used a saved game file. Had a good run through.

SET wrote:3. Try rightclicking, going to Preferences, Video Settings, Debugging Console and enter

Code: Select all

say(str(mod_newgameplus), "")
and press enter twice. What does the console say?


" An exception occurred: name 'mod_newgameplus' is not defined "
---

Signature

If you are a believer of Jesus Christ, and are 100% proud of it, put this in your sig!!

- Ariel Schnee, twin sister of Weiss Schnee, Loyal Servant of The Royal Pony Sisters Princess Celestia and Princess Luna... Forever Equestria!

User avatar
Spiky Caterpillar
Posts: 402
Joined: Thu Dec 04, 2008 3:34 am
Contact:

Re: Mod: New Game Plus

#13 Postby Spiky Caterpillar » Sat Jan 24, 2015 7:27 pm

Neko Hibiki wrote:
SET wrote:[list]1. Are you sure the newgameplus.rpy file is still in your game directory? The update to the new version might have deleted it.


C:\Program Files\Long Live The Queen\newgameplus.rpy


It should be in C:\Program Files\Long Live The Queen\game\newgameplus.rpy.
(I occasionally make that mistake when testing modstuff too)

SET
Posts: 22
Joined: Sat Dec 28, 2013 9:59 pm

Re: Mod: New Game Plus

#14 Postby SET » Mon Jan 26, 2015 1:54 am

Jup, what the Caterpillar said, wrong directory.
That said, version 1.3 is a huge update, I'm expecting that it will break all mods. I'll try to adjust them once the update hits Steam.

User avatar
ark99k
Posts: 202
Joined: Wed Jun 27, 2012 11:00 pm

Re: Mod: New Game Plus

#15 Postby ark99k » Thu Aug 13, 2015 10:05 pm

I set it up, but there isn't any option for "New Game +"? How do I use it then?
★Shining like a star!★


Return to “Modding and other Messing Around”

Who is online

Users browsing this forum: No registered users and 1 guest