Black & White II Scripting Issues

From PBnWModdingWIKI


Contents

This page has been created in order to record and documentate any persistant issues that the community might have. While, once a solution becomes available, issues may be updated to have a solution (and thus no longer qualify as persistant issues), this page is not intended to be a FAQ. Please only add unresolved issues. Updates to issues are most welcome, of course.

Use of String Literals

Problem

Some commands use String Literals to point to a certain entry in the Text Database. These usually use a constant-like notation, such as BW2T_SOME_TEXT.
Unfortunately, using string literals for some commands(say, tooltip and dyke/sign) crash the compiler. This behavior is known to Lionhead, altough the tools are not officially supported. A workaround, a new version of the compiler or a community byte-patch may be released in the future.

Using say "text" crashes the compiler. In fact, any use of " as an argument of say seems to crash the compiler.
This behavior seems buglike.

Solution

No known Soultion
It's been shown that copying C:\Program Files\Lionhead Studios\Black & White 2\Data\Text\bw2text.bin into the dir with all the enum files and the script compiler will work , the compiler still crashes , but it does so AFTER it compiles the script , so it still makes a working script.


Creature Spawning

Problem

People are having trouble with adding creatures to their maps.
Both the load my_creature at coord_expression and the load creature string player expression at coord_expression statements do not seem to work.

Example code:

	oCreatureDst = marker at {408, 36, 1302}
	load my_creature at {oCreatureDst}
	load creature CREATURE_TYPE_COW "vicious" player 1 at {oCreatureDst}
	load creature CREATURE_TYPE_LAST "vicious" player 0 at {oCreatureDst}

Cause

It could be possible that creature-support has to be enabled explicitly, through a command similar to set interaction constant
Also worth noting; the main method to play custom lands is via the New Game method. Unfortunately, technically, the player has not yet chosen a creature. However, replacing Land4 with a custom land, restoring the tutorial Land 1, playing up to land 3 (creature is in his pen) and skipping to the custom land (4) does not work either. Hence the idea that creatures might need to be enabled explicitly.
load my_creature at {408, 36, 1302} works fine, as long as there is an active creature available. Unfortunately, this means that if a land is started through the New Game method, that the scripter has to create a pick-a-creature script or assign a creature to the player. There is currently no known way to load an existing player creature from script.


Solution

Create a Pick-A-Creature script and assign a creature that way.