How to make diplomacy module system + customize own your troops?

Users who are viewing this thread

Hi everybody. I would like to add the "customize your own soldiers" feature to the Diplomasy module system. But there is a code conflict. Does anyone know how I can fix this? Or how can I add soldier customization like in floris mod? Please excuse my english


Solution
I found a much simpler way without using OSP. What we need to do is add a few new conversation lines from the Module Dialog. For example:

Code:
[trp_esir|plyr,"member_chat",[],"Soldier!", "speech2",[]],
[trp_esir,"speech2",[],"I am at your disposal sir...","speech3",[]],

[trp_esir|plyr,"speech3",[],"Show the weapons you use!","speech4",[(change_screen_equip_other)]],
[trp_esir|plyr,"speech3",[],"What features do you have?","speech5",[(change_screen_view_character)]],
[trp_esir|plyr,"speech3",[],"Nothing else. Get to your task!","close_window",[]],

[trp_esir,"speech4",[],"That's it sir","speech6",[]],
[trp_esir,"speech5",[],"That's it sir","speech6",[]],

[trp_esir|plyr,"speech6",[],"Ok, now you can return to your task!","close_window",[]],

Analysis;
trp_esir:
Troop I created. Here you can write the name of troop you want.
speech: Dialog hierarchy. You can search the forum for more details.
(change_screen_view_character): The screen we use to see and improve the stats of the troops. If you only give experience to the troops you create, you can select their attributes here. I will add feature reset in the future.
(change_screen_equip_other): The screen where we give items to NPCs.
close_window: Ends the conversation
(change_screen_trade): With this screen, we can access the troops' inventory. So we can give much more items. But it doesn't save its inventory. When we close and open the save file, the items are deleted. I couldn't find the solution. If you know, please specify below.


Please message me if you are using the codes in your mods. I want to review your mod. :smile: And if you have a better solution or if you have improved the codes please mention it below. Good battles!
 
Last edited:
What are you asking for? Just add the feature from Floris to Diplomacy and fix all issues you can see in the compiler. If you do not know how to do it, you may have to learn the basics of modding. There is no more information left in your thread, therefore I cannot help you past this point.
 
Upvote 0
What are you asking for? Just add the feature from Floris to Diplomacy and fix all issues you can see in the compiler. If you do not know how to do it, you may have to learn the basics of modding. There is no more information left in your thread, therefore I cannot help you past this point.
I'm sorry I didn't express myself well. First of all, the link of the feature I want to add; https://forums.taleworlds.com/index.php?threads/custom-your-own-kingdom-troops.226020/

I have coding knowledge, but unfortunately I do not have knowledge of python. I want to add this mod because we can build an advanced army, create a skill tree and name the troops, but there is a code conflict. I can't find where the errors are. The soldier creation feature in Floris mod is much simpler. But I haven't tried adding it. And I don't know how to access codes for this feature.
 
Upvote 0
unfortunately I do not have knowledge of python
The ModSys is written in M&B language of coding, only the compiler is in Python.
I can't find where the errors are
They are always shown in the compiler; you may use the WRECK compiler for even better performance.
And I don't know how to access codes for this feature
Both Diplomacy and Floris are OSP, you are free to use their source code. Here is a list of all mods that have been made LSP/ OSP: https://forums.taleworlds.com/index.php?threads/list-osp-lsp-modifications.377920/.
 
Upvote 0
First, the Module System language is no Python.
Second, you still need to tell us more about the errors which you get. What are the error messages saying, what is happening, etc.?
The ModSys is written in M&B language of coding, only the compiler is in Python.

They are always shown in the compiler; you may use the WRECK compiler for even better performance.

Both Diplomacy and Floris are OSP, you are free to use their source code. Here is a list of all mods that have been made LSP/ OSP: https://forums.taleworlds.com/index.php?threads/list-osp-lsp-modifications.377920/.

I can add these codes to the native module system and use them in my game. But when I add the Diplomacy module system, I get an error. I guess there are many reasons for this. For example, in native, our player's side is (7). And when we use the codes, we change the soldier tree of the 7th side. But it is different in diploasi module system. I guess I will not be able to add this osp to the diplomacy module system. Because I've been trying for a long time, but I couldn't find a solution.

Floris mod has a similar feature. A feature where we can buy troops from the inn and change the outfits of the troops. If I can find it, it will still work for me. Do you know the link for this feature? I searched a lot but couldn't find it. Because the Diplomacy Module System is so complex, I had a hard time rewriting it myself.
 
Upvote 0
You can't simply copy paste it, you have to adapt it to your module system. Check each single error line if it should actually look like this and which variables you might be missing/misspelling. I can for example imagine that it should be set_item_detail and not set_item_detial.
 
Upvote 0
You can't simply copy paste it, you have to adapt it to your module system. Check each single error line if it should actually look like this and which variables you might be missing/misspelling. I can for example imagine that it should be set_item_detail and not set_item_detial.
You're right, I should adapt. I will pay attention to this and add the mistakes I encountered while adapting it here and get your opinion. If anyone else gets the same error, they can look into it and solve their problems.

Looks like you have used advanced wreck integrated module system. It is not compatible with scripts written with python code. Use vanilla compiler or wreck simple mode.
Yes, Vetrogor is correct. There seems to be an issue with pure Pythonic scripts which cause conflict with the ModSys.
Yes, you are right. I'm not using the vanilla Module System. I am using Diplomacy Module System.
 
Upvote 0
I think the troop inventory doesn't get saved because that's the default behavior for non-hero troops.
It's set in module.ini of your mod.
dont_load_regular_troop_inventories = 1
You could change it to 0 and save the inventories of regular troops in the savefile, but it will make the save file much bigger.
It might also cause some unexpected bugs, like all features that were originally planned by devs then disabled for long time and left untested for many versions/
 
Upvote 0
Back
Top Bottom