Author Topic: Quick Scene Chooser  (Read 33165 times)

0 Members and 1 Guest are viewing this topic.

dstemmer

  • Knight at Arms
  • *
  • Assume the party escort submission position.
    • View Profile
  • Faction: Rhodok
  • MP nick: Weef_Bellington
Quick Scene Chooser
« on: November 29, 2008, 06:20:29 PM »
QUICK SCENE CHOOSER by dstemmer

Now at version 2! REQUIRES Python 2.6
. Make sure to set your PATH variable correctly to point to your Python 2.6 directory.

This is a modding tool that allows you to jump to any scene defined in your module_scenes file from the quick battles menu, in order to make scene editing more convenient. Just select the “scene chooser” option to browse through an alphabetically organized list of scene files. Press the tab key to return to the menu.

Changes in version 2:

  • adds a list of scene flags to each scene option on the menu

Changes in version 1:

  • bugfixed code
  • includes game_menu_template.py, which allows the creation game menus with text and menu options dynamically generated from long lists. Uses standard python 2.6 string formatting notation. I'll write a tutorial when I get the chance, but for now you can examine the code - it's pretty easy to figure out how to do it.

Installation:

Repository link: http://www.mbrepository.com/file.php?id=1247

  • Download "Quick scene chooser files.rar" from the repository. Unzip “template_tools.py”  into your module directory:
  • Add the following lines to the end of module_game_menus.py, after the last bracket:


Code: [Select]
import header_scenes
from template_tools import *
from module_scenes import scenes

sorted_scenes = sorted(scenes)
for i in xrange(len(sorted_scenes)):
  current_scene = list(sorted_scenes[i])
  current_scene[1] = get_flags_from_bitmap(header_scenes, "sf_", current_scene[1])
  sorted_scenes[i] = tuple(current_scene)

choose_scene_template = Game_Menu_Template(
  id="choose_scenes_",
  text="Choose a scene: (Page {current_page} of {num_pages})",
  optn_id="choose_scene_",
  optn_text="{list_item[0]}{list_item[1]}",
  optn_consq = [
    (jump_to_scene, "scn_{list_item[0]}"),
    (change_screen_mission)
  ]
)

game_menus += choose_scene_template.generate_menus(sorted_scenes)

  • Use ctrl-f to search game_menus.py and find the following two lines, and copy/paste the code in red between them:


(click to show/hide)

Note: the code you see may be indented differently than mine

  • Then just build module and you're done!

Bugs:

There's a minor issue with flag strings not being output properly in all cases, but you won't see it. I'll fix it in the next release.

Comments:

