WB Coding Adding Master of the field to a multiplayer mod

Users who are viewing this thread

vtz

Sergeant
Hello there,

There is a Polish multiplayer mod called The Deluge. My friends and I have been organizing events and tournaments in this mod for 4 years now and there's this issue with master of the field flags. As far as I know, in the past it was the case in Native too. The issue is that master of the field spawn too late and they tend to spawn multiple times in the same spot. The first issue was solved manually by admin spawning masters whenever he wants (Deluge has such a functionality added) but this solution requires a referee and is prone to human mistake. The second issue remains unsolved.

And here's my question: could a total modding newbie like me learn how to modify those master of the field to spawn automatically at a given time and never spawn twice in the same spot as it is in Native?

A friend of mine writes in python for a living and is also one of the most deserved people in Polish M&B community. He offered writing a code for this, but he said I still need to figure out where to place that code and how to link it to the game so that the game can actually read it and implement it, since he has no experience in modding M&B either.

Thank you for any help, cheers!
 
Solution
So as far as I understand your post (again, I'm a complete newbie here), I'd have to:

1. Get access to module source code from the mod's devs,
2. Extract the code responsible for master of the field from WNL version (e.g.) of Native,
3. Merge them into one code,
4. Upload that code into a server.

Is that correct?
Yup.

If I'm correct with those points I'd have more questions, not exactly to you, Namakan, but again to whoever would be so kind to answer: how do I access the source code of WNL version of Native (or whatever version that has masters work the way I want them to) and what tools I need to open and edit source codes?
Regarding source code of the admin tools used in competitive matches, I don't think they are...

Namakan

Grandmaster Knight
M&BWBWF&SNWVC
Possible? Yes.

With module source code? Very, since there is code available doing what you want already - you'd just have to merge it.
Without it? Not impossible, but close to it, especially with no prior experience.

Knowing Python, IMO, only rarely helps modding M&B Warband, and won't do anything for you in this case.
 
Upvote 1

vtz

Sergeant
Possible? Yes.

With module source code? Very, since there is code available doing what you want already - you'd just have to merge it.
Without it? Not impossible, but close to it, especially with no prior experience.

Knowing Python, IMO, only rarely helps modding M&B Warband, and won't do anything for you in this case.
Alright, thanks a lot for your help.

So as far as I understand your post (again, I'm a complete newbie here), I'd have to:

1. Get access to module source code from the mod's devs,
2. Extract the code responsible for master of the field from WNL version (e.g.) of Native,
3. Merge them into one code,
4. Upload that code into a server.

Is that correct?

Points 2-3 seems to require some technical skills that I don't have and will have to learn, point 4 seems easy enough for me already since I've been setting server for Deluge already.

If I'm correct with those points I'd have more questions, not exactly to you, Namakan, but again to whoever would be so kind to answer: how do I access the source code of WNL version of Native (or whatever version that has masters work the way I want them to) and what tools I need to open and edit source codes?

Again, cheers to anyone willing to help!
 
Upvote 0

Namakan

Grandmaster Knight
M&BWBWF&SNWVC
So as far as I understand your post (again, I'm a complete newbie here), I'd have to:

1. Get access to module source code from the mod's devs,
2. Extract the code responsible for master of the field from WNL version (e.g.) of Native,
3. Merge them into one code,
4. Upload that code into a server.

Is that correct?
Yup.

If I'm correct with those points I'd have more questions, not exactly to you, Namakan, but again to whoever would be so kind to answer: how do I access the source code of WNL version of Native (or whatever version that has masters work the way I want them to) and what tools I need to open and edit source codes?
Regarding source code of the admin tools used in competitive matches, I don't think they are open source - there are no other (forum-legal) ways of obtaining the source, but the changes you are looking to make are fairly trivial anyways (assuming The Deluge didn't change too much about the base parts):
- For the timer, you literally just need to find the right number and change it to your liking.
- For the flag spawn location, there is a store_random_in_range somewhere selecting the point out of 3 possibilites - at that point, just introduce a new (global) variable, store the selected location in it and then in the next round, see if the randomized location is the same as in the previous round - if so, reroll/reassign it. [Been a while since I looked at the admin tools but pretty sure it was done like this]

As for actually editing source code, any editor you like will do - some people will recommend gold ol' Notepad++, Visual Studio Code, Sublime Text, etc. - pick what you like/know. Apart from a text editor, you will need python2.x installed - for that (and other modding basics), I suggest you take a look at this guide.
 
Upvote 1
Solution
Master of the Field (MotF) flags spawn in places pre-defined by a scene (in-game "map" in non-modding terms) maker on Entry Points as follows: 66, 67, 68. Adimi Tools is an open-source modification which allows its users to spawn the MotF flags at a given time. All one has to do is adapt the feature to one's own needs through merging and adjusting some scripts. I suggest you contact The Deluge's authors to obtain the source code of it, but I think it is unlikely that you will be bestowed with it; the mod is quite old and its developers have left the modding scene without sharing their scripts. Without the source code, you will not be able to do anything. I also think that Adimi Tools has the features you are looking for, especially with respect to MotF flags. Good luck.
 
Upvote 1

vtz

Sergeant
Yup.


Regarding source code of the admin tools used in competitive matches, I don't think they are open source - there are no other (forum-legal) ways of obtaining the source, but the changes you are looking to make are fairly trivial anyways (assuming The Deluge didn't change too much about the base parts):
- For the timer, you literally just need to find the right number and change it to your liking.
- For the flag spawn location, there is a store_random_in_range somewhere selecting the point out of 3 possibilites - at that point, just introduce a new (global) variable, store the selected location in it and then in the next round, see if the randomized location is the same as in the previous round - if so, reroll/reassign it. [Been a while since I looked at the admin tools but pretty sure it was done like this]

As for actually editing source code, any editor you like will do - some people will recommend gold ol' Notepad++, Visual Studio Code, Sublime Text, etc. - pick what you like/know. Apart from a text editor, you will need python2.x installed - for that (and other modding basics), I suggest you take a look at this guide.
This looks promising, thank you again! The guide will certainly be a good place to get started.

Master of the Field (MotF) flags spawn in places pre-defined by a scene (in-game "map" in non-modding terms) maker on Entry Points as follows: 66, 67, 68. Adimi Tools is an open-source modification which allows its users to spawn the MotF flags at a given time. All one has to do is adapt the feature to one's own needs through merging and adjusting some scripts. I suggest you contact The Deluge's authors to obtain the source code of it, but I think it is unlikely that you will be bestowed with it; the mod is quite old and its developers have left the modding scene without sharing their scripts. Without the source code, you will not be able to do anything. I also think that Adimi Tools has the features you are looking for, especially with respect to MotF flags. Good luck.

Thanks, I'll check that, that Adimi Tools might turn out to be better than just pure editing of the source code. As of recieving the source code, that friend of mine still has contact with one of Deluge dev (who I think was main dev for a long time) Deadalus/Slawomir of Aargh so I have hope for getting it :grin:
 
Upvote 0

Namakan

Grandmaster Knight
M&BWBWF&SNWVC
Adimi Tools is an open-source modification which allows its users to spawn the MotF flags at a given time.
So does the deluge if I read the OP correctly :p
I also think that Adimi Tools has the features you are looking for, especially with respect to MotF flags.
Adimi Tools changes flags to spawn at 2:00 (and adds the instant spawn button) but that is it I believe. Non-repeat flag spawn locations are not included.
They are a good starting point for a new (MP) modder to look at and figure some things out, though.

Adimi Tools might turn out to be better than just pure editing of the source code
not completly sure what you meant by this, but, as a word of warning: you won't be able to really transfer anything from adimi tools to the deluge without editing source code. the only warband module you can install the tools to without editing source code is Native, because that's what they were made for.
 
Upvote 0
Adimi Tools changes flags to spawn at 2:00 (and adds the instant spawn button) but that is it I believe. Non-repeat flag spawn locations are not included.
They are a good starting point for a new (MP) modder to look at and figure some things out, though.
Yes, right. Adimi Tools and its features govern time options of MotF flags. It might be possible to randomize spawns of MotF flags as well, but only when the source code of The Deluge is available. Even a tiny point of modding reference might be valuable to learn basic stuff.
 
Upvote 0
Top Bottom