Wanted effect: PC walks into a room and confronts themselves.
This is beyond my limited scripting skills, can ya give me a hand?
My shadow
Moderator: Event DM
- Papainhell
- Sage
- Posts: 2138
- Joined: Wed Oct 01, 2003 1:09 am
- Timezone: Time?
- Location: Kodiak, Alaska (for now)
- Contact:
My shadow

Playing as:
Master Odel Helmsplitter
Odel Helmsplitter- Hammer Fist Stylist, monk of The Order of The Dragon.
- fyrmin
- Scholar
- Posts: 1311
- Joined: Thu Mar 13, 2003 2:16 am
- Location: The loneliest rice paddy (GMT +9)
- Contact:
Re: My shadow
im not a coder but if you're able to steal other peoples code there is a part in the NWN singleplayer game where you look into a mirror and your doppleganger pops out which you have to fight. maybe you can take that? sorry if this isn't helpfulPapainhell wrote:Wanted effect: PC walks into a room and confronts themselves.
This is beyond my limited scripting skills, can ya give me a hand?
Kumar: How were Katie Holmes' tits?
Goldstein: You know the Holocaust?
Kumar: Yeah?
Goldstein: Picture the opposite of that!
Kumar: Nice!
Goldstein: You know the Holocaust?
Kumar: Yeah?
Goldstein: Picture the opposite of that!
Kumar: Nice!
- Jonezie
- Team Member; Retired with Honors
- Posts: 3905
- Joined: Wed Jun 09, 2004 7:05 am
- Location: Melbourne (GMT +10)
It's not as hard as you think.
- Stick a waypoint in the room where you want the copy to appear. In this script, the tag is "CP_Copy", but you can change that to anything you like.
- Put a trigger in front of the door.
- In the Triggers OnEnter put:
That'll make one clone for each player - so you cant keep tripping the trigger and getting more and more clones. It only works for PCs.
If you wanted it to be a shadow, you could apply all sorts of VFX to the clone as well. (VFX_DUR_PROT_SHADOW_ARMOR springs to mind) You may also want to set it to hostile if you want the player to have to fight it.
One thing to note - If you kill it, all your copied inventory items will be on it's death corpse. This may not be desireable, but there's a couple of ways you can get around it if it's a problem.
- Stick a waypoint in the room where you want the copy to appear. In this script, the tag is "CP_Copy", but you can change that to anything you like.
- Put a trigger in front of the door.
- In the Triggers OnEnter put:
Code: Select all
void main()
{
object oEntering = GetEnteringObject();
object oWP = GetObjectByTag("CP_Copy");
location lSpawn = GetLocation(oWP);
int iCloned = GetLocalInt(oEntering, "Cloned");
if (!GetIsPC(oEntering) || !GetIsObjectValid(oWP) || iCloned)
return;
else
{
CopyObject(oEntering, lSpawn, OBJECT_INVALID, "Clone");
SetLocalInt(oEntering, "Cloned", TRUE);
}
}
If you wanted it to be a shadow, you could apply all sorts of VFX to the clone as well. (VFX_DUR_PROT_SHADOW_ARMOR springs to mind) You may also want to set it to hostile if you want the player to have to fight it.
One thing to note - If you kill it, all your copied inventory items will be on it's death corpse. This may not be desireable, but there's a couple of ways you can get around it if it's a problem.