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.)

A newbie scripting question

Discussion in 'Neverwinter Nights (Classic)' started by Gusnam, May 9, 2003.

  1. Gusnam Gems: 1/31
    Latest gem: Turquoise


    Joined:
    Nov 28, 2000
    Messages:
    7
    Likes Received:
    0
    [​IMG] I'm having a newbie scripting problem which I can't get solved no matter what I try. The thing I want to happen is this: When I kill a certain creature, a local variable on another creature shall be set to 2, which should give me more options in conversation.

    This is what happens when I kill the goblin (I added it to his on death script):

    ActionSpeakString("You were supposed to die! You were all supposed to die!");
    SetLocalInt(GetObjectByTag("HARICK"), "HARICK_SPOKEN", 2);

    ...and this is the script for "text appears when" for Harick:

    int StartingConditional()
    {

    // Inspect local variables
    if(GetLocalInt(OBJECT_SELF, "HARICK_SPOKEN") == 2)
    return TRUE;

    return FALSE;
    }

    Harick's (he's a very nice ranger btw) tag is HARICK, so that's not the problem. I'm sure this problem is very basic but still I haven't found a solution in any tutorial, so any help is welcomed.
     
  2. Blackthorne TA

    Blackthorne TA Master in his Own Mind Staff Member ★ SPS Account Holder Adored Veteran Pillars of Eternity SP Immortalizer (for helping immortalize Sorcerer's Place in the game!) New Server Contributor [2012] (for helping Sorcerer's Place lease a new, more powerful server!) Torment: Tides of Numenera SP Immortalizer (for helping immortalize Sorcerer's Place in the game!)

    Joined:
    Oct 19, 2000
    Messages:
    10,407
    Media:
    40
    Likes Received:
    231
    Gender:
    Male
    You haven't said what your problem is; which part of the above doesn't do what you want?

    The first thing I'd do is make sure that GetObjectByTag("HARICK") in the goblin's script returns something other than OBJECT_INVALID.
     
  3. Zorac Gems: 11/31
    Latest gem: Bloodstone


    Joined:
    Nov 6, 2000
    Messages:
    412
    Likes Received:
    0
    .. and of course add debug texts that prints variable contents for example.

    And you don't have to attach it to your ranger. You can attach the variable to the module itself if you think that is easier. You are certain that the ranger is spawned at the time?
     
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.