BioWare Atari
BioWare Info BioWare Games Support Forums Visit the BioWare Store
Neverwinter Nights Home
Neverwinter Nights Home

NWN 1: Toolset

New Topic    Post Reply


    Add this To My Topics

   Go To Bottom

Author Enemy attacks, but then talks
Veridious
Game Owner
Profile: VeridiousNWN
NWN: SoU
NWN: HotU
SW: KotOR PC
NWN 2


Joined: 27 Sep 2004
From: Cambridge, Ontario
Posted: Thursday, 05 October 2006 04:30AM
If I wanted to make an Ettin that attacks the character, but make it so that he fights until he is "Badly Wounded" and then starts a conversation, how would I do that?

I know how to do conversations, but I'm not sure how to make it so that he turns "friendly" or "neutral" when he reaches Badly Wounded.

See, one of the conversation options for the player will be "Okay, get out of here, go home", after the ettin pleads to the character to let him go. At that point, I want the ettin to run towards the exit, and then disappear when he gets out of the player's line of sight.
  Profile: Veridious   Send Message To: Veridious
kevinodie
Game Owner
Profile: kevinodieNWN
NWN: SoU
NWN: HotU


Joined: 21 Jul 2003
From: Bathos
Posted: Thursday, 05 October 2006 04:44AM
Uncomment (or add) this line to your ettin's OnSpawn script:

NWScript:

View Post/Code in separate window



Modify this script and add it to the ettin's OnUserDefined event:

NWScript:

View Post/Code in separate window



--kevinodie
_________________
NWN Custom Content
KORE rpg

Edited By kevinodie on 10/05/06 04:45

  Profile: kevinodie   Send Message To: kevinodie
Veridious
Game Owner
Profile: VeridiousNWN
NWN: SoU
NWN: HotU
SW: KotOR PC
NWN 2


Joined: 27 Sep 2004
From: Cambridge, Ontario
Posted: Thursday, 05 October 2006 04:57AM
Quote: Posted 10/05/06 04:31 (GMT) by kevinodie

Uncomment (or add) this line to your ettin's OnSpawn script:

NWScript:

View Post/Code in separate window

I'm new to scripting. Do I go to Creature Properties > Scripts and then press ... button to the right of OnSpawn? Then what?

Quote: Modify this script and add it to the ettin's OnUserDefined event:

NWScript:

View Post/Code in separate window



--kevinodie
I don't understand...
  Profile: Veridious   Send Message To: Veridious
kevinodie
Game Owner
Profile: kevinodieNWN
NWN: SoU
NWN: HotU


Joined: 21 Jul 2003
From: Bathos
Posted: Thursday, 05 October 2006 05:26AM
Okay, since you're new to scripting I'm going to assume you don't already have any custom events firing for this ettin.

I need to know a couple of things before I post scripts for you:

1. How many Hit Points does the ettin have?
2. How much damage should the ettin sustain before it surrenders? How many HP should it have when it gives up?
3. What is the name of the ettin's dialogue file when it surrenders? And do you have some variable that needs to be set to get to the proper node in the dialogue file?

--kevinodie
_________________
NWN Custom Content
KORE rpg
  Profile: kevinodie   Send Message To: kevinodie
Veridious
Game Owner
Profile: VeridiousNWN
NWN: SoU
NWN: HotU
SW: KotOR PC
NWN 2


Joined: 27 Sep 2004
From: Cambridge, Ontario
Posted: Thursday, 05 October 2006 05:36AM
Quote: 1. How many Hit Points does the ettin have?
243
Quote: 2. How much damage should the ettin sustain before it surrenders?
143
Quote: How many HP should it have when it gives up?
100
Quote: 3. What is the name of the ettin's dialogue file when it surrenders? And do you have some variable that needs to be set to get to the proper node in the dialogue file?

--kevinodie
I haven't written the conversation yet, and I don't know of any variables.
  Profile: Veridious   Send Message To: Veridious
kevinodie
Game Owner
Profile: kevinodieNWN
NWN: SoU
NWN: HotU


Joined: 21 Jul 2003
From: Bathos
Posted: Thursday, 05 October 2006 06:07AM
Okay, here are a couple of files and a complete step by step for you.

First, the Ettin's OnSpawn script.
Save this script into your Ettin's OnSpawn slot by doing the following:
1. From the toolset, select Tools -> Script Editor
2. Paste the following script into the editor
NWScript:

