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 (Nov. 06, 05)

Discussion in 'Game/SP News & Comments' started by chevalier, Nov 8, 2005.

  1. chevalier

    chevalier Knight of Everfull Chalice ★ SPS Account Holder Veteran

    Joined:
    Dec 14, 2002
    Messages:
    16,815
    Media:
    11
    Likes Received:
    58
    Gender:
    Male
    Here are today's Neverwinter Nights forum highlights, collected by NWVault. Please take into account that these are only single parts of various threads and should not be taken out of context. Bear in mind also that the posts presented here are copied as-is, and that any bad spelling and grammar does not get corrected on our end.

    Georg Zoeller, Designer

    magic bags = lag?
    Shadguy is correct, a large number of Magic Bags can cause some level of lag, for a variety of reasons:

    1) OnAcquire fires for item a creature possesses.

    For creatures in the module it fires OnLoad, which means that module load times will grow with the number of creatures and the number if items given to creatures, which is quite logical.

    For player characters OnLoad fires OnEnter of the module, so a large number of items in player inventory can cause significant lag, depending on your OnAquire script.

    You have some options of increasing performance:

    Optimize OnAquire
    - Make sure that your OnAcquire script is coded by someone who knows what (s)he is doing. It's one of the most fired scripts in your module, so you want it as optimized as possible. You also want to cache it.

    - Make sure to break down OnAquire into Player and Non Player parts. A simple

    if (!GetIsPC(oEnter))
    return;

    at the top of your script can cut down Module Load Times, through it won't help a lot for player OnEnter,


    2) The more items a player carries, the longer save and load operations take.

    It's simple. Each item is written in the characer file gff and each additional item will grow this file. Items can have multiple item properties, which also growns the size of the file.

    There are reasons why almost every game out there limits the number of items a character can carry.
    If you don't closely control the number of items a character can carry, character file sizes can grow without limit, which will increase the time needed to save and load character files when a player joins the module.

    Your options:

    - Limit the number of bags a player can own. This can be done through OnAcquire.

    - Add weight to bags. You can modify bags used in your module to have additional weight, which can limit the number of bags people can carry.

    - Give the player a vault or stash. There are a number of well written script solutions for this. You can even force excess items in the player's inventory directly in the vault OnModuleEnter and bill them gold for the service :)

    - Limit the number of item properties you use. Create a rule that the more common an item is, the fewer item properties it should have.


    3) Certain scripts and commands need to recurse through all equipment, which takes much longer if there are dozens of bags in the player's inventory.

    Many popular scripts out there have code that recurses through all equipment or even all item properties on any equipment carried by the player. It's easy to see that this is bad when the player can carry unlimited number of items.


    Your options:

    - Optimize those scripts!

    - Don't run them directly OnClientEnter, there is already a crapload of things running at that time (ELC, IRL, etc) engine side, so if you delay it (i.e. by using a login area), you can ease the impact a character entering your module significantly.

    - see (2)


    NWN has not been written with PWs in mind, so if you are running a PW, you need to understand that scripting techniques that are perfectly fine for a single player or small party module, are not necessarily a good idea for PWs.


    Hope that helps :)

    New Spell possible?
    Short answer: Yes, it's possible, but it's a more complicated task.


    A few hints:

    - You want to use the OnItemActivated script to create the property for the item (UniquePower). An alternative would be tagbased scripting:
    Click Here

    - NPCs will not use Unique Powers on item, so you would have to write an AI extension for the monster to use that ability.

    I have a tutorial NPC on my website that shows how this is done: http://gulbsoft.de/page.php?4.2

    Script Generator version 2.2 released!
    Bump for BioWare icon ... and because it's an awesome program.

    Completely Non-Aggressive NPCs
    Deleting the OnAttacked, OnSpellCastAt and any other event scripts on the creature that invoke DetermineCombatRound will make creatures completely oblivious to hostile actions taken against them.

    Tutorial for external DB functions?
    Tutorial at NWN Lexicon
    Click Here
     
    Last edited by a moderator: Jan 3, 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.