Neverwinter Vault

Expand AllContract All -Site -My Profile -Features

Neverwinter Nights 2

-NWN2 Files -NWN2 Game Info -NWN2 Resources -NWN2 Community

Neverwinter Nights

-NWN Files -NWN Game Info -NWN Resources -NWN Community

Vault Network
RPG Vault
VN Boards
IGN Vault
Vault Wiki
· Age of Conan
· Anarchy Online
· Asheron's Call
· Dark Age of Camelot
· City of Heroes
· D&D
· EVE Online
· EverQuest
· EverQuest 2
· Final Fantasy
· Guild Wars
· Lineage 2
· Lord of the Rings Online
· Middle Earth
· Neverwinter Nights
· Pirates of the Burning Sea
· Rise of the Argonauts
· Star Wars Galaxies
· Tabula Rasa
· The Matrix Online
· The Witcher
· Titan Quest
· Two Worlds
· Vanguard
· Warhammer
· World of Warcraft

Planet Network
Planet Hub

IGN
Games
Cheats
Entertainment

The Web   The Site  



NWN SCRIPTS

- Jump to comments -
Title  PC clone system 1.1
Author  LetoII
Submitted / Updated  04-11-2004 / 11-22-2006
Category  Scripting routines
Expansions  HOTU-1.62
Format  Code Only
Type  Type - Other
Includes  None
Description
This system allows creating a PC clone that will act as a normal creature. You can assign it a set of scripts and even change them when you want to by scripting. One bioware script is replaced: nw_g0conversat.nss. The default.nss script is fired when any event occurs, the system try to find out which event is currently happening and execute the script associated to it.
The system is not perfect though: for most events, the creature will react the first time if the same event keeps happening (for example the same door always blocking the creature). This is not a problem for death, userdefined, heartbeat and spell cast at events. However, it should happen rarely.
The system can also be used to dynamically change the script of any creature or to react to PC events.

Files

NameTypeSizeDownloads
playerClone_1.1.1.zipplayerClone_1.1.1.zip
Submitted: 04-11-2004 / Last Updated: 06-25-2004
zip8.63Kb1355
--
SCORE OUT OF 10
9.67
3 votes
View Stats
Cast Your Vote!

PORTFOLIO
Add this entry to your portfolio so you can track it
Manage your existing portfolios or create a new one.
SCREENS





You Must Be Logged In to Participate.
Comments (23):

Posted by Hugie at 2005-11-23 06:42:11    Voted 10.00 on 11/23/05
Perfect! Exactly what I needed. I'll be using this in "Tale of a Mage, Chapter 2 - The Ceremony of Souls" ; I'll definitely give you credit in the readme.

Thanks for this!

Cheers,

Hugie

_________________________
[My (Important) Submissions] [My Website: Link]

Posted by Hugie at 2005-11-23 06:42:01    Voted 10.00 on 11/23/05
Perfect! Exactly what I needed. I'll be using this in "Tale of a Mage, Chapter 2 - The Ceremony of Souls" ; I'll definitely give you credit in the readme.

Thanks for this!

Cheers,

Hugie

_________________________
[My (Important) Submissions] [My Website: Link]

Posted by LetoII at 2005-06-01 09:59:10    Voted 9.00 on 09/10/04
Serra-Avatar:
Send me a mail or contact me on the bioware forum (my user name is the same as here) I will help you further.

Posted by Serra-Avatar at 2005-05-30 14:05:21    
Oh and "your" script gets triggered every time I step on the area, the bioware "deathmirrow" script got only triggered once (Im using a generic trigger). Is there anyway to trigger it once per PC (considering that several PCs will be playing that module)?

Posted by Serra-Avatar at 2005-05-30 13:50:54    
Ok thx, already read all the posts before posting myself and I didnt understand much, now I just copied the script you posted for commche (except the ondeath and respawn stuff) and it seems to work.
One last question plz? Where can I turn it off that the clone remains contains all the copied items of the PC?

Posted by LetoII at 2005-05-30 04:22:18    Voted 9.00 on 09/10/04
Serra-Avatar have a look at what has been previously posted here, I already gave an example on how to create a clone from an on enter event. You may also go to the nwn scripting forum to get tutorials to learn scripting (nwn.bioware.com)

