Modcraft - The community dedicated to quality WoW modding!

Wrath of the Lich King Modding => Getting started the WoTtLK tutorial => Topic started by: Steff on December 08, 2012, 01:10:28 am

Title: 09 - Water Script in Depth
Post by: Steff on December 08, 2012, 01:10:28 am

Introducing



The problem with noggit in the current version is that it doesn't support new water included since 3.2.2 in the ADT files. There are 3 tools at the moment to handle water.


I only work with the first tool at the moment, but I will have a look at the others and expand this tutorial part later.

Quote
A comand line or CMD tool have no grafic interface. You can use it with the comannd line console by typing commands.
http://en.wikipedia.org/wiki/Command_Prompt (http://en.wikipedia.org/wiki/Command_Prompt" onclick="window.open(this.href);return false;)

The CMD Tool AllWater_wotlk.exe



The tool is located at

E:WoWModdingToolsCMDAllWater_wotlk.exe

I use scripts where I add a command for every single ADT with needed parameters. This way you can just run the script and all ADTs have water back again. You used such a script already in part 04 of the tutorial.

So lets have a closer look at this script

>> Open the script in your favorite text editor like notepad or notepad + +

F:WoWModdingProjectsTutorialProjectscriptsWater-Test01.bat


Quote
If you later create your own script the ending extention is important. It must be .bat NOT .txt. If you click on a .bat file, windows will open it and run every line of text inside as a comand.

You see different lines in the following style.

Code: [Select]
"../../../tools/AllWater_wotlk.exe" ../patch/world/maps/test01/test01_31_31.adt 0 2 80
So what do these lines do?

The first part runs the AllWater_wotlk.exe over a relative path.
The 2 dotts ".." just tell the CMD to exit the folder you are currently in.

E:WoWModdingProjectsTutorialProjectscripts

So the first ".." exits scripts folder and the second the folder TutorialProject and the last the folder Projects.
So the CMD is now located in

E:WoWModding

Now we enter the tools subfolder where we find our AllWater_wotlk.exe

tools/AllWater_wotlk.exe

Next we give the tool 4 parameters that it should use.


The first one defines the ADT we want to edit again as a relative path. We exit scripts, enter patch/world/maps/test01 and use the ADT file test01_31_31.adt

The next parameter (0) define the height of the water surface. It´s just the Z value from noggit. 0 is used for ocean level most of the time.

The next parameter (2) is the type of the water. This manages the sound you hear and the look of the water inside the client . You can get this ID from the DBC liquid.dbc

The next value is the transparency of the water surface. As lower the value the more you can see the ground under the water surface.

At the first look all of this seems to be quite complicated but if you use the tutorial structure, you can just copy the line in the future and only have to change the path to the ADT and the settings to your needs and won't have to think about the rest.

Fix Errors



If you got an error you can start the script inside a CMD window to see possible errors.

>> Open up a commandline window by typing CMD into the windows search field inside the start menu and select cmd.exe
>> Type f: and return to change the drive you work on. You have to choose your drive here where the WoWModding folder is located.
>> Type CD WoWModdingProjectsTutorialProjectscripts and return. To get into the scripts folder
>> Type Water-Test01.bat and hit return
 
Now the script runs and you can see if it throws any error messages.

This guide has been completely proof-read and corrected in grammar by Mountainlion. Feel free to message him.


10 - Add a full new map from scratch (http://modcraft.io/viewtopic.php?f=79&t=3611)
Title: Re: 09 - Water script in depth
Post by: kakuzu on February 25, 2013, 11:46:55 pm
Quote from: "Steff"

Fix errors



If you got an error you can start the script inside a CMD window to see possible errors.

>> Open up a comandline window by typing CMD into the windows search fild inside the start menu and select cmd.exe
>> Type f: and return to changge the drive you work on. You have to chouse your drive here where the WoWModding folder is located.
>> Type CD WoWModdingProjectsTutorialProjectscripts and return. To get into the scripts folder
>> Type Water-Test01.bat and hit return
 
Now the script runs and you can see if it throws any error messages.


Or use pause Command in the bat file

Example
Code: [Select]
"../../../tools/cmd/AllWater_wotlk.exe" ../patch/world/maps/test01/test01_31_31.adt -0.8 2 80
"../../../tools/cmd/AllWater_wotlk.exe" ../patch/world/maps/test01/test01_31_32.adt -0.8 2 80
"../../../tools/cmd/AllWater_wotlk.exe" ../patch/world/maps/test01/test01_31_33.adt -0.8 2 80

"../../../tools/cmd/AllWater_wotlk.exe" ../patch/world/maps/test01/test01_32_31.adt -0.8 2 80
"../../../tools/cmd/AllWater_wotlk.exe" ../patch/world/maps/test01/test01_32_32.adt -0.8 2 80
"../../../tools/cmd/AllWater_wotlk.exe" ../patch/world/maps/test01/test01_32_33.adt -0.8 2 80

"../../../tools/cmd/AllWater_wotlk.exe" ../patch/world/maps/test01/test01_33_31.adt -0.8 2 80
"../../../tools/cmd/AllWater_wotlk.exe" ../patch/world/maps/test01/test01_33_32.adt -0.8 2 80
"../../../tools/cmd/AllWater_wotlk.exe" ../patch/world/maps/test01/test01_33_33.adt -0.8 2 80

pause