View Post/Code in separate window


3. Save it as ettin_onspawn
Now the Userdefined Script
4. Paste the following script into the editor
NWScript:

View Post/Code in separate window


5. Save it as ettin_userdef
And finally the Text Appears When conversation script
6. Paste the following script into the editor
NWScript:

View Post/Code in separate window


7. Save it as taw_surrender
8. Close the script editor
9. Open the creature properties
10. Slect the scripts tab
11. Select the ... button next to the OnSpawn script event
12. Find ettin_onspawn and select open
13. Select the ... button next to the UserDefined script event
14. Find ettin_userdef and select open

Voila, done with the creature properties.

Now, when you get to it, in the conversation editor, after you create the text for the surrender dialogue, simple select taw_surrender for the Text Appears When ... script and you've got a surrendering ettin on your hands.

Hopefully that helps.

--kevinodie
_________________
NWN Custom Content
KORE rpg

Edited By kevinodie on 10/05/06 06:09

  Profile: kevinodie   Send Message To: kevinodie
Veridious
Game Owner
Profile: VeridiousNWN
NWN: SoU
NWN: HotU
SW: KotOR PC
NWN 2


Joined: 27 Sep 2004
From: Cambridge, Ontario
Posted: Thursday, 05 October 2006 07:09AM
When I first open the Script Editor in Tools, there's already some text in the window, I deleted that and then added what you said. After I pasted one of the scripts on, I saved it as what you told me to save it as, and then I exited the script window thing. I then reopened it and did the next script.

Did I do it right?
  Profile: Veridious   Send Message To: Veridious
Veridious
Game Owner
Profile: VeridiousNWN
NWN: SoU
NWN: HotU
SW: KotOR PC
NWN 2


Joined: 27 Sep 2004
From: Cambridge, Ontario
Posted: Thursday, 05 October 2006 09:46AM
Also, when I went in game to test the conversation, if my player chose the option "Don't stop now, fight me!" he is supposed to continue the fight with the Ettin. He does. The problem is that the Ettin is invulnverable. He cannot be damaged, all that shows are some gold-coloured 0's, to show that no damage is being done.

Also, if the player chooses to let the Ettin go, how do I make the Ettin run to the exit?
  Profile: Veridious   Send Message To: Veridious
kevinodie
Game Owner
Profile: kevinodieNWN
NWN: SoU
NWN: HotU


Joined: 21 Jul 2003
From: Bathos
Posted: Thursday, 05 October 2006 02:30PM
Quote: Posted 10/05/06 07:26 (GMT) by Veridious

When I first open the Script Editor in Tools, there's already some text in the window, I deleted that and then added what you said. After I pasted one of the scripts on, I saved it as what you told me to save it as, and then I exited the script window thing. I then reopened it and did the next script.

Did I do it right?

Yes.

Quote: Posted 10/05/06 09:10 (GMT) by Veridious

Also, when I went in game to test the conversation, if my player chose the option "Don't stop now, fight me!" he is supposed to continue the fight with the Ettin. He does. The problem is that the Ettin is invulnverable. He cannot be damaged, all that shows are some gold-coloured 0's, to show that no damage is being done.

That's my error. In the surrender portion of the userdefined script I set the creature to plot. Remove this line from ettin_userdef
NWScript:

View Post/Code in separate window



Quote: 
Also, if the player chooses to let the Ettin go, how do I make the Ettin run to the exit?

1. Place a waypoint at the location where the ettin should go to leave the map. This waypoint should be fairly close to the ettin, and not behind a lot of placeables so the creature can easily find the exit.
2. Change the tag of the waypoint to NW_EXIT (note the capitol letters)
3. Paste this script into the script editor
NWScript:

View Post/Code in separate window


4. Save it as at_escape
5. In the conversation editor, add this script as the Actions Taken for that conversation node.

Now we can either kill the ettin or let him go.

--kevinodie
_________________
NWN Custom Content
KORE rpg
  Profile: kevinodie   Send Message To: kevinodie
Veridious
Game Owner
Profile: VeridiousNWN
NWN: SoU
NWN: HotU
SW: KotOR PC
NWN 2


Joined: 27 Sep 2004
From: Cambridge, Ontario
Posted: Thursday, 05 October 2006 02:40PM
Okay the problem is that in the same conversation node where the ettin thanks the player for letting him go, the ettin gives the player his spear. I have the "give reward" thing set to give the spear, so it already occupies the script for that node. Is it possible to add the at_escape script too?
  Profile: Veridious   Send Message To: Veridious
