How to script?

Youtube2`

New member
Joined
Jun 10, 2011
Messages
75
Hello everyone I Was wondering how to "Script" I really want to know how and learn it and make scripts for the Community .

Could anyone teach me or write a tutorial?


If you have MSN add thenewrs@yahoo.com

Add me :)

Thank you
 
 
   If you have previous programming experience, it will come in handy. If you have no previous experience, it may be difficult to teach.

Start in the script library on this site:  http://www.bwfiles.com/scripts/index.php

There are tutorials: http://www.bwfiles.com/scripts/index.php?action=category&id=10

 

   To start, install the modding tools. If you have the landscape editor, this is already done. One of the tools is the 'script compiler'. In this folder, you have three main items:
1) The "script compiler.exe" program itself
2) The "script compiler.bat" DOS command script to run the compiler program correctly
3) The "Challenges.txt" which is a list of the scripts to compile, in order from top to bottom.

   To compile simple scripts, first edit the "script compiler.bat" file in a text editor. Note that you can't just double-click this, it will try to run. Right-click and do 'open with' or some other method. In the text editor, change all of the paths from "C:\Program Files\Lionhead Studios\Black & White 2\Tools\Script Compiler" to the actual location of the script compiler file. Then, to correctly compile some scripts, you need to work around a compiler bug involving strings: Find the "bw2text.bin" file in the "Data\Text" folder of the game and copy it to the script compiler folder. At this point, you should be ready to compile scripts.

   To now actually compile a script, first save the script as a .txt text file in the script compiler folder. Edit the "challenges.txt" file to include only the scripts needed for the compilation (simple scripts usually only have one file). Now edit the "script compiler.bat" file again. At the very end, change the output filename from "XXXXXXX.chl" to what you want the script's output filename to be (make sure to keep .chl at the end). Now, double-click on the "script compiler.bat" file and the script should compile. Of course, if there are errors in the script, it won't compile, hehe.

 

 
Slightly more advanced.. The command to compile scripts is really just a DOS command. You may open a DOS window to the script compiler folder and run the command directly. The help text of the script compiler can be seen with by running [ "script compiler" -? ]. Each time the command is run, you must specify the paths to the script compiler folder, included files, and the scripts. Usually, the input file given is a list of filenames, not the script files themselves, but you can actually specify the script files themselves by using the -s argument.
   You can also use relative paths to make the command easier. Here is an example:
[ "Script Compiler.exe" -path . -enumfile .\Enums.txt -dbfile .\bw2text.lhts -scriptpath . -inputfile challenges.txt Land20test.chl ]

 


   So, as a quick demonstration:

1) The contents of my "script compiler.bat" file:
Code:
rem This is an example how to use the script compiler. You will need to change the path information as well as the names of the input files to suit your setup.
"Script Compiler.exe" -path . -enumfile .\Enums.txt -dbfile .\bw2text.lhts -scriptpath . -inputfile challenges.txt Land20test.chl

2) The contents of the "challenge.txt" file:
Code:
Land20test.txt

3) The contents of the "Land20test.txt" file in the script compiler's folder:
Code:
run script BasicScript

begin script BasicScript

start

	wait 1 seconds

	disable load screen
	set fade in time 4


end script BasicScript

   Now, double-click on the .bat file to compile the script. Rename the .chl file to match the land number you want the script to work for ( like "Land654.chl" ), and place the script in the "Scripts\BW2" folder.

 
 
ego533 said:
 
   If you have previous programming experience, it will come in handy. If you have no previous experience, it may be difficult to teach.

Start in the script library on this site:  http://www.bwfiles.com/scripts/index.php

There are tutorials: http://www.bwfiles.com/scripts/index.php?action=category&id=10

 

   To start, install the modding tools. If you have the landscape editor, this is already done. One of the tools is the 'script compiler'. In this folder, you have three main items:
1) The "script compiler.exe" program itself
2) The "script compiler.bat" DOS command script to run the compiler program correctly
3) The "Challenges.txt" which is a list of the scripts to compile, in order from top to bottom.

   To compile simple scripts, first edit the "script compiler.bat" file in a text editor. Note that you can't just double-click this, it will try to run. Right-click and do 'open with' or some other method. In the text editor, change all of the paths from "C:\Program Files\Lionhead Studios\Black & White 2\Tools\Script Compiler" to the actual location of the script compiler file. Then, to correctly compile some scripts, you need to work around a compiler bug involving strings: Find the "bw2text.bin" file in the "Data\Text" folder of the game and copy it to the script compiler folder. At this point, you should be ready to compile scripts.

   To now actually compile a script, first save the script as a .txt text file in the script compiler folder. Edit the "challenges.txt" file to include only the scripts needed for the compilation (simple scripts usually only have one file). Now edit the "script compiler.bat" file again. At the very end, change the output filename from "XXXXXXX.chl" to what you want the script's output filename to be (make sure to keep .chl at the end). Now, double-click on the "script compiler.bat" file and the script should compile. Of course, if there are errors in the script, it won't compile, hehe.

 

 
Slightly more advanced.. The command to compile scripts is really just a DOS command. You may open a DOS window to the script compiler folder and run the command directly. The help text of the script compiler can be seen with by running [ "script compiler" -? ]. Each time the command is run, you must specify the paths to the script compiler folder, included files, and the scripts. Usually, the input file given is a list of filenames, not the script files themselves, but you can actually specify the script files themselves by using the -s argument.
   You can also use relative paths to make the command easier. Here is an example:
[ "Script Compiler.exe" -path . -enumfile .\Enums.txt -dbfile .\bw2text.lhts -scriptpath . -inputfile challenges.txt Land20test.chl ]

 


   So, as a quick demonstration:

1) The contents of my "script compiler.bat" file:
Code:
rem This is an example how to use the script compiler. You will need to change the path information as well as the names of the input files to suit your setup.
"Script Compiler.exe" -path . -enumfile .\Enums.txt -dbfile .\bw2text.lhts -scriptpath . -inputfile challenges.txt Land20test.chl

2) The contents of the "challenge.txt" file:
Code:
Land20test.txt

3) The contents of the "Land20test.txt" file in the script compiler's folder:
Code:
run script BasicScript

begin script BasicScript

start

	wait 1 seconds

	disable load screen
	set fade in time 4


end script BasicScript

   Now, double-click on the .bat file to compile the script. Rename the .chl file to match the land number you want the script to work for ( like "Land654.chl" ), and place the script in the "Scripts\BW2" folder.

 

Wow thanks Ego your the best person to walk this Earth. #Request as mod :yes (Joking if confusion starts)
I will look into this everyday, Learn more and become more. Thank you!  :yourock:
 
Back
Top