Posted by Serra-Avatar at 2005-05-28 13:51:32    
Hi I just started to use the Toolset and dont understand much about scripting *g*. What I try to do is a module like the hall of mirrows in the HotU campaign, I even copied the script from the "deathmirrow" and put it into a onenter-trigger but the clone is kinda stupidly acting, most of the time it doesnt (re-)act at all. Someone recommended me your clonesystem and I imported it to my testmodule. Even with the Readme I couldnt find out which o the many scripts creates the clones and I put most of them into a onenter-trigger but nothing happened.
-So what is the easiest way to create a hostile clone with your system with an on enter trigger?
-are all the items undroppable of that clone?
-if i used more than one version of that trigger would that cause problems since there would be several clones running around with the name object clone?

Posted by JackTaylor at 2005-05-28 06:19:58    Voted 10.00 on 05/28/05
Oops, I did not understand the voting process, so here is one more comment. Hee hee
_________________________
My other sword is a +5 Holy Avenger

JFK Swimming Skinmesh Fish Link
JFK Makeshift Weapons Link

Posted by JackTaylor at 2005-05-28 06:17:20    Voted 10.00 on 05/28/05
Thanks, LetoII. I have your corpse system already. It is very nicely done! I've solved my problem using your clone system, modified slightly. Problem was in using certain scripts OnDeath, some things won't actually fire as the calling object becomes invalid after dying, or something like that. Anyway,
Thanks very much for great scripts!
JFK
_________________________
My other sword is a +5 Holy Avenger

JFK Swimming Skinmesh Fish Link
JFK Makeshift Weapons Link

Posted by LetoII at 2005-05-27 00:44:49    Voted 9.00 on 09/10/04
You should try to call SetLootable(oCorpse, TRUE) after CustomSet_respawn(oCorpse).

But once more you should have a look at my corpse system.

Posted by JackTaylor at 2005-05-26 16:24:36    Voted 10.00 on 05/28/05
Here is my OnDeath script from module properties:
#include "clone_lib"
#include "custom_set_lib"
// jfk_ondeath
// Put in OnDeath of Module
void main()
{
object oPC = GetLastPlayerDied();
object oLimbo = GetWaypointByTag("WP_LIMBO");
location lLimbo = GetLocation(oLimbo);

// PCClone trial
location lPC = GetLocation(oPC);
object oCorpse = CreatePCClone(oPC, lPC, CustomSet_DefaultSet, FALSE);
SetLootable(oCorpse, TRUE);
SetCustomSet_OnSpawn("corpse_spawn" ,oCorpse);
CustomSet_respawn(oCorpse);
effect eSlay = EffectDeath();
DelayCommand(1.0f, ApplyEffectToObject(DURATION_TYPE_INSTANT, eSlay, oCorpse, 0.0f));

// Take everything away from dead PC
object oItem2 = GetFirstItemInInventory(oPC);
while (oItem2 != OBJECT_INVALID)
{
DestroyObject(oItem2);
oItem2 = GetNextItemInInventory(oPC);
}
DestroyObject(GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oPC), 0.0);
DestroyObject(GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oPC), 0.0);
DestroyObject(GetItemInSlot(INVENTORY_SLOT_ARMS, oPC), 0.0);
DestroyObject(GetItemInSlot(INVENTORY_SLOT_CLOAK, oPC), 0.0);
DestroyObject(GetItemInSlot(INVENTORY_SLOT_NECK, oPC), 0.0);
DestroyObject(GetItemInSlot(INVENTORY_SLOT_BOOTS, oPC), 0.0);
DestroyObject(GetItemInSlot(INVENTORY_SLOT_HEAD, oPC), 0.0);
DestroyObject(GetItemInSlot(INVENTORY_SLOT_RIGHTRING, oPC), 0.0);
DestroyObject(GetItemInSlot(INVENTORY_SLOT_LEFTRING, oPC), 0.0);
DestroyObject(GetItemInSlot(INVENTORY_SLOT_BELT, oPC), 0.0);
DestroyObject(GetItemInSlot(INVENTORY_SLOT_BOLTS, oPC), 0.0);
DestroyObject(GetItemInSlot(INVENTORY_SLOT_ARROWS, oPC), 0.0);
DestroyObject(GetItemInSlot(INVENTORY_SLOT_BULLETS, oPC), 0.0);
DestroyObject(GetItemInSlot(INVENTORY_SLOT_CHEST, oPC), 0.0);
int nGold;
nGold = GetGold(oPC);
AssignCommand(oPC, TakeGoldFromCreature(nGold, oPC, TRUE));
//Send Pc to Limbo area and tell them what killed them
AssignCommand(oPC, JumpToLocation(lLimbo));
string sKiller = GetName(GetLastHostileActor(oPC));
SendMessageToPC(oPC, "Killed by " + sKiller);

