Statements appear in the body section of scripts. There are many statements available for you to use. Each of them results in something happening somewhere! Statements do not return a result.
See also:
These statements can be used (generally) to control any object.
Statements controlling state driven objects. These are objects such as villagers and animals (but not the creature)
Statements controlling visual effects
Statements controlling the migration of villagers betwene towns
Statements that change values for players.
Statements controlling houses and other buildings.
Statements that allow scripts to control epics. These are used for dynamic epic cutscences and the like.
Statements that allow scripts to play videos and fine tune their display.
Statements that controll the physics system, as well as create phyics forces.
Statements that create spread effects, like heat, and statements that change the displayed alignment of an area.
Statements that controll gates.
These statements control the game objectives. e.g. mine a x amount of ore
These statements control what is happening in the game such as changing game settings or the level
These statements control the dynamic music system of the game.
These statements control objects which are specifically towns, as well as adjusting the ways in which the player can interact with their towns.
Allows you to the toolbar, the interface, floaty icons, and whatever appears in wide screen.
Creatures are more complex than other game objects, so further control functions have been created to manipulate them. Creature desires are things that motivate him, eg: CREATURE_DESIRE_HUNGER, CREATURE_DESIRE_ANGER, (see CreatureEnum.h)
Controlling Armies
Some scripts may have time limits on them, for these you can set up a timer which can be accessed for triggers dependant on time left.
These statements allow for fine control of the depth of field.
See also:
An object can be a container ie. Dance, Flock or Town; something which holds a number of objects. This container can be manipulated and generally effects the group of objects within the container. Some functions on objects can be called on containers too, eg. delete, set position, etc.
The in game time of day can be set and got by a script, but also the real world time details can be accessed for Easter Egg scripts.
Reactions can be set up to effect people around the defined area. The constants used can be found in Enum.h Reactions will work on script markers as well as objects.
Any calls to run script outside of a scripts begin-end block is in auto run. However scripts can be run from other scripts, then return to the script caller, or run the script and continue processing the current script.
See also:
It is possible to stop script progress until a condition is successful. There are two versions available for wait; for good reading the script author can use the optional word 'until'.
Sound and music can be played with the scripts to the same quality as in the game.
Creates weather conditions.
This is a dangerous feature, where you can set the object in a state. Do not set them into a simulation state as it may go mad! States have data which needs to be set up for the specific statae, the float, ulong, and position params may need to be filled for the state. BE CAREFUL!
state LostBrother LIVING_IN_SCRIPT
Certain things in Black and white insist that they have control start and control release sections. Example the camera must be free for control before you do anything. Putting these in blocks inforces the programmer to release control properly. Other parts of the internal language require blocks for parsing reasons. Exmaple: The script compiler must know where the end of an if statement is for jumping to address in the byte code. This information is unimportant to the script programmer, they just need ot know the sytax of the language!
Statements dealing with dialogue. Most of these must be made within a dialogue block
Cameras can be controlled from within the scripts.
See also:
This makes the object move between the two positions.
move Sister position to {SoapBox}
move SleepingLion position to {ThePeacefullValley} using NAV_FAILURE_MODE_GO_TO_CLOSEST_POINT navigation
This make the object position change.
set Sister position to {SoapBox}
sets the amount of resource in an object to the amount specified
set OreRock resource ORE to 10000
Makes the object turn to face the position passed, or just look at the position passed depending on how flexable an object is.
set Sister focus to {LostBrother}
For the case of a creature the creature will look at the moving object, but for other things they will turn to face the current position of the passed object.
set MyCreature focus on Rock
Set an object to play an animation for a number of times using a string.
play anim "M_CRY" on Sister loop 5 disable stand
play anim on Sister "M_CRY" disable stand
play anim on Sister "M_CRY" loop 5
Very useful if you wish to change the walk animation of a character eg. Pied piper walks with a dance.
set Piper anim ANM_PIPERDANCE
Sets an objects physics proerties (spreadhseet value)
set lamb physics balance 17
Very useful if you wish to change the walk animation of a character eg. Pied piper walks with a dance.
override Piper anim "M_PIPERDANCE"
Cancels any overriding animation set on an actor
cancel MyActor anim override
This deletes an object from the game. If you wish something to die before being deleted you should set it's health to 0.0. NB. Deleting an object which is a container will dispand the members of the container, not delete them.
delete PiedPiperFlock
Places an object into the player hand
set MyFish in player 1 hand
If an object is something with Physics in the game it applies a velocity to it towards a position.
set Rock velocity heading {PiedPiper} speed 10
Applies physics to an object so that it lands at the defined position in a given time
set Rock1 target {House} time 5
Sets the temperature of an object. Range is -1 to 1.
set rock temperature 1
Sets the player an object belongs to
set Villager player 3
This releases a game object from the script, and sets it into the game without deleting.
Game creatures can be in the sim with there focus being set to an object or position. This functions free's up the creatures head behaviour.
Sets if a creature can leash to this object or not. This object or course can also be a creature.
disable FriendlyCreature can be leashed to
Set an objects colour if possible. RGB 0->255
set MyEffect colour red 230 green 100 blue 10
Reset an objects colour if possible
reset MyCreature colour
Set an objects secondary colour if possible. RGB 0->255
set MyEffect secondary colour red 230 green 100 blue 10
stops a given object from moving
stop Sister moving
moves an object to limbo
move MyRock to limbo
releases an object from limbo
release MyRock from limbo
sets the angular velocity for the given object
set MyObject angular velocity x 20.2 y 18.6 z 2.0
overrides the given objects default mesh with the given string
override mesh for MyObject with "New_Mesh_String"
sets the object as indestructible or not.
enable MyVillager indestructible
sets the object as hurt by fire or not, normal behaviour is hurt by fire ;)
disable MyVillager hurt by fire
sets the object as possible to be lit by fires. Generally objects can burn, but in some scripts villagers must not be burnt.
disable MyVillager set on fire
sets an object or container to all being on fire or not A value on how on fierce the blaze is. 0->1 1 will obviously burn faster
enable object on fire 0.5
Enables or Disables the games fire system
disable fire system
Sets floaty icon draw in widescreen
disable floaty icons
sets an object to moveable, that is, is moveable by hand, creature and physics or not. If enabled it has its default behaviour.
disable SingingStone moveable
sets an object to pickupable, that is, is pickupable by hand, or creature. If enabled it has its default behaviour.
disable SingingStone pickup
sets if a certian pickup interface action is available
enable pickup type PICKUP_BALANCE_TYPE_ROAD
sets an objects alpha
set MyVillager alpha 0.2
sets a lava river off, heading in the specified RELATIVE direction
set lava running at {LavaPos} heading {1, 0, 4}
makes an object shake; the last value defines intensity of shake
set MyBoulder shake 0.4
sets an actor object to a reactable state. Only works on villagers and the creature.
enable object reactable
sets whether an object can be fisted
enable object can be fisted
sets whether the hand can interact with an object
enable Stone interactable
sets whether an object is super easy for the hand to interact with
enable SignPost cylindar override
Starts or stops tracking of physics on an object
enable MyRock physics tracking
Clears the memory of the last thing hit by the object. Must have physics tracking enabled.
clear MyRock hit thing
Clears the memory of the the object hitting the ground. Must have physics tracking enabled.
clear MyRock hit thing
enables/disables forcing an object to be rendered
enable force Sheep renderable
sets whether or not the object (statedriven) cares about animation events
enable anim events on MyDude
sets the probability of an animation event being played on a villager
set MyStalker anim event probability
Statements that can only be used on Villagers
makes the villager turn to look at the location
move villager AshMatheson focus to {TheBasement}
This allows you to make a villager a disciple in the game. The with sound is optional.
set Sister disciple VILLAGER_DISCIPLE_BUILDER with sound
sets a female villager to pregnant
set housewife MyMissus pregnant by TheMilkman
sets a villager object to follow another object at the given distance
set MyStalker to follow MyFreakedOutVillager at distance 10.3
sets the object as a skeleton true or false.
enable MyLittleFella skeleton
Using the CARRIED_OBJECT enum, you can set a villager to carrying an object (eg. Fishing rod) like they usually do in the game. Using the enum CARRIED_OBJECT_NONE as the carried object stops an object from being carried.
set MyVillager carrying CARRIED_OBJECT_FISHING_ROD
sets the given villager as a actor that can be imprisoned
enable villager object can be imprisoned
makes a villager start moving at thier normal speed again
set villager GreekDude default speed to SCRIPT_VILLAGER_DEFAULT_SPEED_WALKING
sets whether or not villagers ignore the fact that an object has a resource
enable villagers ignore MyTree resource
sets a villagers mesh to it's alternative version (this is temp for B&W2 villager mesh choices.)
enable MyVillager alternative mesh
Plays a paired animation using two villagers. The first object passed is the leader.
Only the leader is valid for the 'wait until played' call. See VillagerPairedActionEnum.h
play paired anim VILLAGER_PAIRED_ACTION_BREED using Man1 with Man2 snap to position
sets an objects animation speed
set anim speed of MyLittleVillager to 0.5
resets the objects animation speed
reset object MyLittleVillager anim speed
Resets an objects walk speed
reset Bobs speed
sets whether or not the visual effect is visible
disable Glow visible
makes an object pulse, or stops it pulsing
enable ScaryMan pulse speed 0.5
disable Sausage pulse with fadetime 2
enable_disable object additive. Used by some visual effects
enable MyPlasmaVisual additive
enable_disable object secondary additive. Used by some visual effects
enable MyPlasmaVisual secondary additive
Shuts down the playing of a visual effect
stop visual effect object
Removes visual effect targets for instanced visuals.
remove visual effect target at {100, 100, 100}
Adds a target to the objects target list (Currently only used by spot visuals)
add VFX target at {LostBrother}
sets whether a mine is the monster mine
set visual effect MyEffect target {MyTarget}
makes an object pulse, or stops it pulsing
enable ScaryMan pulse speed 0.5
disable Sausage pulse with fadetime 2
start a migration
start migration from JapaneseTown to AztecTown
enables or disables migration from the source town to the target town
disable migration from JapaneseTown to AztecTown
Sets whether a migration cna be declined
disable migration MyMigration can be declined
enables or disables migration from the source town to all other towns
disable migration from JapaneseTown to AztecTown
sets the migration threshold from the source town to target town
set migration threshold from Japanesetown to AztecTown 0.4
sets whether player towns can migrate
disable player town migration
sets the overriding of a town's impressiveness value
enable town MyTown impressiveness override with 175000
makes the pilgrims automatically accpeted.
accept pilgrims MyPilgrims
makes the pilgrims automatically rejected.
decline pilgrims MyPilgrims
Sets the mana of a player
set player 0 mana 10000
Sets the players alignment
set player 1 alignment 0.9
sets the reason that a town has been captured
set player 0 town JapTown capture reason LAST_CAPTURE_AGGRESSIVE
enables/disables a spell for a specific player
enable spell HEAL_LEVEL_1 for player 1
Stops a player spells from charging
clear player 3 spell charging
The town specified becomes owned by the player specified. This is an aggressive take over. The belief value does nothing.
set Town player 1 relative belief 2.0
enables/disables the players virtual influence.
enable player 1 virtual influence
enables or disables the given abode
disable abode MyMonsterMine
toggles the ability of villagers to build the given object
disable villagers can build MyHouse
sets how grown a field is (between 0 and 1)
set field CropPlace height to 0.8
sets whether a mine is the monster mine
enable monster mine MyMine
stops a given spell
stop spell MySpell
calls the given stage of an epic spell
invoke MySpell STAGE1
Creates some worshippers at an object e.g. Wonder
create 20 worshippers at MyWonder
triggers an epic wonder, but you need a wonder building and that building set to the town
create epic EPIC_WONDER_NUMBER_SIREN at {CastPos}
sets the sky to one of the predefined types
enable predefined sky "EpicHurricaneSky" time 15
plays the given video, starting at the given time
play video "Land1HandTutorial" time 23
plays the given video, starting at the given time
play video "Land1HandTutorial" with sound "HelloWorld" time 23
sets the clipping window of a video window
set MyVid clipping window left 0 top 0 width 1 height 1
stops a playing video
stop video
sets a physics force from the hand - the position determines the strength in the given axis
set physics from hand with strength position radius expression
Sets the capture radius multiplier for objects in physics
set capture radius multiplier 1.5
sets a physics force from a location - the 2nd position determines the strength in the given axis
set physics at position {BoomPos} with strength {0,80,0} radius 20 random 1
Any objects which are in physics, become not-in-physics
remove all objects in physics
Any objects which are in physics are deleted
delete all objects in physics
adds an effect at to location
add effect EFFECT_TYPE_BURN at {MyBadPlace} strength 0.9 radius 10.0
changes the alignment on the ground
set ground alignment to -1 at {BadGuy} radius 20 amount 1
adds a puddle of lava to the ground (tempearture from 0 to 1)
set lava puddle at hand position radius 10 temperature 1
opens a given gatehouse
set gate MyGateHouse open
closes a given gatehouse
set gate MyGateHouse close
sets whether a gatehouse can open its gates for platoons to pass through
disable gate can open for platoons
triggers processing of fallible objectives
process land end objectives
sets the status of the given objective
set player 0 objective TRIBUTE_OBJECTIVE_FAILABLE_CRATURE_BUILD_ALL_ABODES status to TRIBUTE_OBJECTIVE_STATE_FAILED
sets the number of objectives in the given category
set player 0 objective class TRIBUTE_OBJECTIVE_CLASS_EVIL amount 4
resets all game objectives
reset all objectives for player 0
Here is an explanation of all available parameters to this function:
amount expression - this is the number of triggers associated (eg 'collect 500 food' would use 'amount 5000')
text string - this is the name of the objective as appears in the objective window
amount expression - this is the number to be inserted into the objective name
description string - this is the description of the task as appears in the objective menu
parent constant (optional) - sets the parent objective
icon constant (optional) - set the icon that appears in the objective menu
class constant (optional) - sets the type of objective
start value expression (optional) - sets the inital amount of the objective
reward expression - sets the amount of tribute awarded for completing the objective
alignment expression - sets the alignment change for passing the goal
force open - forces the tribute window to open
dont show player (optional) - does not show the objective in the menu
with object - some objectives require an object (town) to act on. pass it in here.
set player 0 objective 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
set the icon for the objective
set player 0 objective TRIBUTE_OBJECTIVE_COLLECT_WOOD icon TRIBUTE_OBJECTIVE_ICON_OBJECTIVE_L3_WOODSTORAGEPIT
sets an objective for a specific player
set player 0 objective TRIBUTE_OBJECTIVE_COLLECT_WOOD amount 10
sets the parent objective of an objective
set player 0 objective TRIBUTE_OBJECTIVE_BUILT_ABODE parent objective TRIBUTE_OBJECTIVE_BUILD_IMPRESSIVE_BUILDINGS
sets the text for this objective
set player 0 objective TRIBUTE_OBJECTIVE_COLLECT_WOOD text "BW2T_SCRIPT_01FINAL_ADVISORS_ARRIVENEW_10"
sets the description for this objective
set player 0 objective TRIBUTE_OBJECTIVE_COLLECT_WOOD description "BW2T_SCRIPT_01FINAL_ADVISORS_ARRIVENEW_20"
disable this objective for the given player
disable player 0 objective TRIBUTE_OBJECTIVE_COLLECT_WOOD
rset this objective
reset player 0 objective TRIBUTE_OBJECTIVE_COLLECT_WOOD
Sets the current value of this objective. e.g if you set the current to 10, it makes it look like the player has done 10 of whatever objective)
set player 0 objective TRIBUTE_OBJECTIVE_COLLECT_WOOD value 100
sets whether the player will lose when he has no towns and no villagers. This defaults to off, as there may be lands on which the player has neither of these (the tutorial land).
enable game can be lost
sets whether the player has influence over the whole land or not.
enable global influence
sets the minimum height the camera can be above the land
set min height camera experssion focus expression
set text skip
disable text skip
set villager interaction manager
enable villager interaction manager
sets whether the player can use the destruction tool
disable can use destruction tool
sets whether gaining tribute displays visual and plays audio
disable tribute visual
sets whether placing a disciple triggers any speech
disable disciple placedown speech
sets whether advisors interupt each other. when this is disabled, advisors can talk at the same time as each other.
disable single active speech
quick saves the game then quick loads the game. Used to test the save load.
force save load
shows the end credits
play credits
quick saves and then goes to the main menu. For use at the end of the game.
force save goto menu
Enables or disables the dialogue manager. This is the enemy generals and adviosrs commenting on your actions. Only disable works, as it is re-enabled on level change
disable dialogue manager
sets whether the hearbeat audio is played
disable heartbeat sound
enables the given menu, or disables the active menu
enable SCRIPT_MENU_TYPE_PAUSE menu
enables or disables the pause menu being accessed in cutscenes
enable pause menu in widescreen