Gah, Maybe I need sleep...

Stevie

New member
Joined
Jan 29, 2009
Messages
27
I scoured the past threads and didn't find anything relating to my current problem. Finally figured out
how to save nav's (duh, just saves with teh map  :rolleyes). But I have a problem now with the Script
Compiler. I followed the tutorial from the wiki site, but it never loads the compiler. I get a message:

"Script Compiler" isn't a recognized internal or external command, operable or batch file.

I did all the scripts right, renamed my map to land number (and map name, scripts, accordingly) to 8829. Am
I missing something obvious? Knowing me I probably am  :upside. I'll keep looking though.

Before anyone asks, my bnw2 is installed in the normal default directory (C:\).

I know its late at night... morning  :shocked, so I don't expect a response till later. But I guess I should
show what my example looks like, just incase I'm missing something obvious, which I know already,
that I am.

Main Mod Directory:
C:\Program Files\Lionhead Studios\Black & White 2\Tools\Script Compiler\8829

8829Script.txt:
Code:
run script 8829Script

begin script 8829Script
start
	disable load screen
	set fade in time 1
	wait until 1 != 1
end script 8829Script

8829Challenges.txt:
Code:
8829/8829Script.txt

Compile8829.bat:
Code:
"Script Compiler" -path . -enumfile .\Enums.txt -dbfile .\bw2text.lhts -scriptpath . -inputfile ./8829/8829Challenges.txt .\8829\8829.chl
pause
 
I guess the first thing to be asked is, do u have the .bat file in your land's folder or in the Script Compiler folder?
 
Try adding
cd "C:\Program Files\Lionhead Studios\Black & White 2\Tools\Script Compiler\"

... might not be it but :(
 
Alright. I just figured it out and it works, It generates a .chl file for me. I found out that the
Compile8829.bat needs to be in the Script Compiler root folder, NOT in the 8829 folder. The tutorial
didn't say anything about that, so I just thought to place it in the 8829 folder. Ah well. Lets hope my
map runs now  :upside

Edit:

Ah, the map loads just fine (who says FAQ's aren't useful  :D). Running into a few other problems within the
map ingame, but I think I can manage. If I have further difficulty, I'll come here. But I'll probably end up
solving the problem myself though. Sorry to bother you guys with stupid questions.  :upside (I love that emote)
 
Is there any way to set the starting tribute for a town without cheating? I had to use a trainer just to build
up a decent sized town.  1.7 billion tribute is just ridiculous  :upside Same with other towns, cause my enemy
god AI does nothing. His villagers just sit there and starve.
 
There isn't a function to add tribute?

(I'd look it up but I can't remember the URL to the documentation :()
 
Code:
increment tribute by xxxx

Where xxxx is the number of tribute u want to give.  :)
 
Uhh, I tried putting that with 100k in my 8829Script.txt file, recompiled it, and ran my map again. I still end
up with 0k in tribute. Do I need to put that line in some other file?
 
You need to add it before the "wait"

Code:
run script 8829Script

begin script 8829Script
start
	disable load screen
	set fade in time 1
	increment tribute by xxxx
	wait until 1 != 1
end script 8829Script
 
Thank you so much Kays, that worked. Now, two final questions and I'll be out of everyone's hair for awhile.
I have working villages set up in my map, and they can migrate into yours like in normal LHS maps. But all I
get from them are resources, which is nice, but I'd like extra tribute down the line. Is there anyway to set up
villages to give you tribute once they are integrated into your town? Or is that random?

The last question is about objectives. You know, reach a certain population, have a certain amount of
disciples, ect ect, and earn set amount of tribute for it. I'd like to know how to set those up, if its not too
complicated to be explained here.
 
Not a problem. It's good to see that someone is still interested in scripting. :)

Is there anyway to set up villages to give you tribute once they are integrated into your town? Or is that random?

What you need to do is to monitor the ownership of each town with a background script. The following is the begining of something I wrote do do something similar.

Code:
begin script TakeOverStatus

	techLevel = 0
	Cnt = 0
	oTown = get town with id 0

start
	wait until oTown exists

	Cnt = 0
	force while Cnt < NUMBER_OF_TOWNS
		Town[Cnt] = get town with id Cnt
		TownStatus[Cnt] = 0
		set town Town[Cnt] desire for TOWN_DESIRE_TO_BREED to 1.0
		Cnt++
	end while

	Cnt = 1
	begin loop
		wait 1 seconds
		Cnt = 1
		Win = 1
		force while Cnt < NUMBER_OF_TOWNS
			
			if TownStatus[Cnt] == 1 and get Town[Cnt] player != 0
				TownStatus[Cnt] = 0
			end if
			
			if TownStatus[Cnt] == 0
				if get Town[Cnt] player == 0
					techLevel = get tech level of town Town[Cnt]
					if techLevel == 0
						increment tribute by 25000
					elsif techLevel == 1
						increment tribute by 50000
					elsif techLevel == 2
						increment tribute by 100000
					end if


For the second question. To get the population of a town use "size of" You'll need to check the documentation for how to check for disciples.
 
Well, it's not that easy. What I posted was an inconplete script. As well, it uses a global variable to set up the arrays.

I took the above from my "Three Corners" map. The scripts are  included with the map so download it and take a look on how it's been put together. It's a series of scripts which are run from the main script.
 
I really need to learn how to script. Maybe that'll be my next goal. I consider myself now a decent mapper,
kind of. I still need alot of experience though. Thanks for your help anyways Kays and Daxter.

So far in my current test map, I have 6 villages (I like villages  :blush), dual walls with gates pre-built into
them, and the mainland area for both factions have more then enough room for expansion (I now realize its
humongous actually, probably be able to comfortably fit a built up population of ten thousand, maybe more).
That's just the test map I mentioned before, to see what I can do with the editor and scripting in general.
 
Even the gates need a script to control them. :rolleyes

I forget to mention and incase you haven't discovered it yet. Daxter and I have put together a Script library. On this page are a number of tutorials which should help you get started.
 
ah yea the good old script library. All the information you need to learn about scripting is in there. Also if u are interested in learning to script, from my experience I just studied existing scripts and used methods there for new ideas, eventually over time gaining the skill to create complex scripts. Eventually you will become really good that you can pretty much do anything without problem.

Practice makes perfect, in my opinion.  :)
 
