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.
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.
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.
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)?
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)
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);
// 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 ***** //
//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
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.