Jump to content

Best way to edit BCS (script) files?


Recommended Posts

Hi all - I was trying to open some .bcs files in NearInfinity (GNU/Linux) and it's pretty much unusable.

It looks like the tool is doing strref lookups as I try to scroll down in a large .bcs file, which is causing a long hang each time on my megamod install.

Is there a more lightweight approach to editing bcs files?  (perhaps if embedded strref is a thing, that would just leave the strref offset in place, without doing the lookup?)

My ideal workflow would be something like:

  mysteryProgram --decompile something.bcs > something.baf

  emacs something.baf # proceed to edit file

  mysteryProgram --compile something.baf > something.bcs

 

What options for editing (or compiling+decompiling) BCS files are out there?  Preferably native GNU/Linux.

Link to comment

In NI, you can export the file as a .baf script and then edit it in a text editor. Then... for compiling back to .bcs I’ve only ever used Weidu. But I think it’s quite easy to do with Weidu. (Can use Weidu to decompile the .bcs to .baf as well, if you find it more efficient than finding the file and exporting from NI’s UI.)

Link to comment
7 minutes ago, lynx said:

Plus, I doubt the stated reason for slowdowns. Anyway, you can disable the comments in the options.

I had added some print debugging to my fork of NearInfinity, in this file "src/org/infinity/resource/key/ResourceEntry.java" for the getSearchString() function - the only thing I've done is:

1. Fresh launch NearInfinity

2. Press ctrl + i to open a file (I chose cvjenlig.bcs, a massive bcs file I guess)

3. I see a lot of output about doing the search string lookups (my print debugging)

4. If I scroll the file, it will freeze up, and more of these getSearchString() lookups will occur after a few second pause (the GUI looks like its hanging on a blocking thread vs using events or callbacks when this happens)

This is with a NI that I forked/cloned off git about 1 month ago and other than a few System.out.println, didn't do anything to it other than recompile with ant.

Ignoring the obvious slow lookups (it takes about 1 second per getSearchString call, and a single scroll down in the bcs file invokes 5 to 10 of these lookups) I don't see _why_ NI does the lookups here?  All I see is the BCS source code, maybe its some type of IDE feature if I mouse over or click on the resources its looking up?

Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...