Skip to content

Questions about making scripts

KharlogKharlog Member Posts: 5
edited December 2012 in General Modding
Hi,

I'm trying to do some spellcaster scripts. I've downloaded the script compiler from:

http://www.fileplanet.com/13585/10000/fileinfo/Baldur's-Gate-Script-Compiler-(Final-Version)

Is this the latest/best version?

I've been trying to find some decent way to debug the character script .BS files. I basically need to find a way to print some strings to the chatbox. Alternatively I could save values to some global variables (tokens) and then possibly check the values of those variables using console. Is this possible?

I found a relevant thread here:

http://forum.baldursgate.com/discussion/5235

However nothing will be displayed if I try to input some custom string in DisplayString-function, like

DisplayString(Myself,~Oooooh! Pretty! A Magic Missile!~)

I can only input integer as second parameter and then the corresponding string from dialog.tlk is picked. I cannot figure out the logic how to find which integer refers to which string in that file.

It seems DisplayStringHead-function is not even supported by the compiler I'm using. I get the following error when compiling: "Action:DisplayStringHead Not found. Check for proper brackets."

Does anyone know any decent way to debug Baldur's Gate scripts?

Comments

  • KerozevokKerozevok Member Posts: 695
    edited December 2012
    You need to add the strings in the tlk, then in the script :
    DisplayString(Myself,xxxxx)
    x = string reference.

    Use Near infinity instead of this compiler.
  • KharlogKharlog Member Posts: 5
    Kerozevok said:

    You need to add the strings in the tlk, then in the script :
    DisplayString(Myself,xxxxx)
    x = string reference.

    Use Near infinity instead of this compiler.

    Thanks for your reply! Any idea how to go about editing dialog.tlk? I cannot figure out how the file is constructed. Between the strings there is no markers when new one is going to start. This information must be coded somewhere else in the file, possibly in the beginning? How to read it?

    I tried Near Infinity (downloaded from http://www.idi.ntnu.no/~joh/ni/download.html) but unfortunately after loading chitin.key file I get error loading dialog.tlk file. Quite possibly the format has been changed in BG:EE. Are you using NI without problems?
  • KerozevokKerozevok Member Posts: 695
    edited December 2012
    With NI you can edit the tlk (edit / tlk / add a new string).

    Latest version here :
    https://github.com/FredrikLindgren/NearInfinity/downloads

    Make a backup of your tlk and your chitin.key before using NI. ;)
  • KharlogKharlog Member Posts: 5
    Making modifications to dialog.tlk needs restarting the game which is kind of cumbersome. I figured out how to do the neccessary modifications using WeiDU compiler. I guess there is no better ways to do these things...
  • KharlogKharlog Member Posts: 5
    Kerozevok said:

    With NI you can edit the tlk (edit / tlk / add a new string).

    Latest version here :
    https://github.com/FredrikLindgren/NearInfinity/downloads

    Make a backup of your tlk and your chitin.key before using NI. ;)

    I tried the newest Near Infinity and it seems to be able to read dialog.tlk quite nicely. This will be a very helpful tool, thanks!
  • KerozevokKerozevok Member Posts: 695
    No need to restart the game and no need to use weidu, you compile the script with NI.
Sign In or Register to comment.