Jump to content


Photo

The scripts of the engine creature


  • Please log in to reply
8 replies to this topic

#1 temnix

temnix
  • Member
  • 983 posts

Posted 02 March 2018 - 10:01 AM

This post started out as a request for help, but as I helped myself and eliminated possibilities, new knowledge came out. I have a block on top of BALDUR that inserts the scripts for the engine creature, OnCreation. These scripts run parallel to BALDUR and do many different things. While the inserting and the scripts themselves work, what follows in BALDUR behaves differently, and really not properly, with this addition. This was the reason I got wrong results while testing for spell states. This is the top of the file:

 

IF
    OnCreation()
THEN
    RESPONSE #1
        ChangeAIScript("BOVERRID",OVERRIDE)
        ChangeAIScript("BCLASS",CLASS)
        ChangeAIScript("BRACE",RACE)
        ChangeAIScript("BGENERAL",GENERAL)
        ChangeAIScript("BDEFAULT",DEFAULT)
        ChangeAIScript("BSPECIFI",SPECIFICS)
        SG("COLOR_TAGS",1)
        Continue()
END

IF
    True()
THEN
    RESPONSE #1
        DisplayStringHeadOwner("DAGG01",16499)  // Coo-coo
END

 

The second block is there for testing. It is supposed to display a string over the head of party members with a dagger. With the above block in place, the displaying only happens once. Without it it's continuous, as should be with the True() trigger. This skewing even happens if I move the insertion block to the bottom of BALDUR. Other blocks, in the middle of the script, do trigger, if (in the arrangement above) I put Continue() after the display action. Otherwise they do not trigger, as they should not with this True()-starting block. The True() block should replay forever and keep the engine from getting to those lower lines. And that is how it seems to be, except True() only triggers once.

 

I've removed the ChangeAIScript lines, and then True() started cycling normally. With them, it does not repeat even when there is Continue(). Apparently the insertion for the engine creature prevented the True() block from working normally. But I realized that not all of the insertions stopped the actions below. Elimination showed that insertion at every level except DEFAULT (ChangeAIScript("BDEFAULT",DEFAULT)) was harmless, but this one blocked the rest of the script. This means that what we know as BALDUR.BCS is the DEFAULT-level script of the engine creature. Naturally, if I was sticking in a new script, the remainder of the old BALDUR would not trigger. It's a wonder it triggered once, probably due to the speed of all this. In light of this everyone should not insert scripts at the DEFAULT level and be aware that all the other scripts are higher in the hierarchy and will take precedence over regular BALDUR content.

 

BALDUR itself, with all of the regular content from previous mods and your mod, could be inserted at the OVERRIDE level and moved out of DEFAULT; I don't see why not. I would like to know whether these changes to the engine creature would be properly uninstalled? Yes, the version of BALDUR used is going to revert, but the engine creature, after all, is some real guy without an avatar sitting outside the map and dreaming this world like Carroll's Red King - running all of these scripts, of which BALDUR is really on the lowest rung and the higher rungs are yet empty. And if this demiurge gets recorded in the GAM together with his world, will the old script arrangement be restored when the King wakes, that is, when the mod is uninstalled?


Edited by temnix, 02 March 2018 - 10:03 AM.


#2 GeN1e

GeN1e

    A very GAR character

  • Modder
  • 1604 posts

Posted 02 March 2018 - 04:38 PM

With them, it does not repeat even when there is Continue().

Continue() adds the current block to the action queue and continues reading the script without execution until it reaches the end or a true block without Continue(). After that it executes the queue.

So you can get both displays from this example:

IF
  Global("test","global",0)
THEN
  RESPONSE #100
    SetGlobal("test","global",1)
    DisplayStringHead(Player1,~One.~)
    Continue()
END

IF
  Global("test","global",0)
THEN
  RESPONSE #100
    SetGlobal("test","global",2)
    DisplayStringHead(Player1,~Two.~)
END

 

BALDUR itself, with all of the regular content from previous mods and your mod, could be inserted at the OVERRIDE level and moved out of DEFAULT; I don't see why not.

I don't see why :shrug:

 

I would like to know whether these changes to the engine creature would be properly uninstalled?

Most unlikely.


Retired from modding.


#3 temnix

temnix
  • Member
  • 983 posts

Posted 04 March 2018 - 10:16 AM

I see skepticism, I don't see knowledge. Skepticism is compatible with knowledge and is even respectable with it. Without arguments, it becomes nay-saying, which is very cheap on the market... The reason why BALDUR might be worth moving to the OVERRIDE slot is because that way DEFAULT would be freed and blocks in BALDUR, whether from this mod or from previous mods, would take precedence over lower-tier scripts. Then again, why, other than my gentility, should stuff in BALDUR be treated as more important than my custom checks?

 

In any event, this is probably another case of my casting pearls. Who is even going to have the imagination to use the engine creature and its tiered scripts and write some interesting spells or other things with it? Yesterday I clicked by accident on "Multiplayer" in Baldur's Gate, and a list of online games came up. With names like dooda23 and JoinMe, this is a community of players just graduated from 2nd grade. And mods they can handle are going to be on the level of Diablo.


Edited by temnix, 04 March 2018 - 10:17 AM.


#4 subtledoctor

subtledoctor
  • Modder
  • 656 posts

Posted 04 March 2018 - 01:17 PM

I'm getting a real "emeror's new clothes" vibe here...

#5 temnix

temnix
  • Member
  • 983 posts

Posted 05 March 2018 - 03:21 PM

Yup. Emeror it is.



#6 Avenger_teambg

Avenger_teambg
  • Member
  • 604 posts

Posted 06 March 2018 - 08:11 AM

"but the engine creature, after all, is some real guy without an avatar sitting outside the map and dreaming this world like Carroll's Red King - running all of these scripts, of which BALDUR is really on the lowest rung and the higher rungs are yet empty. And if this demiurge gets recorded in the GAM together with his world, will the old script arrangement be restored when the King wakes, that is, when the mod is uninstalled?"

 

irrelevant


Avenger

#7 temnix

temnix
  • Member
  • 983 posts

Posted 06 March 2018 - 09:44 AM

Nonsense. It's very much relevant. If I'm going to phase BALDUR out of one tier into another, I'd best know for a fact it's going to return to the former spot, or where it is, anyway, to know what is going to take precedence to what. But that only matters if I care about compatibility with stuff in people's BALDUR, and why should I? You're right - fuck them!



#8 Avenger_teambg

Avenger_teambg
  • Member
  • 604 posts

Posted 06 March 2018 - 12:30 PM

1. it is not a creature.

2. it isn't saved.

 

Every time the game object is created (loaded), a "scriptable object" is created and baldur.bcs is assigned to the default slot. This object has all the scripting slots (just like any scriptable object) has position, but lacks a lot of creature attributes. As it isn't saved itself, you don't have to care about any remains in saved games. 

All the other slots are wiped clean even if you quicksave/reload. 


Avenger

#9 temnix

temnix
  • Member
  • 983 posts

Posted 07 March 2018 - 05:59 AM

Well, that's good to know. As a complement to how I'm doing it.