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

Archives: Builders - NWN Scripting



       Go To Bottom

Author Impaled corpse w/ removable spear
Shaughn78
Game Owner
Profile: Shaughn78NWN
NWN: SoU
NWN: HotU
NWN 2
NWN 2: MotB
NWN 2: SoZ


Joined: 06 Feb 2004
Posted: Sunday, 14 August 2005 01:08AM
I am still new at scripting and my ideas are prehaps a little ahead of my skill. I am trying to make it possible for the PC to remove the spear from an impaled human corpse then adding it to thier inventory while having a "thunk" noise and replacing the the impaled corpse with just a regular corpse on the ground.

I have tried two different ways, both sort of work, but I am unable to find a function to swap the placeable items. I wanted to avoid using a waypoint to spawn in the object because I would like to have this a generic script. I want to put it into several impaled bodies and probably do the same with some arrow-filled bodies without having to modify it for each one to create the corpse on specific waypoints. The best I have been able to do is get the spear have the "thunk" then destroy the impaled corpse instead of replace it.

The two ways I have tried are:
onuse

void main()
{
PlaySound("bf_med_flesh");
ActionSpeakString("You pull the Spear from the body");
CreateItemOnObject("nw_wplss001", GetLastUsedBy(), 1);
DestroyObject(OBJECT_SELF);
}

Once I added the destroy object I ran into a bug where the sound wouldn't play. So I created a one line conversation with the object that made the noise and gave the spear as a reward. I modified the script to also again destroy the impaled corpse but I can't find a way to create or replace it with just a regular corpse. Any help that you could offer would be great. I have search through this forum and done some digging through the official game but so far have been unable to find a similar type of function.
  Profile: Shaughn78   Send Message To: Shaughn78
Haryon
Game Owner
Profile: HaryonNWN
NWN: SoU
NWN: HotU


Joined: 01 Aug 2002
From: France
Posted: Sunday, 14 August 2005 06:27AM
I'm quite new at scripting too, but I'm wondering whether you shouldn't put a delaycommand on the destroy the time the sound plays (so if your sound is 3 sec., destroy after 3 seconds). Maybe you need to give the spear with a delay too, and maybe you need to do something so that people can't activate more than once during the sound plays.

don't know.
_________________
Halkhemy - Hak building tool.
TPH - Custom tlk file to help creating categories in palettes.
  Profile: Haryon   Send Message To: Haryon
SystemCrush
Game Owner
Profile: SystemCrushNWN
SW: KotOR PC


Joined: 28 Jun 2005
Posted: Sunday, 14 August 2005 10:40AM
there is a miscitem prtait thet looks like a corpse thet way u can add the spear and the corpse to the PC's inventory so u dont need to replace the oldcorpce with a new one. and if u have the expantions the item will have a ondrop function u can fill with a create container at location of player thet container being a corpse and by default having a corpse item in it and destrio the dropped item. I dont have the expantions so i could not create that script for you maby u can ask someone who does.
And if u read this and recognise it. Sorry creators of Nordock i confess i am not the first with this idear and u hold the right to it or something.
_________________
I'm a Tank if u see me running try to keep up.
  Profile: SystemCrush   Send Message To: SystemCrush
Ophidios
Game Owner
Profile: OphidiosNWN
NWN: SoU
NWN: HotU
SW: KotOR PC
NWN 2


Joined: 14 Aug 2004
From: Facing the Abyss...
Posted: Sunday, 14 August 2005 02:58PM
Put this in the OnUsed of the corpse, and make sure it's not marked "Plot".
Code:

View Post/Code in separate window


Just as a personal suggestions, though... rather than use the Impaled Human Corpse, try going using the Speared Corpse model, that way the two models look consistent. The Impaled Human Corpse is naked, while the regular Corpse is not. Then rather than using a falling sound effect you can use something snapping, such as "as_na_branchsnp3". At any rate, the above script will do what you have asked.
_________________
Author of - Secure Persistent Chest System
Eternal Champions - An vastly unique hack-and-slash experience.
  Profile: Ophidios   Send Message To: Ophidios


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

Jump To:

Search Forums | Forums FAQ | Forum Archives

 

 

BioWare Store
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 08:44PM

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,994,287 BioWare Users:
  53 Logged In
  4 Hidden
  461 Guests

1405 Playing Online
  100% NWN
  99% NWN: SoU
  99% NWN: HotU

426 Registered Guilds

9,000,898 posts in forums

Newest Forum Topics:
1. M.O.W. Internet needed? (NWN2: General discussion forums for NWN2 (No Spoilers Allowed))

2. Script control of encounters? (O... (NWN2: Builders - NWN2 Scripting)

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

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

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