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

adding script to the conversation NWN2

Discussion in 'Neverwinter Nights 2' started by Dice, Apr 5, 2008.

  1. Dice

    Dice ★ SPS Account Holder Adored Veteran

    Joined:
    Jun 23, 2002
    Messages:
    5,125
    Media:
    24
    Likes Received:
    149
    Gender:
    Female
    I am very new to module building with the NWN2 toolset and I need a little help to get started. I haven't started an actual module yet because I want to learn some of the basics. I've downloaded a few toolset files and they have helped me in some areas but I'm still having trouble with something very basic.

    I've created a couple of areas and transitioned them. In the interior area I've created an NPC and made him a conversation. In one of the ending nodes of the conversation I've added script under the action tab. The script is supposed to make the NPC attack the PC when that line is chosen. Whenever I go and test it out nothing happens. What am I missing or doing wrong?
     
  2. Rotku

    Rotku I believe I can fly 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!)

    Joined:
    Apr 13, 2003
    Messages:
    3,105
    Likes Received:
    35
    Would you be able to post the script here, Dragonfly?

    It should look something like this:
    Code:
    void main()
    {
    object oPC = GetPCSpeaker();
    
    AssignCommand( OBJECT_SELF, ActionAttack(oPC));
    }
    You're welcome to just copy that across, however if you do want to post your script, I'm more than happy to take a look at it and walk you through if there are any problems.
     
  3. Dice

    Dice ★ SPS Account Holder Adored Veteran

    Joined:
    Jun 23, 2002
    Messages:
    5,125
    Media:
    24
    Likes Received:
    149
    Gender:
    Female
    This is the script I used. I got the script from a script generator that I downloaded from a site called Neverwinter Nights 2 Toolset.

    #include "nw_i0_generic"
    void main()
    {

    object oPC = GetPCSpeaker();

    object oTarget;
    oTarget = OBJECT_SELF;

    SetIsTemporaryEnemy(oPC, oTarget);

    ActionAttack(oPC);

    DetermineCombatRound(oPC);

    oTarget = GetObjectByTag("n_khralver");

    SetIsTemporaryEnemy(oPC, oTarget);

    AssignCommand(oTarget, ActionAttack(oPC));

    AssignCommand(oTarget, DetermineCombatRound(oPC));

    }

    As you can probably guess, the tag of the character was n_khralver. I just used a default character that was in the toolset for the sake of experimentation.

    I tried to copy paste your script but it still isn't working. I must be missing something in the conversation editor.
     
  4. Rotku

    Rotku I believe I can fly 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!)

    Joined:
    Apr 13, 2003
    Messages:
    3,105
    Likes Received:
    35
    If it's something to do with the conversation, I'm afraid I can't help. Haven't got access to the NWN2 toolset, sorry.
     
  5. Dice

    Dice ★ SPS Account Holder Adored Veteran

    Joined:
    Jun 23, 2002
    Messages:
    5,125
    Media:
    24
    Likes Received:
    149
    Gender:
    Female
    Ok, well thanks anyway for trying to help Rotku. I appreciate it. I guess I will go try in the official NWN2 forums but I do prefer posting here.
     
    Last edited: Apr 8, 2008
  6. Dice

    Dice ★ SPS Account Holder Adored Veteran

    Joined:
    Jun 23, 2002
    Messages:
    5,125
    Media:
    24
    Likes Received:
    149
    Gender:
    Female
    Well I got it to work! I was using the script on the wrong node. I had placed the script on something my character said instead of putting it on node of the other character :duh: The person in the other forum also suggested that I just use the script that is already in the editor instead of the script generator for basic stuff like that.

    Well now that I'm starting to figure out how this works then I might actually be able to create something interesting.
     
  7. Rotku

    Rotku I believe I can fly 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!)

    Joined:
    Apr 13, 2003
    Messages:
    3,105
    Likes Received:
    35
    Gah! Sorry, I should have clicked on to that! Serves me right for not reading properly. Good to see you've got it fixed though :)

    And yeah, from what I remember, NWN2 came with the ability to have a lot of things done without writting the scripts (like them been in the editor already like you said...), but I never quite got that part worked out before my computer committed suicide on me. I prefered just to keep it simple and use Lilac's script generator (or what ever it's called) and the Lexicon.
     
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.