I was inspired to make this mod after seeing a similar tool in the M&B repository designed by MAXHARDMAN, but I've never actually used his tool or looked at the code. I think his was for an older version. The code is freely reusable by anybody, no credit needed. Many thanks to the M&B modding community for helping me this far!
« Last Edit: December 21, 2011, 04:48:51 PM by Caba`drin »
The following statement is true:
The preceding statement is false.

Scene Chooser Mod
Command Cursor minimod

GetAssista

  • Baron
  • *
  • TLD corovan robber
    • View Profile
  • Faction: Neutral
  • M&BWF&SWB
Re: Quick Scene Chooser
« Reply #1 on: November 29, 2008, 06:26:53 PM »
Woo-hoo, oh yeah!
Man, you've made my day  8-)

Thymo

  • Sergeant at Arms
  • *
  • Snow and science!
    • View Profile
  • Faction: Nord
  • M&B
Re: Quick Scene Chooser
« Reply #2 on: November 30, 2008, 03:41:22 AM »
Goodbye sleep!  :twisted:
e^(i*π)+1=0

Winter

  • I am Tek Jansen!
  • Developer
  • *
    • View Profile
    • Street of Eyes: The Writing of Ryan A. Span
  • Faction: Neutral
Re: Quick Scene Chooser
« Reply #3 on: November 30, 2008, 08:14:53 AM »
Now how about a dialogue after that that'll let you place visitor troops, friendly or hostile, on all the entry points? ;)

Oh, and allow choosing of the mission template as well.

Come on! It's not that hard!

Suggestively,
Winter

dstemmer

  • Knight at Arms
  • *
  • Assume the party escort submission position.
    • View Profile
  • Faction: Rhodok
  • MP nick: Weef_Bellington
Re: Quick Scene Chooser
« Reply #4 on: December 01, 2008, 05:36:23 AM »
Come on! It's not that hard!

MAKE THEE AN ARK OF GOPHER WOOD; ROOMS SHALT THOU MAKE IN THE ARK, AND SHALT PITCH IT WITHIN AND WITHOUT WITH PITCH. AND THIS IS THE FASHION WHICH THOU SHALT MAKE IT OF: THE LENGTH OF THE ARK SHALL BE THREE HUNDRED CUBITS, THE BREADTH OF IT FIFTY CUBITS, AND THE HEIGHT OF IT THIRTY CUBITS.

I'll see what I can do.  :D
The following statement is true:
The preceding statement is false.

Scene Chooser Mod
Command Cursor minimod

Penlord

  • Recruit
  • *
    • View Profile
  • Faction: Neutral
Re: Quick Scene Chooser
« Reply #5 on: December 25, 2008, 12:28:40 PM »
My text file, although opened with notepad, (I also tried opening it with a hex editor) doesn't have the lines in it, in which I need to insert the red lines.

 So... am I an idiot, is this a problem with vista, or is this a problem with my choice of programs?

Soil

  • Language Moderator
  • *
    • View Profile
  • Faction: Neutral
  • MP nick: irc://Soil
Re: Quick Scene Chooser
« Reply #6 on: December 25, 2008, 03:08:50 PM »
... is this a problem with vista...

 :lol:

Ehm, seriously.
It refers to files in the module system. Get python 2.5, make sure to create a system path, then download the module system, extract it, right click on the .py files you want to open(usually only module_blabla.py) and select "edit with IDLE". There you go.

(Note how he wrote e. g. module_scene_chooser.py)

dstemmer

  • Knight at Arms
  • *
  • Assume the party escort submission position.
    • View Profile
  • Faction: Rhodok
  • MP nick: Weef_Bellington
Re: Quick Scene Chooser
« Reply #7 on: January 02, 2009, 05:54:02 PM »
Gonna put a bugfixed version of this up in a day or two on the Repository, stay tuned.
The following statement is true:
The preceding statement is false.

Scene Chooser Mod
Command Cursor minimod

Rongar

  • Master Knight
  • *
  • Cave canem
    • View Profile
  • Faction: Sarranid
  • M&BWB
Re: Quick Scene Chooser
« Reply #8 on: January 08, 2009, 02:36:26 PM »
Very handy tool.
Thank you, dstemmer.

There were problems because of the scene sorting. So I removed the sorting. And for me without the sorting it became even easy to navigate through scenes.


Factionize items tool
I hear and I forget.
I see and I remember.
I do and I understand...
 that would better if I heard.

dstemmer

  • Knight at Arms
  • *
  • Assume the party escort submission position.
    • View Profile
  • Faction: Rhodok
  • MP nick: Weef_Bellington
Re: Quick Scene Chooser
« Reply #9 on: January 11, 2009, 04:57:15 AM »
Sorry it's been taking so long for an update - I'm moving back into a dorm at school right now and my laptop is currently kaputt, and I need to transfer the relevant files from the hard drive before sending it into the manufacturer for repair.

Rongar, could you elaborate on the problems with the scene sorting? The only bug I found is that the scene chooser was displaying one too few scenes/page, making some scenes inaccessible. I've fixed that for the next version. It's now possible to see the flags associated with each scene.
The following statement is true:
The preceding statement is false.

Scene Chooser Mod
Command Cursor minimod

Rongar

  • Master Knight
  • *
  • Cave canem
    • View Profile
  • Faction: Sarranid
  • M&BWB
Re: Quick Scene Chooser
« Reply #10 on: January 11, 2009, 08:46:45 PM »
There is no problem with sorting in Quick Scene Chooser itself.
But then scenes are sorted it is impossible to play normally, because most of scene's indexes lead to wrong scenes. The sorting mix then up.


Factionize items tool
I hear and I forget.
I see and I remember.
I do and I understand...
 that would better if I heard.

dstemmer

  • Knight at Arms
  • *
  • Assume the party escort submission position.
    • View Profile
  • Faction: Rhodok
  • MP nick: Weef_Bellington
Re: Quick Scene Chooser
« Reply #11 on: January 29, 2009, 12:45:14 AM »
Update: forgot to pull the files from my hard drive before sending it to the manufacturer, and apparently repair is going to take awhile (the motherboard has a defective chip and Everex is replacing all of that model of laptop out-of-warranty, but they've needed to replace so many that they're waiting on a new shipment from the manufacturer). So no update for awhile. Sorry.
The following statement is true:
The preceding statement is false.

Scene Chooser Mod
Command Cursor minimod

Alkamar

  • Recruit
  • *
    • View Profile
  • Faction: Khergit
Re: Quick Scene Chooser
« Reply #12 on: April 18, 2009, 04:32:29 AM »
Does this work with the latest version of B&M?

And the reason why I'm asking that is because I can't find any .py files in the B&M directory to edit...

And I dunno where to put the .py file I downloaded...

(I know I's nubbish)


Can anyone help or answer the question?

HokieBT

  • Grandmaster Knight
  • *
  • may the force be with you
    • View Profile
  • Faction: Neutral
  • M&BWB
Re: Quick Scene Chooser
« Reply #13 on: April 18, 2009, 04:45:39 AM »

you need the official module system (python programming language) which is used to create all the *.txt files that the game uses to play.

Download - http://forums.taleworlds.com/index.php/topic,49267.0.html
updated tutorial - http://forums.taleworlds.com/index.php/topic,56798.0.html
 
PC Gamer - "Uninstall KOTOR. Forget TIE Fighter and Star Wars Battlefront. There is only one Star Wars video game, and it's an unfinished mod for a six-year-old medieval RPG built by an indie studio from Turkey."

Alkamar

  • Recruit
  • *
    • View Profile
  • Faction: Khergit
Re: Quick Scene Chooser
« Reply #14 on: April 18, 2009, 06:48:00 AM »
Thanks man :D