kevinodie
Game Owner
Profile: kevinodieNWN
NWN: SoU
NWN: HotU


Joined: 21 Jul 2003
From: Bathos
Posted: Thursday, 05 October 2006 02:46PM
Quote: Posted 10/05/06 14:57 (GMT) by Veridious

Okay the problem is that in the same conversation node where the ettin thanks the player for letting him go, the ettin gives the player his spear. I have the "give reward" thing set to give the spear, so it already occupies the script for that node. Is it possible to add the at_escape script too?

Post your script and I'll show you how to combine the 2.

--kevinodie
_________________
NWN Custom Content
KORE rpg
  Profile: kevinodie   Send Message To: kevinodie
Veridious
Game Owner
Profile: VeridiousNWN
NWN: SoU
NWN: HotU
SW: KotOR PC
NWN 2


Joined: 27 Sep 2004
From: Cambridge, Ontario
Posted: Thursday, 05 October 2006 02:51PM
NWScript:

View Post/Code in separate window

  Profile: Veridious   Send Message To: Veridious
kevinodie
Game Owner
Profile: kevinodieNWN
NWN: SoU
NWN: HotU


Joined: 21 Jul 2003
From: Bathos
Posted: Thursday, 05 October 2006 02:59PM
NWScript:

View Post/Code in separate window



I had to change how you were giving the player XP since we would have needed to include both nw_i0_plot as well as nw_i0_tool. However, the compiler won't let us use both since they each contain an identical function.

Luckily for you there is more than one way to reward XP.

Simply replace the current script with this one and it should do the trick.

--kevinodie
_________________
NWN Custom Content
KORE rpg
  Profile: kevinodie   Send Message To: kevinodie
Veridious
Game Owner
Profile: VeridiousNWN
NWN: SoU
NWN: HotU
SW: KotOR PC
NWN 2


Joined: 27 Sep 2004
From: Cambridge, Ontario
Posted: Thursday, 05 October 2006 03:08PM
Okay I got that done, I'll test it in game now.

What do I do with the waypoint that I put down?
  Profile: Veridious   Send Message To: Veridious
kevinodie
Game Owner
Profile: kevinodieNWN
NWN: SoU
NWN: HotU


Joined: 21 Jul 2003
From: Bathos
Posted: Thursday, 05 October 2006 03:28PM
Quote: Posted 10/05/06 15:33 (GMT) by Veridious

Okay I got that done, I'll test it in game now.

What do I do with the waypoint that I put down?

Right click on it -> Select Properties -> Change the tag to NW_EXIT -> Select Ok

--kevinodie
_________________
NWN Custom Content
KORE rpg
  Profile: kevinodie   Send Message To: kevinodie

New Topic    Post Reply

What do these icons mean?
Where can I learn how to use the forums?

Jump To:

Search Forums | Forums FAQ | Forum Archives

 

 

Dragon Age: Origins Preorder
Neverwinter Nights 2 Forums
Hide/Show

English
Deutsch
Français
Español
Italiano

Hide/Show

View Latest Screenshots 

View Latest Screenshots
Hide/Show

Multiplayer Games at Neverwinter Connections

Today
Schedule a Game...



Current time is: (set time)
Tue, 09 February 2010 07:58PM

Hide/Show

Buy Premium Modules

Top NWN: HotU Modules:
1. Good vs Evil III
2. More...

Top NWN: SoU Modules:
1. Good vs Evil III
2. More...

Top CEP Modules:
1. The Lord of Terror The Diablo Campa...
2. More...

Top Modules - NWVault:
1. Hall of Fame
2. More...

Total Modules: 4423

Hide/Show

5,993,796 BioWare Users:
  73 Logged In
  3 Hidden
  471 Guests

1265 Playing Online
  100% NWN
  102% NWN: SoU
  102% NWN: HotU

426 Registered Guilds

9,000,866 posts in forums

Newest Forum Topics:
1. Script control of encounters? (O... (NWN2: Builders - NWN2 Scripting)

2. Do i need to play BG 1? (Baldur's Gate II: SoA and ToB General Discussion)

3. Memorized Spells ui modification (NWN2: Custom Content)

4. My Dm's Can't log in, DM Client ... (NWN 1: Server Admin)

5. My Dm's Can't log in, DM Client ... (NWN 1: Server Admin)