//Heal PC to 2 hp and remove all effects
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectResurrection(), oPC);
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectHeal(1), oPC);
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDispelMagicAll(20), oPC);
}


And here is my OnUsed script for a lever I built to test it out:
// temp to create a clone for testing purposes
#include "clone_lib"
#include "custom_set_lib"
void main()
{
object oPC = GetLastUsedBy();
location lPC = GetLocation(oPC);
object oCorpse = CreatePCClone(oPC, lPC, CustomSet_DefaultSet, FALSE);
SetCustomSet_OnSpawn("corpse_spawn" ,oCorpse);
CustomSet_respawn(oCorpse);
SetLootable(oCorpse, TRUE);
effect eSlay = EffectDeath();
ApplyEffectToObject(DURATION_TYPE_INSTANT, eSlay, oCorpse, 0.0f);
}


Lastly, here is my script corpse_spawn:
// corpse spawn custom spawn for PC corpse system
#include "x0_i0_anims"
// #include "x0_i0_walkway" - in x0_i0_anims
#include "x0_i0_treasure"

#include "x2_inc_switches"

void main()
{


if (GetUserDefinedEventNumber() == 1006) {
// Custom code for my NPC to execute when it's damaged
}

// ***** ADD ANY SPECIAL ON-SPAWN CODE HERE ***** //

// * If Incorporeal, apply changes
// if (GetCreatureFlag(OBJECT_SELF, CREATURE_VAR_IS_INCORPOREAL) == TRUE)
// {
/* effect eConceal = EffectConcealment(50, MISS_CHANCE_TYPE_NORMAL);
eConceal = ExtraordinaryEffect(eConceal);
effect eGhost = EffectCutsceneGhost();
eGhost = ExtraordinaryEffect(eGhost);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eConceal, OBJECT_SELF);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eGhost, OBJECT_SELF);

} */

//added for PC corpse spawn lootable
SetIsDestroyable(FALSE, FALSE, TRUE);
DelayCommand(1.0, SetLootable(OBJECT_SELF, TRUE));

}

The switch creates the clone perfectly and kills it, just like I want. But the PC OnDeath creates the clone, kills it, but instead of being lootable, a dialog cursor comes up on the dead clone.
Thanks for any insight in this,
JFK
_________________________
My other sword is a +5 Holy Avenger

JFK Swimming Skinmesh Fish Link
JFK Makeshift Weapons Link

Posted by JackTaylor at 2005-05-23 18:47:04    Voted 10.00 on 05/28/05
Hello,
For some reason I can't get this to work on a PC's OnDeath. I made a switch to test this with, and everything works as I want, but I can't seem to make it work OnDeath.
Is there anything I need to know about using this in a PC OnDeath slot, to create a clone for use as a Corpse?
Thanks,
JFK
_________________________
My other sword is a +5 Holy Avenger

JFK Swimming Skinmesh Fish Link
JFK Makeshift Weapons Link

Posted by commche at 2004-11-28 15:41:00    
Thank's LetoII, awesome!!!
now I should be able to figure it all out :D
_________________________
Modules:
Shadows of Darkmoon
The Arena of Champions
Dragon's Bane
Scripts:
Random Loot Generation System v1.0
Supernatural Subrace System
PW Monk-speed balancer

Posted by LetoII at 2004-11-28 15:25:00    Voted 9.00 on 09/10/04
commche:

Here is an example, for a on enter script that will set a specific scripts for the on death event of the clone. The name of the script is on_death:

#include "clone_lib"

void main()
{
object PC = GetEnteringObject();

object clone = CreatePCClone(PC, GetLocation(PC), CustomSet_DefaultSet, FALSE);

SetCustomSet_OnDeath("on_death", clone);
CustomSet_respawn(clone);

}


Hi hope it will help you.

Posted by LetoII at 2004-11-28 15:24:00    Voted 9.00 on 09/10/04
commche:

Here is an example, for a on enter script that will set a specific scripts for the on death event of the clone. The name of the script is on_death:

#include "clone_lib"

void main()
{
object PC = GetEnteringObject();

object clone = CreatePCClone(PC, GetLocation(PC), CustomSet_DefaultSet, FALSE);

SetCustomSet_OnDeath("on_death", clone);
CustomSet_respawn(clone);

}


Hi hope it will help you.

Posted by commche at 2004-11-26 17:19:00    
Looks like a great set of scripts, but alas, I couldn't understand the readme. It was very vague and after looking at the scripts and the readme, I had to give up on trying to set custom scripts - making the clone pointless for my purpose :(

