Page 1 of 1

Edit the Tech Tree

Posted: 21 May 2019, 21:27
by Guardsman Brendo
Is it possible to make a mod that makes the Naval propulsion available? For my purposes, it would be available at the start of a Skirmish game, like Machinegun. That would be the only thing it does. I don't really know much about modding Warzone, but I do have programming knowledge I can use to familiarize myself with the process.

Re: Edit the Tech Tree

Posted: 22 May 2019, 04:40
by Berg
Guardsman Brendo wrote: 21 May 2019, 21:27 Is it possible to make a mod that makes the Naval propulsion available?
For the most part the answer is yes the only limit is how much effort you put in.

Re: Edit the Tech Tree

Posted: 22 May 2019, 23:55
by Guardsman Brendo
What file(s) or directory can I find the tech tree information in? I want to start looking at that and seeing how it works.

Re: Edit the Tech Tree

Posted: 23 May 2019, 03:04
by Berg
Go here and read all about it http://developer.wz2100.net/

Re: Edit the Tech Tree

Posted: 23 May 2019, 23:43
by WZ2100ModsFAn
Guardsman Brendo wrote: 21 May 2019, 21:27 Is it possible to make a mod that makes the Naval propulsion available? For my purposes, it would be available at the start of a Skirmish game, like Machinegun. That would be the only thing it does. I don't really know much about modding Warzone, but I do have programming knowledge I can use to familiarize myself with the process.
Are you saying you want to modify just the tech tree image?
Or modify the game stats itself?

Re: Edit the Tech Tree

Posted: 24 May 2019, 03:27
by Guardsman Brendo
WZ2100ModsFAn wrote: 23 May 2019, 23:43 Are you saying you want to modify just the tech tree image?
Or modify the game stats itself?
I don't really know how the tech tree works internally... I was just wondering if there was a way to make it available without the give all cheat.

Re: Edit the Tech Tree

Posted: 24 May 2019, 17:23
by Berserk Cyborg
Guardsman Brendo wrote: 24 May 2019, 03:27 I don't really know how the tech tree works internally... I was just wondering if there was a way to make it available without the give all cheat.
If you want the naval propulsion available immediately at the start of a skirmish for every player add:

Code: Select all

makeComponentAvailable("Naval", playnum);
Next to this line in the multiplayer rules.js. Just know it was never completely implemented and probably is buggy.

The multiplayer research tree resides in the stats directory in a file called "research.json" which contains all the research items. Research items are "unlocked" by researching previous research items. A "requiredResearch" list is in them that will unlock the given research item when all depend research has been completed.

Take for example the command turret research. It requires "R-Struc-CommandRelay" which means the player must research the command relay to unlock the command turret research. Some research may even have a "requiredStructures" list which requires a structure to be built and present on the battlefield for it to show up... but this feature is rarely used. In any case, using the same example, the command turret research has the required structure stat "A0ComDroidControl" which is the Command Relay (see structures.json in the same directory).

As for making every research item available without the "give all" cheat, you'd need to do some scripting to do that.

Re: Edit the Tech Tree

Posted: 24 May 2019, 23:46
by Guardsman Brendo
Berserk Cyborg: I am definitely going to have some fun with this. Thanks for this information. I have a map made to be used with naval with factories on(under) water, so I can produce them without cheating too. My next goal is to implement a factory that can do this. To not require a pre-placed factory, I would need to make a new factory that, instead of land, looks for water to place the unit on.

Re: Edit the Tech Tree

Posted: 24 May 2019, 23:57
by WZ2100ModsFAn
Guardsman Brendo wrote: 24 May 2019, 23:46 Berserk Cyborg: I am definitely going to have some fun with this. Thanks for this information. I have a map made to be used with naval with factories on(under) water, so I can produce them without cheating too. My next goal is to implement a factory that can do this. To not require a pre-placed factory, I would need to make a new factory that, instead of land, looks for water to place the unit on.
If you want you can make a packaged mod by using 7zip to make a zip file for mods you make.
start off using folder then if it works drag and drop in the 7zip zip file window and delete the folder this method should work.
not the folder itself otherwise it'll be a subfolder inside just drag and drop the "multiplayer" folder excluding quotations.
The rules.js is located C:\Users\YourUserName\AppData\Warzone 2100\mods\autoload
or instead %appdata%\Warzone 2100\mods\autoload
If your Linux /home/username/Warzone 2100/mods/autoload
If you can't find it in Linux you need to unhide files to find it.
I don't know the shortcut key to show hidden .folder files.

Re: Edit the Tech Tree

Posted: 25 May 2019, 00:01
by Guardsman Brendo
I might package this stuff into a small mod if I can get it working. I dont have much free time though... Just a question about the code: is that Java or C++? I can actually read it.

Re: Edit the Tech Tree

Posted: 25 May 2019, 01:18
by Berserk Cyborg
We use JavaScript for the current scripting system.

If you want a detailed guide/tutorial to learn everything practical about it then head over to this page. Or just pick up on what you see in our scripts here which were designed to be beginner-friendly so anyone could improve or modify them.

Our JS API is documented here, specifically the js-functions/events/globals/objects.md files pertain to everything you may need (everything there is compatable with the 3.3.0 beta1 release).

Re: Edit the Tech Tree

Posted: 26 May 2019, 05:49
by Guardsman Brendo
Why does my rules.js not exist? I've looked everywhere, and made hidden files and folders visible? Does it only exist if something is made to override it?

Re: Edit the Tech Tree

Posted: 26 May 2019, 06:38
by Iluvalar
You can add naval units to the game, and build them in factories adjacent to water. But

1- The AI for them is garbage, the AI is not programmed to understand that there is 2 continent. To be exact, if a boat unit see a ground unit, it will start to move along the coast to go around the river to reach the ground unit. And obviously, it makes no sens.

2- Map design is harder then it look. Just dropping a random height map in the game doesn't yield a good experience. Having 1 "continent" on a map is complex enough, having 2 of them simultaneously would be extremely hard. And at the very least, never done for warzone. Some maps like fishnet might look "interesting" with boats, but when you break it down strategically, they are useless. So having a good map for this would be the hardest part.