Updated Module System Tutorial Mar 29 2009 - see first thread!

Currently Viewing (Users: 0, Guests: 1)

jik

Knight
Best answers
0
I have been working on this for a while, and I have posted a usable draft at the repository:

http://www.mbrepository.com/file.php?id=1101
Direct link: http://www.freewebs.com/jikbyond/40kTut/M&B%20Module%20System%20Doc2-3.pdf
(might as well use my old site...)


###MAR 29 2009 Update (small)

Added what I (with the help of SantasHelper) learned about tableau_materials.py.  This includes:
A quick touch on banner background colors.
Editing the material to allow for the banner (playing with the alpha channel)
Using a free UV map tool to map change the UV map on a piece of armor
Things needed in the BRFeditor to make the tableau_material work
Tuples needed in tableau_meshes, meshes, and items.py



###FEB 23 2009 Update
Cleaned up more of the wording and some inconsistancies (thanks to MartinF).  A few more parts have been added  The flow of the tutorial is now:
Getting Started
Editing the Module System
Troops
Party Templates
Items
Constants, Factions, Strings and Quests
Game Menus *NEW with features to speed up mod testing
Scene Editing
Dialogs
Triggers
Mission Templates *NEW dueling from conversation to finish quest
Apendix *NEW, but not much here yet.

The only thing I feel is missing is finishing the quest from a field battle.  I want to find a better way (most likely a custom battle mission template) than to insert my code for ending the quest in the standard battle mission template.

Up to this point I feel that I have put in enough work on this for it to hold over a few of the new comers to modding.  I have put off my own mod for quite some time to do this, and I want to start to focus on that now.  If there are glaring errors (or code that causes problems) please let me know and I will fix it.  I may finish the battle mission stuff later on, but I will be adding to the appendix as information comes to me.


###FEB 12 2009
updated:
cleaned up some type-os and inconsistencies in parts of the code.  Cleaned up a lot of the copy/paste errors, made the quest execute faster.

Added:
Some more direct info with folders and setting up for module editing
Concepts for changing Menu backgrounds in part 2
Basic slot usage examples with Dialogs
Updated the dialogs and quest.  Has a testable success state

As it stands, there is still more to do, and I am next going to focus on menus and battle code blocks.  Thanks for reading and let me know if any issues arise, or you find something glaringly wrong.

********

I have gone through up to the end of Part 9 to make sure these sections work, and I have had no problems.  What it will show you, with some expinations, is how to:

Change/modify Map Icons (towns, player, etc.)
Create new parties (towns, soldiers, etc.)
Create new troops (both regular and NPCs.  I don't go into the special Merchants yet)
Create troop upgrading trees
Create scenes, as well as use the in game editor to set up a tavern
Create Dialogs with branching conversations
Create quests that stem from dialogs, including variables used to track them.
Use Triggers to spawn parties.

This is not a complete Tutorial as of yet.  The quest create starts up, but I need to set the success/fail states.  I am also looking to modify it a bit to talk more about using slots, but I myself have to understand it better to offer information on it.  I also hope to add a glossary at the end with some information on various other aspects which I did not go into too much detail with in the tutorial.

This is for BEGINNERS, though some out there may find something they didn't touch on.

I am also looking for feed back, in case those experience Modders have some time.  This document will hopefully help you as well, taking away all the simple questions that are thrown at you.  If you see some thing in there that I have done that either is not the best way, or could lead to trouble, please let me know. 

Enjoy.

 

HokieBT

Grandmaster Knight
M&BWB
Best answers
0
hey, this looks great, nice work!      Hopefully an Admin will move this into the Documentation board so it doesn't get lost?
 

jik

Knight
Best answers
0
Thanks, but I still want to finish it up... 

Can I PM you a question?
 
Best answers
0
well i've just started on this but it seems really good, thanks.

i've been looking for thid for a while.
 

jik

Knight
Best answers
0
Please note that it is not complete, and I have tried to document in the... um... document where it is not finished.

I have done some more work on it, and will hopefully have the quest part finished in a day or 2...  I think I think I did indicate where I have worked up to with big red text


One thing that I would say go slow to is the dialog and triggers for the quest.  I have made some changes to clean up lose ends, though you could go on without it. 

The one thing I would ask is that if you pic up an updated version of this tutorial, please start it again from the beginning, or just use it for reference.
 
Best answers
0
ok i'm really having problems getting this to work.

When i make the new town in the centre of the map, mount and blde won't start saying it can't access quick string or something. RGL error.

Also, I think this is caused by the build module.bat not working.

There's a bucnh of errors saying icon_new_icon cannot be defined.

any help?
 

Lord Samuel

Sergeant Knight
WB
Best answers
0
Thank you, Jik...
I was in need for some simple, up-to-date modding tutorial, and you came as Moses himself from the mountain.

This tutorial is very interesting, very clear, and it gave me the will, man !

:smile:
 

jik

Knight
Best answers
0
captain lust said:
ok i'm really having problems getting this to work.

When i make the new town in the centre of the map, mount and blde won't start saying it can't access quick string or something. RGL error.

Also, I think this is caused by the build module.bat not working.

There's a bucnh of errors saying icon_new_icon cannot be defined.

any help?
I had the same issue the first time I started to re-write the tutorial, give me a sec to try and remember what I did.  Can you post a screen shot of the compile error?  It usually points to something specific.  Also, M&B should load, just not the mod you are creating, so the native module should be fine.  If not, there is something else wrong.



 
Best answers
0
it's kl i worked it out in the end. I think it was the thing where it scans some sections before others so you have to do it twice.

Still having a few problems though, it'd be great if i could talk them through with someone over msn.
 

froggyluv

Master Knight
NW
Best answers
0
Thanks alot for writing this! I haven't tried any sort of programming since Basic on my old C64 :mrgreen:

I'm trying to learn both a little Python as well as M&B and right now the main problem seems to be understanding where exactly to place new text. I was able to place the new troop type in the first part of your tutorial but keep getting syntax errors on the 'Module_Parties.py' one.

("main_party","Main Party",icon_player|pf_limit_members, no_menu, pt_none,fac_player_faction,0,ai_bhvr_hold,0,(17, 52.5),[(trp_player,1,0)]),(trp_new_troop,5,0)]),
  ("temp_party","temp_party",pf_disabled, no_menu, pt_none, fac_commoners,0,ai_bhvr_hold,0,(0,0),[]),
  ("camp_bandits","camp_bandits",pf_disabled, no_menu, pt_none, fac_outlaws,0,ai_bhvr_hold,0,(1,1),[(trp_unarmed_troop,3,0)]),