I am quite new to scripting so please excuse my ignorance. I would really appreciate it if you could tell me more simply how to assign one or all custom scripts on a clone.
I really only need to assign an OnDeath script and I want to make the clone use melee attack exclusively when the PC is attacking it, and buff (if has any) when the PC is not. Is there any way to do this?
Also, I want to assign commands to the clone, but I don't know its tag or how to identify it. How can I specify the newly created clone.
_________________________
Modules:
Shadows of Darkmoon
The Arena of Champions
Dragon's Bane
Scripts:
Random Loot Generation System v1.0
Supernatural Subrace System
PW Monk-speed balancer

Posted by LetoII at 2004-09-27 03:21:00    Voted 9.00 on 09/10/04
The problem is you can't clone the PC durring the on client leave event. You could create and hide a clone when the player enters the module. You'll have to update the clone when the PC levels up.

Posted by SlayerOfEgos ( 68.224.xxx.xxx ) at 2004-09-27 01:46:00    
This is exactly what I've been looking for! Now that I know that clonning is possible, how would you make a player that signs off the game leave a clone with AI of their character?

Posted by LetoII at 2004-09-10 02:31:54    Voted 9.00 on 09/10/04

Posted by LetoII at 2004-06-25 06:49:00    Voted 9.00 on 09/10/04
Another little bug corrected, have fun ;)

Posted by LetoII at 2004-04-14 08:09:00    Voted 9.00 on 09/10/04
I've just noticed a little bug in the function CustomSet_ClearScripts, I will soon post a corrected version, sorry :D

Posted by LetoII at 2004-04-13 16:06:00    Voted 9.00 on 09/10/04
Yes you can, the clone should be hostile by default but you may have to tell him to attack if you create it just in front of the PC for example with a ActionAttack command, then it will act as a normal creature. I didn't test it, I used the clone as a henchman and it woked just fine.

Posted by donnykrun at 2004-04-13 13:48:00    
hmm,
wonder if you can use this to create a clone of a PC to attack them like their alter ego :-)

You must be Logged In to post comments in this section.

 
Most recent posts on the MMO General Boards
Analyst: Star Wars: The Old Republic Could...Analyst: Star Wars: The Old Republic Could Sell 3M: more numbers
- last reply by Acao on Aug 15, 2011 06:15 PM
which class will your first character be
- last reply by Blisteringballs on Aug 15, 2011 05:50 PM
New Community Content!
- posted by Vault_News on Aug 15, 2011 05:00 PM
New Community Content!
- posted by Vault_News on Aug 15, 2011 04:00 PM
NWN Idea Database Update
- posted by Vault_News on Aug 15, 2011 03:46 PM
Missing Votes for NWN2 Hall of Fame
- posted by Vault_News on Aug 15, 2011 03:40 PM
Missing Votes for NWN Hall of Fame
- posted by Vault_News on Aug 15, 2011 03:39 PM
Random Questions and game altering suggest...Random Questions and game altering suggestions!!!
- last reply by ArkadyTepes on Aug 15, 2011 03:22 PM
State of the game?
- last reply by LyricOpera on Aug 15, 2011 01:37 PM
Yesterday streaming, now demanding downloa...Yesterday streaming, now demanding download :(
- last reply by Sinane-tk on Aug 15, 2011 10:23 AM
 

   


IGN Entertainment
By continuing past this page, and by your continued use of this site, you agree to be bound by and abide by the User Agreement.
Copyright 1996-2011, IGN Entertainment, Inc. | Support | Privacy Policy | User Agreement | RSS Feeds
IGN’s enterprise databases running Oracle, SQL and MySQL are professionally monitored and managed by Pythian Remote DBA.


NWN2 Hall of Fame

HOF NWN2 Scripts


View all Hall of Fame entries


Neverwinter Nights 2

TOP NWN2 Modules

NEW Modules

NEW Reviews

NEW INTL. Modules

TOP Hakpaks

TOP Gameworlds

TOP Tutorials

TOP Prefab:Areas

TOP Blueprints

TOP Plugins

TOP UI

TOP Other

TOP Visual Effects

TOP Scripts

TOP Tools

TOP Movies

TOP Models

TOP Characters





Hall of Fame

HOF NWN Modules


View all Hall of Fame entries


TOP NWN Modules

NEW NWN Modules

NEW Reviews

TOP Intl. Modules

TOP NWN Hakpaks

TOP NWN Gameworlds

TOP NWN Models

TOP NWN Portraits

TOP NWN Scripts

TOP NWN Prefabs

TOP NWN Other

TOP NWN Movies

TOP Sounds

TOP NWN Textures

TOP NWN Creatures

TOP NWN Characters