Heh, actually, yeah, I'm sifting through the Challange Script documentation that came with the tools. Very
interesting stuff. Learning a bit here and there as well. Hopefully I'll be able to make some nice scripts.

Edit:

I'm trying to compile a script I'm testing:

Code:
define script objectives

begin script objectives

	Wood = 0
start
TRIBUTE_OBJECTIVE_COLLECT_WOOD with amount 5000 text "BW2T_SCRIPT_01FINAL_OBJECTIVE_ELOI_10" amount 5000 description 
"BW2T_SCRIPT_01FINAL_OBJECTIVE_ELOI_10" reward 250
end script objectives

And I get this in the compiler: error near token "objectives": parse error, expecting 'T_IDENTIFIER'

Any ideas?

Also, I read that in the documentation, that for the first amount, 500 = 5000, what the deal with that?
 
Normally the script compiler can be a pain with certain commands but there are work-arounds that work in exactly the same way that one command does. I dont usually use straight out commands myself cause they are bugged.

Kays, any thoughts lol?
 
I've never tried using objectives before. However, from what I can see in the documentation, that line is incomplete.
Code:
[color=red]set player 0 objective[/color] TRIBUTE_OBJECTIVE_COLLECT_WOOD with amount 5000 text "BW2T_SCRIPT_01FINAL_OBJECTIVE_ELOI_10" amount 5000 description "BW2T_SCRIPT_01FINAL_OBJECTIVE_ELOI_10" parent TRIBUTE_OBJECTIVE_COLLECT_FOOD icon TRIBUTE_OBJECTIVE_ICON_OBJECTIVE_L1_FOLLOWCREATURE class TRIBUTE_OBJECTIVE_CLASS_SKILL start value 200 reward 250 force open dont show player

The documentation is is not always accurate. I've just stickied a thread from two summers ago where someone was trying to write a decompiler and was looking for the proper syntax for a number of items. It should contain any inaccuacies in the documentation.

http://www.bwfiles.com/boards/index.php?topic=2172.0
 
Back
Top