Shaughn78
Game Owner
NWN 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. |
|
Haryon
Game Owner
NWN 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. |
|
SystemCrush
Game Owner
NWN 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. |
|
Ophidios
Game Owner
NWN 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".
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. |
|