scripting problems parsing errors

ejonesss

New member
Joined
Apr 30, 2012
Messages
49
i just figured out how to compile the tutorial script.

unfortunately anything i try to add into the script gives me parsing errors.

for example i want to get the camera position to be displayed in the text field in game

i tried


run script WikiTutorialScript

begin script WikiTutorialScript
start
disable load screen
set fade in time 1
wait until 1 != 1
say camera position
end script WikiTutorialScript


then the compiler tells me error near token "camera" and fails to compile.

i tried to get time of day called game time by the time tutorial and rooster challenge from land 3.

and the same kind of error this time with game.

does lionhead studios use a different set of db and enums files than what is included with the game and developer kit?

same kind of errors happen if i try to compile one of the script files that comes with the game in the scripts/bw2 folder (note mac version is required to get source files).

thanks for the help
 
The say command needs ""
But you will need to add some stuff like this:

run script WikiTutorialScript

begin script WikiTutorialScript
    CameraPos = 0
start
  disable load screen
  set fade in time 1
  CameraPos = marker at camera position
  say "Camera position is $d" with number CameraPos
  wait until 1 != 1
end script WikiTutorialScript

NOTE: I am not sure this will work. because CameraPos will be 3 different number {X,Y,Z} and I don't know what will happen with $d.

What I'd do is:



run script WikiTutorialScript

begin script WikiTutorialScript
    CameraPos = 0
    CameraPos2 = 0
    CameraPos3 = 0
    CameraPos4 = 0
start
  disable load screen
  set fade in time 1
  CameraPos = marker at camera position
  CameraPos2 = SCRIPT_OBJECT_PROPERTY_TYPE_XPOS of CameraPos
  CameraPos3 = SCRIPT_OBJECT_PROPERTY_TYPE_YPOS of CameraPos
  CameraPos4 = SCRIPT_OBJECT_PROPERTY_TYPE_ZPOS of CameraPos
  increment tribute by CameraPos2
  wait 5 seconds
  increment tribute by CameraPos3
  wait 5 seconds
  increment tribute by CameraPos4
  wait until 1 != 1
end script WikiTutorialScript

 
yes that script works although it would be nice to display the contents of a variable as text in the field where the say command displays.

also would be nice is if there was a way to attach a script to existing land without recompiling all the land's scripts basically run multiple chl files so i can leave the original challenges in place and add new ones.

as it would be a pain to re write all the source scripts that comes in the scripts/bw2 folder just to add my own scripts.
 
Back
Top