J ai script help

Here’s the scripts I use on my module which is HCR 3.2 based. I’ve moved to nwnee and need a little help updating GetHasSpell in these I believe. Thanks :slight_smile:

https://drive.google.com/file/d/1KgxjaxLdUwEEc5sEByENNUX8nHmeKLR6/view?usp=sharing

Looking at your erf in a module the special lich and other custom spawn script were easy to implement into my base that what the hr_ai_load_inc script is for just choice one of the AI switch cases and drop your spawn in there / lower down you can drop the AI_SetSpawnInSpeakArray calls into the iSpeakSet so you can have easily switch what the lich says without having to have multiple spawn lich settings. Just place them their and then save/compile there and in nw_c2_default9. Add integer PRESETAI on the creature to match the case (example PRESETAI 5) number and that will load the spawn on that creature. Add SpeakSet interger that match the AI_SetSpawnInSpeakArray case.

Make sure you take out AI_SetUpEndOfSpawn in any of the spawns the hr_ai_load_inc script does it at the end.

You only had trouble with three custom functions
CTG_GenerateNPCTreasure
which can easily be fixed by adding #include “x0_i0_treasure” to the top with the others.
HC_SetRacialMovementRate
just a custom old HC function that I did not keep because poor halfling have enough troubles LOL, if you want it just copy it out of the hc inc and put it in hr_inc_master
HC_EffectArmorEncumbrance
just another custom function that I did not keep, same as above.

Thanks for your input but all I really wanted was to get my set of scripts running in nwnee. I know yours work, and a bit differently than mine. I read on the beamdog forums that currently gethasspell returns 0 on a creature where before it would return whatever amount of spells it had. This makes all mage characters using this ja ai I have melee :slight_smile: I did try an make use of yours integrated into my module but you have many includes in there and really, that’s not what I wanted, they are your’s and why I asked if you would share whatever fixes you’ve done :slight_smile:

Ah well in your erf testing in a module the creatures are casting fine(I’m using the latest developer version 8174). Are using the stable build?
Here forum link to issue
LINK
maybe add OBJECT_SELF in j_inc_generic_ai to the gethasspell calls. The the core system for J.
I could ask Niv more about the function and see what he says.

There’s a lot of GetHasSpell call in that include, hundreds, maybe niv would know more. Oh and I am using the stable release, it’s a PW.

I already added them to you test module, you want the file and see if that helps?

Please :slight_smile:

I’m holding off and looking at the bug, it not being able to cast. It being able to cast beyond your basic requirements to cast (fudge casting, power casting etc, level requirements, amount requirements) it not just with jasperre AI, it affects bioware/BD casting also. I ask niv on discord and he going to look at today or tomorrow (all depends on his timezone in relation to his statement). So I hope that help for now and we see what their plans are with the bug. I gave him the bug link also.
LINK

After testing this further, this is not GetHasSpell function error, the game engine is cutting off spells and forcing NPC to follow standard rules just like PC. So if you give x creature 12 of spell and they can only cast 1 the game will cut 11 off. To test this vs 1.69 give creatures in both a bunch of extra spells and then go in as a DM and posses them and you will see that in 1.69 all the spells are there and in EE they are cut to the required amount. Wow surprised people have not noticed this sooner. Your best bet is to give extra spells to the NPC under special abilities spells settings.

Wow, I’m hoping Beamdog see this as a bug and fix it. I like the old system :slight_smile:

So someone should report it as a bug. They can’t fix what they don’t know about.

TR

Like I said, I did tell niv on discord and I did follow up on discord that it was an engine thing. I also just have put a comment in on the bug report that I linked. I can see reason for going forward like this, but also this would break backward compatibility of some module/pw.

Niv know of this, but he said they did not have time to get it into the next stable release and it will be looked at in next development cycle.

How can it break backwards compatibility when that’s how it used to work before nwnee?

No, I mean if they do not fix this it break compatibility. Seem they are busy with the Intel bug so I doubt this will be fixed in the next patch release.

Did this ever get addressed?

Does not look like it has, might have to move to special ability / spells system.