This script creates a PC Copy with a script for all events. Previous attempts to make a functional PC attempts to make use of the "dummy" script. This approach uses the Dominate Person effect on a PC copy to give the copy a set of scripts. It then makes a copy of the copy which results in a non-dominated PC copy which has the scripts assigned to dominated NPC's. These scripts are the same scripts assigned to associates.
Posted by Nostrebor at 2006-04-19 14:01:21 Voted 10.00 on 04/19/06
An unashamed vote for myself
Posted by Nostrebor at 2006-04-19 13:59:11 Voted 10.00 on 04/19/06
The second question about destroying the object on death of the copy is a bit trickier. It requires modifying the "NW_CH_AC7" onDeath script to do the following:
1) recognize that this is a PC copy that is dying.
2) delete the placeable that needs to be deleted.
To do this you need to need to create a local object on the final copy that points to the object to be deleted. NW_CH_AC7 is modified to fetch this local object and if valid destroy it if it is valid (it won't be valid on a non-copy because it won't exist).
If your not a scripter this probably won't help much. I will try and put an example together.
Posted by Nostrebor at 2006-04-19 13:49:58 Voted 10.00 on 04/19/06
DD asked about using this script in a placable. I believe you need to replace "GetEnteringObject()" with "GetLastUsedBy()"
Posted by DD at 2006-04-13 11:00:07 Voted 10.00 on 04/13/06
amazing work... absolutely ingenious
request: i need the script to work on a placeable object / when pc_copy is killed, destroys object
any help would be extremely appeciated... thanks in advance
Posted by DD at 2006-04-13 10:53:27 Voted 10.00 on 04/13/06
absolutely amazing script.. love it.
first off, i'm not a scripter, but i am a builder - pretty much a copy and paste master (don't worry, i always leave thanks to all people i borrow from)
my problem here is, i have your script, but i want it to react just a tad different and i don't have the scripting knowledge needed to change it myself
what i really need is when the Pc_copy is finally killed it destroys an object
i know how to do this otherwise with regular creatures, but this is FAR beyond my comprehension - any help would most certainly be appreciated
also, it says your script acts accordingly for all events, yet i cannot get it to work by clicking on a placeable - i've tried putting it into onused and onopened, which would seem to make the only bit of sense to me
Disregard my post. I found the answer by scouring the BIOWARE site. It seems that nw_ch_aca.nss DOES NOT EXIST!! Henchmen do not rest so it is a dead name and the script was never created. Posts on BIOWARE say to either disregard the error or create an empty script to stop the error.
I have a slightly off topic question. Where are these NW_CH_AC* scripts found? I have the Diamond Edition with only the CEP hack and no other patches installed and I can not find script NW_CH_ACA. I loaded the OC Prelude and looked at the blueprint for "Boddyknock". When I tried to edit "nw_ch_aca" listed under "OnRested" it said "Resource 'nw_ch_aca' not found, creating a new script." Could someone please explain what is wrong as I have no idea what could have nuked this script from basicly a virgin 1.66 Diamond install.
Posted by OldMansBeard at 2006-04-09 05:51:45 Voted 10.00 on 12/01/05
Just something to be aware of, an undocumented change in Patch 1.67.
In Patch 1.66 clones executed their OnSpawn scripts when created whereas in Patch 1.67 they won't. This doesn't matter for the first clone, of course, because PC's don't normally have OnSpawn scripts, but if you were relying on the second clone executing nw_ch_ac9 for any reason, you will need to force it with an ExecuteScript().
Posted by Stonepig at 2005-12-25 20:55:13 Voted 10.00 on 12/25/05
Genius.
Posted by Stonerpig ( 69.137.xxx.xxx ) at 2005-12-25 20:53:16
A truly excellent script.
Posted by Stonepig ( 69.137.xxx.xxx ) at 2005-12-25 20:42:45
Thank you for the quick response, taking time out from Christmas Dinner:)
I'll try the code and give it a run. Much appreciated.
Posted by Nostrebor at 2005-12-25 17:11:03 Voted 10.00 on 04/19/06
Ok, the comment field is to short to for the code I was trying to attached. I updated the example code instead. It now makes all of the copy's items undroppable and takes away its gold.
Posted by Nostrebor at 2005-12-25 16:58:31 Voted 10.00 on 04/19/06
Last post was truncated:
void Make_Unlootable(object copy)
{
//FloatingTextStringOnCreature(GetName(copy) + " Lootable contains nothing droppable" , GetFirstPC());
object item = GetFirstItemInInventory(copy);
while (GetIsObjectValid(item))
{
SetDroppableFlag(item, FALSE);
item = GetNextItemInInventory(copy);
}
int slot;
for (slot=INVENTORY_SLOT_HEAD; slot
Posted by Nostrebor at 2005-12-25 16:54:58 Voted 10.00 on 04/19/06
Making the copy so that it does not drop anything is annoyingly complicated. Basically you must make all items in the inventory and in equipment slots undroppable. The following code will do that:
Posted by Stonepig ( 69.137.xxx.xxx ) at 2005-12-24 20:34:35
Thanks for the great script, well beyond my scripting abilities.
One question though, how do I set the evilcopy to be unlootable and leave no inventory behind? I know I will need to change the default nw_ch_ac7 script, but what do I need to delete/add? Thanks again.
Posted by Nostrebor at 2005-12-22 08:32:05 Voted 10.00 on 04/19/06
The following lines (which are in the script) should make the PC-Copy hostile:
object hostile=GetObjectByTag("HOSTILE");
// make the copy hostile
ChangeFaction(evilcopy, hostile);
However for them to work a creature with the tag "HOSTILE" must exists somewhere in your module and it must be in a faction which is hostile to PC's.
If when you place your cursor on the PC-Copy and the copy shows up red, but it does not seem to attack, you may have to enable the copy to accept commands. To do this call:
SetCommandable(1, pc_copy);
Posted by elvishpiper42 ( 24.229.xxx.xxx ) at 2005-12-18 11:18:46
I've been looking for a script like this, thanks! I am having a problem though. I can get a copy of the PC, but they aren't hostile. I put this script in front of a doorway, so the PC walks in and their copy appears. They are suppose to attack them, but no fighting going on. Any suggestions??
Posted by Nostrebor at 2005-12-01 04:36:23 Voted 10.00 on 04/19/06
Yes, the local variable is a good idea. I figured I would just show the technology to get to unique scripts for each event and other people would fill in the blanke (i.e. I left them as exercises for the student).
Posted by OldMansBeard at 2005-12-01 01:40:04 Voted 10.00 on 12/01/05
Posted by OldMansBeard at 2005-12-01 01:36:03 Voted 10.00 on 12/01/05
That's brilliant. I use PC clones to make custom henchmen in the OHS Henchman system and use a complicated default.nss script to give them event-driven behaviour. But your trick of clone-dominate-clone to give them scripts is a masterstroke.
Just a thought - if we set a local variable on the first clone "IsClone", say, we could use that in a switch inside customised versions of the NW_CH_AC* scripts that would trap out to special behaviour whilst leaving the behaviour of ordinary NPCs that use those scripts unchanged.