Help with enable/disable allies sharing research

Do you need help? Ask here!

Bug reporting belongs here: http://developer.wz2100.net/newticket

Help with enable/disable allies sharing research

Postby Doruletz » 27 Feb 2017, 09:59

OK, here's my problem:
I mostly play skirmish games (me against two or more AIs). Every once in a while I play a multi-player game against human opponents.
As far as things I can do and features I love, the 3.1 versions are my favorites for many reasons.
The top reason being the ability to use preloaded templates for my droids/tanks. For some reason, that no longer works in any v3.2.
To me, not having to re-create the same templates over and over again in each game played, as your tech tree progresses, is a big time saver, which allows me to concentrate on game strategy without worrying about not having the latest weaponry and body tech available to me right away.
On the other hand, I would love to have the enable/disable allies sharing research feature that was added starting with version 3.2.1, as this will allow me to take on 4, 5 or even 6 AIs.
If the AIs share research, that becomes impossible or extremely hard at best...
Can anyone help me / guide me on how to implement this v3.2 feature in a 3.1 mod???
Or at least point me to where the code for this feature is located in v3.2?

As an alternate option, I would settle for the ability to use NoQ's nullbot extras in a 3.2 version.
This is what I'm talking about: http://addons.wz2100.net/174
Sadly, that mod no longer works in any 3.2 version...
And if someone can figure out a way to still be able to use preloaded templates in v3.2 it will be even better.
What do I think about Window$ ??? Just see my AVATAR...
User avatar
Doruletz
Trained
Trained
 
Posts: 90
Joined: 17 Sep 2015, 06:00
Location: Tennessee, USA

Re: Help with enable/disable allies sharing research

Postby MIH-XTC » 28 Feb 2017, 20:45

In regards to the source code that allows shared research...

In general, if you want to review the source code you should download the master version from Github found here:
https://github.com/Warzone2100/warzone2 ... master.zip

After extracting the archive, go to the src folder and then open a terminal. From the command line, you can use grep to instantly search the entire source code for any string or regular expression pattern. You can also use Github to search the source code repository but I prefer client side searching using grep.

For example, you want to find the code for shared research.

If you hover over the shared research icon on the skirmish menu in 3.2 it states "Locked Teams, No Shared Research". So we can use grep to find where in the source code that string is found:

Anonymous@hostname:~/Home/warzone2100-master/src$ grep -nIR "Locked Teams, No"

multiint.cpp:1643: allianceChoice->addButton(ALLIANCES_UNSHARED, Image(FrontImages, IMAGE_ALLI_UNSHARED), Image(FrontImages, IMAGE_ALLI_UNSHARED_HI), _("Locked Teams, No Shared Research"));

so the code is in file multiint.cpp at line 1643

https://github.com/Warzone2100/warzone2 ... .cpp#L1643

You can also use the -A and -B arguments to specify how many lines before and after a match are displayed. So if you want to see the 20 lines before and after then use command

grep -nIR "Locked Teams, No" -A 20 -B 20

From there you can trace it to other related code although I don't think you can mod this for 3.1.

Hint: Your next grep search would probably be for "ALLIANCES_UNSHARED" and see where that takes you on your journey of reverse engineering the code for unshared research alliances. Ctrl+Shift+C and V are the copy/paste shortcuts in linux command line whereas almost all other applications you don't need the shift key.

In regards to the templates file for 3.2, in Linux it should be located at:

/home/Anonymous/Home/.warzone2100-master/userdata/mp

replace .warzone2100-master with whatever 3.2 looks like. I don't run 3.2 on linux, only master, so I don't know. But anyways you're looking for templates.json at that path. I attached a partially populated templates.json file that I use for testing. It has some templates in it but not all of the good ones. It's better than nothing.
Attachments
templates.json
partial templates file for 3.2
(12.67 KiB) Downloaded 30 times
MIH-XTC
Trained
Trained
 
Posts: 195
Joined: 31 Jan 2014, 07:06

Re: Help with enable/disable allies sharing research

Postby Doruletz » 02 Mar 2017, 19:24

@"MIH-XTC":
Thanks for your input. I will try what you suggested.
Also, I just realized that the MASTER version allows me to use pre-loaded templates.
Although I had the MASTER downloaded and compiled, I did not use it before, except to test that it works, but after reading your post I did some more extensive testing with MASTER.

***********************************************************************
EDIT:
However, the MASTER is not a viable solution for me, as it too does not work with most of the older mods, example being the UltScav MOD, which I happen to love.
So, the main goal here remains implementing the new "Allies don't share research" feature into the older v3.1 game versions...
Edited March, 03 2017 @ 7:30PM EST.
***********************************************************************

MIH-XTC wrote:In regards to the source code that allows shared research...

In general, if you want to review the source code you should download the master version from Github found here:
https://github.com/Warzone2100/warzone2 ... master.zip

After extracting the archive, go to the src folder and then open a terminal. From the command line, you can use grep to instantly search the entire source code for any string or regular expression pattern. You can also use Github to search the source code repository but I prefer client side searching using grep.
................................. etc
What do I think about Window$ ??? Just see my AVATAR...
User avatar
Doruletz
Trained
Trained
 
Posts: 90
Joined: 17 Sep 2015, 06:00
Location: Tennessee, USA


Return to Technical Help / Troubleshooting