Skip to content

Doubt about a function

IamKhaunaIamKhauna Member Posts: 27
Hi everyone, I have a doubt about the function: GetNearestCreature.

int nFirstCriteriaType, int nFirstCriteriaValue,

How to fulfill these 2 parameters?

Cheers.

Comments

  • IamKhaunaIamKhauna Member Posts: 27
    I click in the function but is not appeareing in the right side.

    So I download the NWN Omnibus but don't find anything related to functions.

    Any help?
  • MelkiorMelkior Member Posts: 233
    This is a multi-use function for finding the nearest creature which has certain attributes.

    The two-criteria system is so that the first criteria gives the category, while the second gives the specific type within that category.

    For example, the first criteria might be to find the nearest creature which is not affected by a spell, while the second might specify to look for the creature being affected by blindness. This will cause the function to find the nearest blind creature. In this case, it will skip over any creatures which can see, and if there are no blind creatures nearby, it will return an invalid object.

    If you want to narrow down the selection further, you can use the second and third criteria, so you could, for example, find the nearest enemy goblin which is not yet affected by blindness. It will return an invalid object if it finds no enemy goblin nearby with undamaged sight.

    That might be useful if you want a custom spell which only affects goblins for some reason. Perhaps you want some kind of game function where clerics who worship a particular deity who hates goblins will automatically cause temporary blindness in any goblins who come too close to the cleric? That's something which this function can help you to do.

    The point is that you can change what the function will find. This can be a short-cut so that you make the computer do the work for you instead of going through a loop which looks at all nearby creatures one-by-one and checks for unblinded hostile goblins using separate functions.

    The full explanation of how to use the function is in the link which has already been given.
Sign In or Register to comment.