Skip to content

Creature Creation and Scripts: Observations and Questions

karnagekarnage Member Posts: 92
These creature files have many scripts, and I think I'm figuring out how it works. Correct me if I'm wrong ....

The script choices are:

Override Script
Class Script
Race Script
General Script
Default Script


In my "Vondo" override script, I placed commands/keywords for combat. I noticed while playing Vondo that he was very difficult to control during combat. I have also noticed that, when using NearInfinity to pull up characters within saved games, my custom scripts are going in the "Class Script" slot.

It's a heirarchy; isn't it? BG looks at Override Script; if no actions are performed there, it progresses to Class Script; if no actions are performed there, it progresses to Race Script and so on.

So, with this being the case, Vondo was charging forward with the basic aGen script, ignoring healing potions, laying on of hands and other scripted actions because Override has precedence over Class; Class has precedence over Race, etc.

I looked at other Override scripts, and they contain mostly setting of variables (romances, who's in the party, etc). The example I drew from in creating Vondo had a very simple script for allowing/intiating dialog:

IF
See([PC])
NumTimesTalkedTo(0)
THEN
RESPONSE #100
Dialogue(Nearest([PC]))
END

Then, his instructions were this:
"So now we should have J#Vondo assigned to override, initidlg.bcs assigned to a slot further down, and wtasight or wtarsgt.bcs below that."

So, provided that this is a heirarchy; that my custom scripts are going in "Class Script"; that Default Script (initially DPLAYER3) is blanked out; my script assignments for CRE creation should look like this:

* OVERRIDE: Things like variables for tracking "interpersonal" relationships, goals, satisfaction/disatisfaction with the party, etc; should not include combat/spell instructions as these will interfere with the player's script choice;
* CLASS: blank, Default or aGen
* RACE: Chosen dialog method (initidlg, etc)
* GENERAL: 'Blank' or combat behavior scripts (intended for while not in the party, as above scripts take precedence)
* DEFAULT: blank.

Anyway, that's how it seems to me ... Am I figuring this out, on the right track, or out in left field?

Comments

  • WispWisp Member Posts: 1,102
    Yes, it's a hierarchy. For the BG series, override is at the top and default is at the bottom, yes.

    The engine works in passes. In a pass, scripts are evaluated sequentially, from highest priority to lowest. In each script, the script's blocks are also evaluated sequentially, from top to bottom.

    If the triggers for a block are true, the block's actions are processed and script processing starts over from the beginning in a new pass. The exception is if the block's last action is Continue(), in which case the actions are queued (or actions are executed in order, but evaluation is still done against the old game state or something like that; in any way, if variables were changed, those changes won't be visible until the next pass) and script processing resumes from the block which was true.

    Generally, it is preferable to use the fewest practical number of scripts, in order to keep complexity down.
Sign In or Register to comment.