Mount and Blade coding vs. C++

正在查看此主题的用户

I myself don't know too much coding, or the similarities/differences between the two types.

I can say this though: You're not likely to get much help in this board of the forum.
I suggest you ask some of the many skilled modders present in the Pioneers/Cartographers guild about this in a PM.
 
They differ quite a bit. I find the Module System language to be more accessible for the newbs than an object-oriented language like C++, and anyone who knows the basics of programming (like knowing something of C++) can easily pick up what needs doing in the Module System. That said, there are some large inefficiencies and many more nuances when working the module system language as compared to something like C++ or Python, or BASIC, or whatever, but that's a typical trade off.

I'd suggest checking out my module system syntax sig link for a coding language-type discussion (and the module system documentation, etc, over at the Forge, too, of course).

And, as RalliX noted, this is better in the Module Development section, so whoosh it's off to the Forge with the thread.
 
It's a bit hard to compare I guess. They have completely different purposes and are on a completely different level. The module system for Warband is some 'home-made' language that tells the game what to do, while C++ directly talks to the computer (via the OS of course) and you virually do anything with it. This also means it's way more intimidating if you have no experience with coding.

The question is probably, what do you want to do? With the module system you can only go so far and warband has many quirks and limitations. However if you start from scratch, you can do whatever you want if you know how ^^

I actually think C++ makes more sense then the module-sytem language, but there is much more you have to think about and not as easy to get going.
 
M&B ModuleSystem is a scripting language. C++, however, is a general-purpose intermediate-level programming language.

Each command in the ModuleSystem is actually a function call to a C++ function. The game engine reads the compiled script files (.txt files in Module folder) and executes the codes in C++. So calling (is_between ":value", ":range_low", ":range_high") is calling to a C++ function probably close to this.
(read the post below)

Raw C++ is obviously more powerful. Instead of writing (is_between, ":value1", 0, 3),(is_between, ":value2", 10, 15) you can have this. It's quite faster and gives you more control, however it can be more complex to a beginner.
插入代码块:
if( value1 >= 0 && value1 < 3 && value2 >= 10 && value2 < 15 )
{
    <execute code>
}
 
Faunus 说:
Each command in the ModuleSystem is actually a function call to a C++ function.
Not exactly, no; it's a switch with ~2000 cases.
Your point still stands, though.
 
cmpxchg8b 说:
Not exactly, no; it's a switch with ~2000 cases.
OMG, looking how they scripted MS I still hoped that their C++ coding style was different.
 
^ this.

I imagine that managing ~2000 cases in a switch can be quite difficult. That source file must be abnormally large. :shock:
 
cmpxchg8b 说:
Not exactly, no; it's a switch with ~2000 cases.

I think if we're talking about a scripting syntax (is_between, ":value1", 0, 3), is not so simple at all.
The 3 operands can be anything from immediate values, global variables, local variables, or registers. And what we call global/local variables and registers on MS scope must be composed as something else on WB scope. So a awitch with 2000 cases is not very surprising.
 
Rongar 说:
cmpxchg8b 说:
Not exactly, no; it's a switch with ~2000 cases.
OMG, looking how they scripted MS I still hoped that their C++ coding style was different.

most probably not :p
Their work on the shader files isn't very pretty either.
 
@OP: it depends on what are you trying to do.
If you make a MB mod, you must use MB's scripting language (i.e. the Module System). If you are trying to make something else, you can't use MB's scripting language, and also C++ may not be your best option, especially if you don't have a programming background.
Find a good coder. It helps a lot.
 
I'm not going to defend TaleWorlds here, but you know, the
插入代码块:
case "troop_yourmomsugly": {return "blarg!";}
is probably one of the best and most optimized structured clauses they may accomplish.


We all now how messy they can be, fixing two bugs and putting in the wild two dozens of regressions at the same time.  :smile:
 
One is like a specific key that only fits into one lock, which may be broken at any time.

The second is like a set of lockpicks, and the hard part is deciding which picks to use.

IOW, they're completely different animals. 

New to programming?  Wanting to learn?  I'd honestly suggest picking up some free guides to JavaScript and downloading a copy of Unity3D to learn about coding in general, and gamecode in particular.  Then graduate from there to C#.

Learning Module System as your first language will, unfortunately, prove pretty confusing, going to other languages, because the way logic's handled is fairly funky. 

Going the opposite way is much, much easier, because you just have to turn a few things around in your head and you can't (easily) do the things you need to learn for other languages (dealing with types and tables, in particular) that you need almost everywhere else.
 
后退
顶部 底部