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 Nighs Forum News

Discussion in 'Game/SP News & Comments' started by NewsPro, Dec 28, 2002.

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


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

    Don Moar, Tools Programmer

    Climbing Into Pits: We've I've done something similar in one of my modules. To achieve the effect, I use a trigger at the edge of some pit terrain in the Forest tileset. When the player crosses the trigger, a conversation is started in which the a description of the situation is presented and one of the player options is to "Climb down into the pit."

    Scripting: Typically, oPC is a variable of type object but how it's used depends upon the event to which the script is assigned. If the script were assigned to the OnEnter event of a trigger, for example you'd probably have something like this:

    object oPC;
    oPC = GetEnteringObject();


    Mark Brockington, Lead Research Scientist

    STACK_UNDERFLOW Error: The inner script generates the STACK_UNDERFLOW, and passes the error to the outer script. The error is inside the script called from the ExecuteScript command.

    break statements inside while loops can be problematic, especially since you've defined a variable inside the while loop before the break.

    If you can, move the variable declaration out of the while loop, or do not use the break command. Are the problems with "break" statements and while loops being fixed in a future patch? Yes.

    Do I know which patch? No. I hope that this helps.

    On appearance, it may look like I've made an error. However, you've changed the code inside the while loop inside the faction_good_hb and faction_evil_hb scripts! Run your old faction_good_hb and faction_evil_hb scripts from the first post, and you'll see the problem still persists. This was the example from your first post (faction_good_hb).

    while ( ... )
    {
    ...
    int nAlreadyChecked = GetLocalInt( ... )
    if (nAlreadyChecked == TRUE)
    {
    break;
    }
    ...
    }

    This causes an error, because the integer (represented by nAlreadyChecked) will be left behind on the stack if the break is run. This was the example from your second post.

    while ( ... )
    {
    ...
    if (GetLocalInt( ... ) == TRUE)
    {
    break;
    }
    ...
    }

    This works just fine, because you haven't created a new variable to store the result of the GetLocalInt check. Hope this helps!
     
    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.