Hi Pain,
I'm back from the "land of nod".

Anyway, yes, I did know about the x2_inc_switches and have already copied the switch names into my OnSpawn for easy recall. Although, I am consdiering using different variable holders for my own ease. There's no reason why not is there? After all, I don't think the holder is used specifcially anywhere else, and I find the OC ones too unwieldy. E.g. I would like to use
if (GetLocalInt(OBJECT_SELF, "STEALTHY") == TRUE){SetSpawnInCondition(NW_FLAG_STEALTH);} rather than have to remember such things as
const string CREATURE_VAR_USE_SPAWN_STEALTH = "X2_L_SPAWN_USE_STEALTH";.... If it's in here it's something you should use before other things.
I agree. And having checked the comments and examined the code, I am beginning to have a better understanding of how they work. I have yet to track down the CREATURE_VAR_USE_SPAWN_AMBIENT and the CREATURE_VAR_USE_SPAWN_AMBIENT_IMMOBILE, which make creatures play "ambient animations", but do not really know what they mean by this. For instance, do spawned in creatures not move at all when they are first spawned in? This may be a really noob-like queston, but all my spawned in creatures do something at the moment (even if they just stand there and look around), so I do not know what extra animation these two conditions are meant to do. I know I could add them, test and see .... BUT ... that does not always answer my question as I may not wait long enough or not do the correct thing to make this happen. E.g. I added a cold aura effect to a creature, expecting to see an aura and be affected by cold when I approached it. In practice, nothing happened .... The reason being ... (a) I was used to and expecting an aura visual like NWN1 used to do, which is no longer the case in NWN2 and (

the code did not apply damage if the creature did not see the PC as an enemy! Now I can understand this in some circumstances, but I had no idea that this was what was happening. Once I tracked down the code and examined some of the process myself, I could see how it was meant to work and therefore, not be surprised by apparent results of nothing.
Another good one to know is ginc_event_handlers.nss which has code to swap out via script the event handlers.
I was not aware of this one. Does it have anything to do with the SetCreatureScriptsToSet function, which I do use. If not, then maybe it is an area I do not understand. Anything that has things like "event_handler" seem a little trickier to use in my experience. Could you explain how this script is useful to know?

However, I do have a couple of questions that are close to the end of my immediate enquiries (under the circumstances that it is easier to work around that "fix") and that is where do these two functions get defined (or what do they actually do?):
GetCreatureTalentBest and
GetCreatureTalentRandomWith reference to the henchspells.2da, I can see it referenced inside hench_i0_spells ... so is it only used as a way to prioritise
spells learned as opposed to
spell ability? Is this the only place (script) where the 2da file is referenced?
Slowly getting there...
One last question, what do coders mean when they refer to a "prototype"? Does it mean the most basic function, which cannot be broken down further. i.e. The core functions rather than user created ones that use these "prototypes"? if so, are the above two functions protoypes?
Lance.
SOME PROGRESS:
==============
I looked closer at the NW_FLAG_FAST_BUFF_ENEMY flag and discovered that it applied more than one buff subject to a category and if the creature had the buff spell. However, it also treated the creature's special ability of the spell as having the spell, which was good to discover. (I thought it would only fire an actual spell as opposed to an ability.)
I was also able to reset the flag by using a
AssignCommand(oCreature, SetSpawnInCondition(NW_FLAG_FAST_BUFF_ENEMY, TRUE)); when looping through creatures on a PC exiting the areas, which meant a creature would rebuff using the same spells as long as they had a number of them.
NB: Setting the number of spells to limitless appeared to stop the creature from using them at all! ??? Anybody else notice this?
I also set the NW_FLAG_FAST_BUFF_ENEMY to set TRUE by default for every creature ... no reason why not is there? After all, if the creature does not have the buffs, then it simply won't do anything with it. But surely its better for the creature to buff if possible?
I also found that using the TalentSpellAttack(oTarget); in an AI override script makes the creature cast any offensive spell I had given it ... and again, only up to the number it is given.
In this simple testing, my creatures are starting to look like they mean business.
Modifié par Lance Botelle, 25 mars 2011 - 03:34 .