Jump to content

.cres not using their abilities


Guest xvnon

Recommended Posts

Guest xvnon

First let me preface this with this not being a regular install. However there are some things that maybe aren't showing up in a regular install either.

I edited the hla.tph to the following:

----MAIN PATCH
DEFINE_PATCH_FUNCTION grant_hlas
    INT_VAR spellcaster=0
            force_level=0
            hard_minimum=1
    STR_VAR class=""
            kit=""
            resref=""
    RET hla has_hlas
BEGIN

----WORK OUT LEVEL AT WHICH GIVEN CLASS STARTS GETTING HLAS
DEFINE_PATCH_FUNCTION hla_level_minimum
   INT_VAR num_classes=0
   STR_VAR class=""
   RET minimum
BEGIN
   PATCH_MATCH "%class%" WITH
      FIGHTER BEGIN
           PATCH_IF num_classes=3 BEGIN
                SET minimum=12
           END ELSE
           PATCH_IF num_classes=2 BEGIN
                SET minimum=9
           END ELSE BEGIN
                SET minimum=1
...
     RANGER BEGIN
           PATCH_IF num_classes=2 BEGIN
               SET minimum=9
           END ELSE BEGIN
               SET minimum=1
...
      PALADIN BEGIN
            SET minimum=1
      END
      MONK BEGIN
           SET minimum=1

.. basically changing all the 'physical damage dealers' min level requirements for HLAs to a lower value.. in this case:
Fighters, thiefs, rangers, monks, and sahuagin(not sure this one would even effect anything)

I realize none of this is supported.. but my question pertains to the following:

1. HLAs ARE used and work POST BG1(in BG2 they work(this is an EET install)) by creatures.
2. in BG1 the creatures DO NOT use the HLAs even though they are in their innate ability bars.

3. Even though the HLA min is set to 1, and the fighters begin receiving their HLAs at 1 (I have tried raising it to level 2) .. they at MOST only receive a maximum of 7 HLAs, even if they are PAST the level to receive more. 

e.g. Fighter set to receive HLAs at level 1, they are level 10, they should have 10 HLAs, they will only have 7. Until it gets to BG2, where the max is raised to 12 HLAs, again.. not matching their level.

 

so.. my questions are:

1. Why aren't BG1 NPCs using the HLAs even though they have them? (I'm assuming there is something different in the script.. but I thought all enemies were suppose to use what they have?)
2. Why are they only getting assigned 7 or 12 HLAs instead of the number they should receive?

Link to comment

