Server Totals
Wilderness - (2)
Mikona - (1)
Le'Or - (1)
Elysia - (1)
Ferrell - (0)
M'Chek - (0)
Deglos - (0)
Visimontium - (0)
Underdark - (0)
Total players: 5
Gallery

Links Menu

My shadow

Moderators: Nighthawk4, Dungeon Masters

My shadow

PostAuthor: Papainhell » Mon Jun 20, 2005 5:22 pm

Wanted effect: PC walks into a room and confronts themselves.

This is beyond my limited scripting skills, can ya give me a hand?
Image
Playing as:
Master Odel Helmsplitter
Odel Helmsplitter- Hammer Fist Stylist, monk of The Order of The Dragon.
User avatar
Papainhell
Sage
 
Posts: 2141
Joined: Wed Oct 01, 2003 1:09 am
Location: Kodiak, Alaska (for now)
Timezone: Time?

Re: My shadow

PostAuthor: fyrmin » Mon Jun 20, 2005 6:01 pm

Papainhell wrote:Wanted effect: PC walks into a room and confronts themselves.

This is beyond my limited scripting skills, can ya give me a hand?


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 helpful
Kumar: How were Katie Holmes' tits?
Goldstein: You know the Holocaust?
Kumar: Yeah?
Goldstein: Picture the opposite of that!
Kumar: Nice!
User avatar
fyrmin
Scholar
 
Posts: 1311
Joined: Thu Mar 13, 2003 2:16 am
Location: The loneliest rice paddy (GMT +9)

PostAuthor: Jonezie » Mon Jun 20, 2005 11:55 pm

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:

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);
    }
}

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.
User avatar
Jonezie
Team Member; Retired with Honors
 
Posts: 3906
Joined: Wed Jun 09, 2004 7:05 am
Location: Melbourne (GMT +10)


Return to NWN Scripting

Who is online

Registered users: Bing [Bot], Google [Bot], Sunscream, Tel