1. SPS Accounts:
    Do you find yourself coming back time after time? Do you appreciate the ongoing hard work to keep this community focused and successful in its mission? Please consider supporting us by upgrading to an SPS Account. Besides the warm and fuzzy feeling that comes from supporting a good cause, you'll also get a significant number of ever-expanding perks and benefits on the site and the forums. Click here to find out more.
    Dismiss Notice
Dismiss Notice
You are currently viewing Boards o' Magick as a guest, but you can register an account here. Registration is fast, easy and free. Once registered you will have access to search the forums, create and respond to threads, PM other members, upload screenshots and access many other features unavailable to guests.

BoM cultivates a friendly and welcoming atmosphere. We have been aiming for quality over quantity with our forums from their inception, and believe that this distinction is truly tangible and valued by our members. We'd love to have you join us today!

(If you have any problems with the registration process or your account login, please contact us. If you've forgotten your username or password, click here.)

Neverwinter Nights Forum News

Discussion in 'Game/SP News & Comments' started by NewsPro, Apr 6, 2003.

  1. NewsPro Gems: 30/31
    Latest gem: King's Tears


    Joined:
    May 19, 2015
    Messages:
    3,599
    Likes Received:
    0
    (Originally posted by Veldrin)

    Here are today's Neverwinter Nights forum highlights. Please take into account that these are only single parts of various threads and should not be taken out of context.

    David Gaider, Designer

    Scripting Functions: Ah, what I wouldn't have given for these commands when I was doing my "Town AI" project back before NWN's release. I encountered a road block when I realized that NPC's became paralyzingly stupid when a PC was not in their area. But now, voila...

    int GetAILevel(object oTarget=OBJECT_SELF)
    void SetAILevel(object oTarget, int nAILevel)

    Where nAILevel =

    AI_LEVEL_DEFAULT - Default setting. The game will take over seting the appropriate AI level when required.
    AI_LEVEL_VERY_LOW - Very Low priority, very stupid, but low CPU usage for AI. Typically used when no players are in the area. AI_LEVEL_LOW - Low priority, mildly stupid, but slightly more CPU usage for AI. Typically used when not in combat, but a player is in the area. AI_LEVEL_NORMAL - Normal priority, average AI, but more CPU usage required for AI. Typically used when creature is in combat. AI_LEVEL_HIGH - High priority, smartest AI, but extremely high CPU usage required for AI. Avoid using this. It is most likely only ever needed for cutscenes. ...one caveat, though. While I am pulling these functions out of the current list and ooohing and aaahhing at them, it is still possible that they might not make it to the final cut if they don't end up working properly.

    I'm not sure you're quite correct in your assumptions, Kem. The 'AI Level' does not affect intelligence insofar as what the creature is scripted to do... it affects the priority that is given to the creature by the CPU so that it calculates pathing efficiently and runs its heartbeats more regularly. An example of "low intelligence", for example, is how a creature calculates a path if a player is not in the same area... it checks a straight line to its destination and if there is anything barring its path, it just doesn't move. A higher AI Level would cause that creature to start sucking up some processor priority to calculate a path to its destination that would work. When it comes to whether or not a lich or a kobold would act more or less intelligent when it comes to combat and spell selections... that's different (although setting a low AILevel to a creature in combat would certainly cause them to make decisions much slower and probably not move around very well).


    Data Storage: I've only used the data storage dealie once before, so my memory is not exactly the best regarding it. However, basically there are two types of commands:

    1) There's the Get/Set for each data type (except objects), similar to how it works now with GetLocalInt and so forth... except you're using the command GetCampaignInt along with an extra field, the "database name". So you could store an integer with SetCampaignInt( "Campaign", "Plot_Done", 1, GetPCSpeaker()); and then store a location in the same database with SetCampaignLocation("Campaign", "Teleport_Location", lLoc, GetPCSpeaker());

    Then in the other module I can use the Get version to retrieve that info... or simply use DestroyCampaignDatabase( "Campaign"); to remove all data of whatever type that was stored under that name.

    2) Objects work a bit differently. You use StoreCampaignObject (which returns TRUE if successful) and RetrieveCampaignObject (which returns an object, obviously). The thing I like about this is that objects are stored inventory and all... so bringing a henchman along with his current inventory into another module is a quick, one-command operation. Where the data is stored and where the other module reads it from... pffft, you got me. But it works just fine. Once again, a caveat: this is based on my imperfect memory and the functions may yet change. You were warned.


    Quote: I think the next big step would be to have the henchpeople actually level up just like a pc, and have the pc able "suggest" possible advancement paths to the henchperson through dialogue...

    Well, I rather suspect that would involve the new command LevelUpHenchman... but I'll talk more about that later.


    Quote: Now for an Odd Question. If I Store a player object (assuming it stores everything about a character). I'm curious as to if I can set a player back to that object.

    No, because there's no command to "set a player back" to anything, is there? I assume you could store the player state at some point and, say, use CopyObject to create a duplicate of the PC at that point... I'm not sure, though, as I've never tried storing the PC object.


    Quote: Sweet Now, are they REALLY levelling up, or destroying themselves and recreating the next version still?

    They are really levelling up. There's only one version of the henchmen in the OC modules, not twenty.


    Quote: I've got a further question about the SetCampaign* functions. When you tell it the "table name", will it automatically create that table?

    Yes. There's a seperate command to destroy the entire table, but it is created by SetCampaign*** automatically.
     
    Last edited by a moderator: Jan 4, 2018
Sorcerer's Place is a project run entirely by fans and for fans. Maintaining Sorcerer's Place and a stable environment for all our hosted sites requires a substantial amount of our time and funds on a regular basis, so please consider supporting us to keep the site up & running smoothly. Thank you!

Sorcerers.net is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to products on amazon.com, amazon.ca and amazon.co.uk. Amazon and the Amazon logo are trademarks of Amazon.com, Inc. or its affiliates.