1. SCS assumes HLAs aren't present on a BG1 install and so doesn't bother checking creatures to see if they have them. (It's an installation-time-saver, basically.) You can turn that off by going to around line 350 of stratagems/lib/always.tph and removing the disable_hlas instruction - but I have no idea what will happen or even whether it will install. (Probably it will: it handles BG1 creatures on an Enhanced Edition Trilogy install.)

2. SCS's algorithm for assigning HLAs basically picks a sequence of HLAs at random from a list, and then selects HLAs one at a time from the sequence until either it's got its full complement or it reaches the end of the sequence. (The list for non-spellcasters is in stratagems/genai/hla_choices/vanilla.) Since the sequences only have five-to-seven items, no-one gets more than that number of HLAs. (I'm actually surprised anyone's getting 12, actually - I don't know whether that's because they're multi-class, because of some glitch introduced by these changes, or what.) As for why the sequences stop at seven: basically nothing in the game is high enough level to get more than seven HLAs, and in any case I doubt many enemy creatures will be able to get through more than seven HLAs in a single fight. Making these sequences longer will grant more HLAs.

EDIT: I've just seen you're on a Trilogy install - so the issue is that you're getting HLAs but they're not being used. It's a similar issue, though (I think) - the scripts given to BG1 creatures don't contain code to use HLAs, because they're assumed not to have them and it clutters the script unnecessarily. If you want to change it, go to line 333 of stratagems/genai/genai_shared.tph.

All absolutely at your own risk, of course.

Link to comment
Guest xvnon
14 hours ago, DavidW said:

1. SCS assumes HLAs aren't present on a BG1 install and so doesn't bother checking creatures to see if they have them. (It's an installation-time-saver, basically.) You can turn that off by going to around line 350 of stratagems/lib/always.tph and removing the disable_hlas instruction - but I have no idea what will happen or even whether it will install. (Probably it will: it handles BG1 creatures on an Enhanced Edition Trilogy install.)

2. SCS's algorithm for assigning HLAs basically picks a sequence of HLAs at random from a list, and then selects HLAs one at a time from the sequence until either it's got its full complement or it reaches the end of the sequence. (The list for non-spellcasters is in stratagems/genai/hla_choices/vanilla.) Since the sequences only have five-to-seven items, no-one gets more than that number of HLAs. (I'm actually surprised anyone's getting 12, actually - I don't know whether that's because they're multi-class, because of some glitch introduced by these changes, or what.) As for why the sequences stop at seven: basically nothing in the game is high enough level to get more than seven HLAs, and in any case I doubt many enemy creatures will be able to get through more than seven HLAs in a single fight. Making these sequences longer will grant more HLAs.

EDIT: I've just seen you're on a Trilogy install - so the issue is that you're getting HLAs but they're not being used. It's a similar issue, though (I think) - the scripts given to BG1 creatures don't contain code to use HLAs, because they're assumed not to have them and it clutters the script unnecessarily. If you want to change it, go to line 333 of stratagems/genai/genai_shared.tph.

All absolutely at your own risk, of course.

Thanks for the response. After like 10 SCS installs and testing the various different things... 

1. The BG2 ToB NPCs had additional HLAs because of the second column in the vanilla shared HLA folder, that one had 12, and the other had 7.. If it's randomly chosen then maybe the NPCs that it was tested on happened to get 7 HLAs repeatably. 

2. Upping the number of HLAs works as you described. 
 

3. Changing the the LPF var on line 330ish of the genai_shared.tph from

'LPF is_bg1_char STR_VAR filename RET value END' to... 
'LPF is_bg1_char INT_VAR loc=0 wander=0 is_moron=0 has_ranged=0 level=0 enchantment=0 has_hlas=0 RET value END' ,

Seems to have worked, BG1 NPCs are now using the HLAs and have the correctly allocated amount. 

Looking through and comparing some of the BG1 scripts to BG2 seemed mostly that one had HLAs usage, in addition to noticing resistances on the target after attacking... 
My followup question to this would be:

1. That above change to the genai_shared.tph.. That would effectively just be assigning the BG2 scripts to BG1 NPCs where it could, right? 
2. As far as SCS goes for assigning scripts, I've seen you mention before that it basically checks to see.. I'm guessing a lot of the original default BG1 scripts for replacing.. So if a mass script change was done to enemies in SoD.. that would then assign the scripts to them in a similar fashion?
3. What are the different scripts that SCS checks for, to decide replacement if the above is right?
 

Link to comment

What do you mean "second column"? (I may be misremembering this myself, I haven't looked at this bit of code for a while).

As for the questions:

1. Yes

2. Yes, though I'm not looking at it myself until I've had a chance to play SoD

3. Look at the read_in_combat_scripts function at the bottom of stratagems/genai/genai_shared.tph

Link to comment
Guest xvnon

So, thanks for all the replies. 

I've been able to use your weidu to apply the SCS AI to SoD scripts, and everything seems fine with it so far.

What I meant by the second column was there were two different distinct areas for HLAs.. listed in this format:

 

1	WARRIOR_HARDINESS	WARRIOR_HARDINESS ... to a total of x7

2	WARRIOR_WHIRLWIND	WARRIOR_GREATER_WHIRLWIND	WARRIOR_RESIST_MAGIC	WARRIOR_CRITICAL_STRIKE... to a total of x12

So.. I meant that the BG2 portion was probably pulling from the 2nd part. 

So far I think I get how most of the scripting is applied.. another question I had was...

1. Why are there so many different scripts for 'genai_shared' .cres .. (fighters, monks, rogues...) .. it seems that most fighters get assigned a few different scripts, but ultimately the same script with a different name (most in game .cres seem to use the same scripts here and there.. but in Near Infinity, there are probably like 150 different melee scripts) .. which might be to cover all the various different kits that get assigned their own individual script? 
 

Additionally thieves seem to have a very limited script that I guess gets paired with a fighter/thief .. it doesn't make use of different HLAs thieves are able to get access to.. e.g . Evasion.. Greater Evasion.. (none of the which you have listed in the vanilla ai HLAs.. so it doesn't add it anyway)

2. Further going on the above point.. to circumvent that.. I've added additional scripts that extend on to the already existing scripts.. but with multiple installs maybe those scripts change ... e.g. thieves typically get assigned 'dw3rs2as' 'dw2mp2th' ... and in a secondary install maybe those will change?

 

I know that each mage/priest gets it's own additional script, whereas physical orientated damage dealers seem to have somewhat of the same script (one script would generally cover most of what they would want to do.. unless adding randomness to it).

Additionally it seems like there are quite a few mislabeled .cres in the game.. nothing as a result from your mod, just stuff that I've noticed. Like a certain .cre not being assigned the class it should.

Link to comment

There are so many scripts (mostly) because I don't want to waste space and processing time including every HLA and class ability in the AI script. So (e.g.) kensai have their own script, and only that script uses Kai.

If you look in genai/ssl/hla.ssl, that's where all the HLAs and kit abilities are kept. The various 'requireblock' bits make sure only certain bits of it get compiled for each script. 

As for thieves: all thief multiclasses use the same script. (Under the constraints of the Infinity Engine AI, there's not much tactical difference between how thieves and fighter/thieves ought to fight.) (Greater) Evasion is listed in the HLAs (look in 'thief') but using it isn't implemented as of 32.8: that will change in the next release.

 

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