..is how I have written in my Text Editor yet I keep getting the Build errors.
 

Shik

Baron
M&BWBWF&S
Best answers
0
froggyluv said:
("main_party","Main Party",icon_player|pf_limit_members, no_menu, pt_none,fac_player_faction,0,ai_bhvr_hold,0,(17, 52.5),[(trp_player,1,0),(trp_new_troop,5,0)]),
Fixed.

Now study it and understand what you did wrong.
 

jik

Knight
Best answers
0
Fei Dao said:
froggyluv said:
("main_party","Main Party",icon_player|pf_limit_members, no_menu, pt_none,fac_player_faction,0,ai_bhvr_hold,0,(17, 52.5),[(trp_player,1,0),(trp_new_troop,5,0)]),
Fixed.

Now study it and understand what you did wrong.
This is why I am including some suggestions on tab indenting code blocks.  I had the same problem on several occations.  I would type it out like this:
("main_party","Main Party",icon_player|pf_limit_members, no_menu, pt_none,fac_player_faction,0,ai_bhvr_hold,0,(17, 52.5),
    [(trp_player,1,0),
    (trp_new_troop,5,0)
    ]
),


This also helps with my other problem of not putting a comma at the end of the line (trp_new_troop,5,0)
 

froggyluv

Master Knight
NW
Best answers
0
Stupid question (you'll be getting a lot from me), but I learn more by disecting other mods to see how they go about doing things - how do I look at a file (in written form rather than binary), ie. Modules_Troops, from a mod once it has already been converted to code?
 

MartinF

Squire
Best answers
0
Hi jik,

Good effort on this, mate! The old one was badly in need of an update; I should know, I started the modding while using it about a week ago. Wish I'd had your version instead.

I'll try and contribute by going over it once more and pointing out any errors or inclarities I find. Off the top of my head:

  • When I added a new town to my native, instead of getting a combat encounter when I entered it, I just went into a proper town with working merchants, tavern, etc. I think this might have something to do with MNB's interpreting the tf_town and just creating one there, but I'm not sure.
  • I had the same problem with the [new_icon] not being recognized. Haven't tried again since (haven't had a need for it) so I'm not sure what the problem was but maybe that section should be looked at more closely

Also some points that should maybe be clarified:

In section 1.5 where you talk about setting up the module_info.py I think you should mention that the last forward slash in the url is critical. If, like me, you simply copy the address from windows and then change the backslashes to forward ones, you might, like me, forget to do that and spend half an hour trying to figure out why your changes aren't showing up in-game.

That's about it for now. Again, great job on this, makes life loads easier for those of us just starting out.


 

jik

Knight
Best answers
0
froggyluv said:
Stupid question (you'll be getting a lot from me), but I learn more by disecting other mods to see how they go about doing things - how do I look at a file (in written form rather than binary), ie. Modules_Troops, from a mod once it has already been converted to code?
The first part of the tutorial explains this.
 

jik

Knight
Best answers
0
MartinF said:
Hi jik,

Good effort on this, mate! The old one was badly in need of an update; I should know, I started the modding while using it about a week ago. Wish I'd had your version instead.

I'll try and contribute by going over it once more and pointing out any errors or inclarities I find. Off the top of my head:

  • When I added a new town to my native, instead of getting a combat encounter when I entered it, I just went into a proper town with working merchants, tavern, etc. I think this might have something to do with MNB's interpreting the tf_town and just creating one there, but I'm not sure.
  • I had the same problem with the [new_icon] not being recognized. Haven't tried again since (haven't had a need for it) so I'm not sure what the problem was but maybe that section should be looked at more closely

Also some points that should maybe be clarified:

In section 1.5 where you talk about setting up the module_info.py I think you should mention that the last forward slash in the url is critical. If, like me, you simply copy the address from windows and then change the backslashes to forward ones, you might, like me, forget to do that and spend half an hour trying to figure out why your changes aren't showing up in-game.

That's about it for now. Again, great job on this, makes life loads easier for those of us just starting out.
[EDIT: ops, wrong quote...  :oops:]

Thanks for the feed back, I will be making those changes.  I might also push back part 2 a bit and sub in some more basic manipulation.  I hit a snag with adding some slot manipulation and so I am going to start over again (yes, everytime I make any changes I run through the whole tutorial again myself to find where I caused a problem) and I will focus on what you are talking about. 

To those I have helped so far, please be patient, I will hopefully be adding some more versitile and proper coding techniques (and more focus on proper indent formating - well the way I would do it).  Since I hit this snag, may be out by the weekend.