ChatGPT can make NWN2 (and 1) scripts

https://chat.openai.com/chat

It seems to know what its doing as well. I got it to produce scripts for NPC interaction, implementing a psion class with a UI, and so on. Someone with better scripting knowledge than me will be able to make better use of it.

1 Like

Can you show/explain how you deal with it ?

1 Like

Ask it, for example -

I need to make mods for NWN2. It uses NWscript. Help me make a script that grants a +5 bonus to attack rolls to an NPC

It will give an answer with explanations, and a script, like this -

void main()
{
object oNPC = OBJECT_SELF;
int nCurrentAttackBonus = GetAttackBonus(oNPC);
nCurrentAttackBonus += 5;
SetAttackBonus(oNPC, nCurrentAttackBonus);
}

The more you know about scripting, the more useful it is. It can also teach you to script. My advice is just to sign up and starting using it. You can ask it anything, not just about code.

1 Like

Apparently it doesn’t know about indenting your code though… :sunglasses:

TR

1 Like

Hehe. True.

I found this quite interesting. Would have been really helpful a few years ago for me. I don’t know if I need it now though, but maybe I should try it out.

Maybe this could be helpful for @Imtherealthing ?

EDIT: Just tried it out by creating an account. I don’t understand this at all. I understand the concept but it’s really unclear how to use this. I would need a tutorial for this.

Have a read of this.

https://www.hitc.com/en-gb/2022/12/06/how-to-use-chatgpt-to-code-build-a-website-and-write-social-media-posts/

2 Likes

Apparently it can also give you step by step instructions for making 3D models

TR

2 Likes

This was actually really simple once I knew what to do. I tried with this:

Me: I need to make mods for NWN2. It uses NWscript. Help me make a script that gives the player character an item with the tag bigclub.

ChatGPT: Sure! Here is a sample script that you can use to give the player character an item with the tag “bigclub” in Neverwinter Nights 2:

// This script gives the player character an item with the tag "bigclub"

void main()
{
    // Create the item
    object oBigClub = CreateObject(OBJECT_TYPE_ITEM, "bigclub", GetLocation(OBJECT_SELF));
    
    // Give the item to the player character
    AssignCommand(GetFirstPC(), ActionGiveItem(oBigClub, GetFirstPC()));
}

This time it indented the code.

EDIT: Others, and also now I, have confirmed that ChatGPT doesn’t actually know how to code NWScript. It knows some of the language, but it makes so many mistakes (by for instance using functions that do not exist) that it is very unreliable and should probably not be used for that. At least not at the moment.

2 Likes