Hello guys, this is not directly an issue more a question. I write this in this chanel because I think here are the guys with the biggest Crusader coding experience.
So my question is, if it is possible to change things in the cr.tex and the interface_icons with an patch? That the ingametext is changed. I know it s possible to read just a different tex file in but I don t want to change the files I want write in the tex file. I also know the tools to change things manually.
Would be awesome to be able to do that for all guys that create new NPCs, if you could just choose a number between 1 and 16 and the interface_icons and the tex file would been changed at the choosen number.
I agree that this would be beneficial.
To clarify, what is needed is a function that changes certain lines in the cr.tex file, rather than having to replace the file. I suggested this with the start-resource feature (on discord) and there wasnt much support.
This way I can add my own custom villager names, then when i download Kimberly's special ais, it will change the AI names to her predefined names. Then i can install my custom start resource file that has "bootstrap" showing up instead of "crusader game".
The icons side of it, while doable, is more unlikely to be used as making the graphics in the first place is awkward.
Independent of implementing it to the patcher, the cr.tex can be edited using the Text Compiling Tool or this tool: TexEdit (I am not sure if it actually works, I never checked, only for Stronghold?). You could then ship the modified version, or install it with a batch script.
What do you exactly mean with the interface icons? With a batch file, it is possible to move files like pictures and such.
Yes it that works, however it means that if I ship a cr.tex my start resources mod(changing game mode names and descriptions), and say Kimberly ships one with a new AIs mod (changing ai names), then the two mods have their cr.tex overwritten. This is limiting to content creators.
It also means that if the user has modified the file for themselves, I for example have my first twitch followers as peasant names, this is also overwritten.
Another limitation is language support, youd have to prepare a file for each language, and ask the user to manually copy their language over, or have multiple batch scripts to do it.
In summary, using the text compiler tool can do this, however it is very far from an optimal solution, and the request in this issue is much more supportable long term.
I created the question because I programmed an NPC-Changer. It is no problem to make a new .tex file and change the code that this file will load by the exe same with the interface_icons. The problem is just that, if you have 16 interchangeable NPC (you could not choose the bot you wanne replace like my tool works at the moment) then you have 2^16 potential opportunities, so you need as many tex and interface_icon files.
What I tried was that i write via C# to the Crusader.txt from the tex compiler. In the next step I tried to let the compiler create a new cr.tex but that didn t worked until now.
My thried planned step was to rename this new file and copy this in the crusader folder and let the exe read this file in.
Not sure if I am able to make this. But I just started programming and I don t know how to make this with the pictures work.
@GrosserBauerr2 you need to parse whole cr.tex file, replace values you want and then override this file. .tex format is very simple. Here is an example of how to work with it.
Regarding interface_icons, you may try to ask @PodeCaradox to add command line support for his converter and use it in a batch mode.
@JuGGerNaunT he only need the new created gm1 files(created with the gm1 Converter from me) and replace the ones in the Stronghold Directory with it, so he just need a simple batch and the gm1 files to replace.
Or do he want for every change a different GM1 File with the different Icons and compute them together with a certain selection? If yes i can Provide a libary that only reads the gm1 Files and give him a Image Back, or on the other side he just send in a Image and give him the ready to use GM1 Back.
@PodeCaradox he want to create a tool that can customize AI appearance. User can chose what AI he want to change and based and that this tool has to change only those specific sprites.
Which Sprites he want to change exactly is the question, but i can give him my converter as a sort of library to use, so he can include it without a Interface/exe.
Right now my tool changes King Phillipp for my Custom AI. I am a programming beginner so I created for this a new .tex file and another gm1 file and my tool reads this in if I click to replace King Phillipp. But I started to work on another AI that I wanne change with the caliph. If I have two changebale bots I need with my solution four gm1 and tex files (both inculded, bot 1 inculded, bot 2 included and no bot included). There is a youtubelink on my githubsite how the changer is working but it s only in german. I will try your solutions and if I don t get there I will write to you guys again.
No problem i'm German too, so if you want i can give you the GM1 Converter as a Library. Only thing i need to know is how you read Images.
Most helpful comment
I created the question because I programmed an NPC-Changer. It is no problem to make a new .tex file and change the code that this file will load by the exe same with the interface_icons. The problem is just that, if you have 16 interchangeable NPC (you could not choose the bot you wanne replace like my tool works at the moment) then you have 2^16 potential opportunities, so you need as many tex and interface_icon files.
What I tried was that i write via C# to the Crusader.txt from the tex compiler. In the next step I tried to let the compiler create a new cr.tex but that didn t worked until now.
My thried planned step was to rename this new file and copy this in the crusader folder and let the exe read this file in.
Not sure if I am able to make this. But I just started programming and I don t know how to make this with the pictures work.