Learning Python ?

Users who are viewing this thread

The script language used in M&B Warband (MaBL) is quite different from Python, Python is mostly getting used to compile the Module System at the end. It does however help if you have some basic knowledge at a programming language.

For the Introduction to Module System and Syntax, you can start here:

Documented Version of header_operations.py (the list of all available operations:
Wiki about the operations (and some other useful informations):

Getting started at modding:

Happy modding! If you have questions or get stuck, feel free to ask :grin:
 
Will learning the Python programming language help me with modding Warband ?

Will it be useful in helping me mod Warband ?
Even though more than 95% of scripts are written in M&B language, Python is also compatible with the ModSys and can be used to create things otherwise hard to create with M&B language. Python is not mandatory at all to learn M&B language.
well is there some sort of tutorial or guide for me to learn MaBL ?
Yes, the entire ModSys is all what you really need. Just learn the basics and read scripts to know it is done. Take a look at Earendil's post above and follow every linked resource. All of them are helpful.
 
Will learning the Python programming language help me with modding Warband ?

Will it be useful in helping me mod Warband ?
As someone who has used MaBL/Modsys everyday for years, I have only ever used true Python two or three times, and every time it was automate what would have been Ctrl+C, Ctrl+V x 1000. It's totally superfluous.
 
So is Python even needed for modding or is it just a waste of time to learn if you want to mod and create things in Warband ?
The post above yours puts it quite well: You will very rarely, if ever, need it. If so, it is only to make something easier that you can also do in a more tedious way without Python.

As for myself, I don't think I've ever touched Python to do things with Warband - I wouldn't say I know the language, and I've never felt the need to use it for Warband. The only thing that can be helpful is having a grasp on the syntax, but you will usually get that fairly quickly through trial and error anyways.

If you wanna get started, I'd say check out some of the guides around the forums and what Earendil linked above, and from that point just do what you want to do - find something that does something close to it, copy it, change it to what you need. With a bit of time, you will be able to create things completly on your own. And if you ever run into something that you need Python for, pick it up then.
 
Pure Python is almost useless in M&B language and can be avoided since the ModSys covers it all (almost). Python is difficult to learn and of little use in M&B language. That being said, focus on the ModSys and its own language and forget about pure Python as it is not needed at all. Madmin, an OSP submod for Native (https://forums.taleworlds.com/index...-source-native-compatible-admin-tools.175171/), has many pure Pythonic scripts which look like this:
Python:
def addMadminItems(items):
    index=0
    #print "\tAdding New Items" #DEBUG
    items.append(akcount)
    for i in items:
        if (i[0] == "polehammer"):
            items[index] = banhammer
        if (i[0] == "practice_staff"):
                        items[index] = kickstaff
                if (i[0] == "wooden_stick"):
                        items[index] = killswitch         
        index+=1
Once you have learned scripting, you may check out its source code to learn how Pythonic stuff accomplished various things.
 
Back
Top Bottom