Jump to content

Interaction between scs ai and mod added creatures


Recommended Posts

Hi everyone. I'm actually modding some mods with an scs installation, and i was asking myself: how scs decides when to add a script to a specific creature from a mod (smarter ai, better calls for helps, etc.) ?

What i mean here is, when i look at some of mod-added creatures, certain do have some scs scripts, some others don't. I know that for a good amount of those creatures, there are some inconsistencies in their stats, wrong class/race-kit assignments, etc. Is there something i could do before installing scs for it to take them into account ? If for example i see a fighter with mages spells and some thieving skills, can it break scs detection that will skip the creature completely ? If i change their stats and assigned a correct class, remove wrong stats, etc. scs would detect it and appropriately add some ai to it ?

Basically i would like to know

1.How i can tell scs by editing some specifics stats: go for it, this mod creature is e.g a mage with old spell scripting or a fighter with no scripts at all, just add yours instead ?

2. If a scripts has some dialogue interaction inside, do scs detect it and decide no to touch it ?

3. Can i change some scripts (edit the dialogue interaction into a secondary script e.g) for scs to add its ai too ?

 

Sorry that's a lot of questions. But i'm struggling about it since two days and i want to understand the mechanics here :) Thanks in advance !

Link to comment

The SCS AI components choose their targets based on explicit lists of generic scripts to replace. If you use the standard generic combat scripts, they'll get replaced with SCS combat scripts. And in the case of spellcasters, they'll get their spell memorization overhauled. If you don't have any of those scripts on your creature, it'll be left alone.

Using scripts that contain both combat and non-combat elements ... is just not recommended in general. They're always a pain to work around. Splitting them up is basically always a better solution.

If you want a good combat script for your wonky creature that won't get replaced, try something from Siege of Dragonspear. Those scripts aren't on the lists.

Link to comment
Posted (edited)
28 minutes ago, jmerry said:

The SCS AI components choose their targets based on explicit lists of generic scripts to replace. If you use the standard generic combat scripts, they'll get replaced with SCS combat scripts. And in the case of spellcasters, they'll get their spell memorization overhauled. If you don't have any of those scripts on your creature, it'll be left alone.

Using scripts that contain both combat and non-combat elements ... is just not recommended in general. They're always a pain to work around. Splitting them up is basically always a better solution.

If you want a good combat script for your wonky creature that won't get replaced, try something from Siege of Dragonspear. Those scripts aren't on the lists.

Do you have any example of those "standard" or "generic" combat or mages scripts ?

Thanks for all those information already !

Edited by ptifab
Link to comment

A few generic scripts in BG2:

Basic attacks: WTASIGHT, WDASIGHT (the latter is for 

Priests: DRUID6A, DRUID8A, DRUID8B, PRIES10A, PRIES10B, PRIES12A

Mages: MAGE10A, MAGE10B, MAGE10C, MAGE10D

They're kind of obvious when you look at the creatures. Or you could look in the SCS code to extract the actual lists the mod uses.

Link to comment
Posted (edited)
2 hours ago, jmerry said:

Basic attacks: WTASIGHT, WDASIGHT (the latter is for  <= there's a missing explanation here ^^

I have made a few research, and with your explanations i' m going further into this, thank you.

Just another bunch of questions though:

1. With all those explanations, do you have any advices on how to convert a modded creature to make it taken into account by scs script ? I'll try an example here: In a creature script (wich is named name_of_creature.bcs btw) there's a dialog trigger AND some basic scripts to attack and/or cast spells. Can i strip the attack/cast spell script code from it and add the magexx.bcs (or whatever base game bcs file appropriate here) ?

2. There are 5 script containers in a CRE file. Is there a priority to take into account when adding or modifying some scripts ? e.g if there's a dialog trigger, does it have to be in a specific line ?

Thanks for your time jmerry :)

Edited by ptifab
typos
Link to comment

Yes, the scripts are processed in a hierarchy. In a script cycle, the engine will process the Override script looking for a true condition, then Class, Race, General and Default. So you can put your NPC-specific stuff in a dedicated script assigned to the override slot and then give a creature a general mageXX (or priestX or whatever) in the class script to handle combat and a wtasight in the default slot for safety. If it's just a combined script, SCS will ignore it in the interests of not breaking your mod since it has no way of knowing it's a lightly-modified cloned script.

G3 Anniversary does this, BTW. The finale with

Spoiler

the Gibbering Twelve

is against multiple mages using default AI scripting (mageX scripting). It's already a bit of a fun battle, but with the SCS upgrades it becomes a pretty good challenge.

Link to comment
15 minutes ago, CamDawg said:

Yes, the scripts are processed in a hierarchy. In a script cycle, the engine will process the Override script looking for a true condition, then Class, Race, General and Default. So you can put your NPC-specific stuff in a dedicated script assigned to the override slot and then give a creature a general mageXX (or priestX or whatever) in the class script to handle combat and a wtasight in the default slot for safety. If it's just a combined script, SCS will ignore it in the interests of not breaking your mod since it has no way of knowing it's a lightly-modified cloned script.

G3 Anniversary does this, BTW. The finale with

  Reveal hidden contents

the Gibbering Twelve

is against multiple mages using default AI scripting (mageX scripting). It's already a bit of a fun battle, but with the SCS upgrades it becomes a pretty good challenge.

Ok thanks a lot for all those informations. I have studied, tried and edited a lot of things today and i think i understand a little bit better all of this. I can edit the dedicated script and insert it into the override script to avoid mod damage and correctly trigger all of the dialogues, mod conditions etc. After that, i can assign all the base scripts (magex, shouts, etc.) into other scripts containers  (classs, race, etc.), and normally scs will handle them and edit just the base scripts if i understand correctly here ?

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...