Duplicating the player.

Post » Tue May 17, 2011 12:27 am

A while back (like 6 months ago) I remember someone talking to me about duplicating the player, but I cant find the thread, so I will ask again. How can this easily be done? I need to duplicate the player, and then move the duplicate to an xmarkerheading, so the player can see their duplicate. Its entirely scripted, the players controls are disabled. Then after a few seconds the duplicate will be delete and removed and never seen again. Can anyone help me with this?
User avatar
Kevin Jay
 
Posts: 3431
Joined: Sun Apr 29, 2007 4:29 am

Post » Tue May 17, 2011 4:38 am

There was some discussion a while back about using MatchRace and MatchFaceGen but the FaceGen part doesn't work like expected. I was looking really hard at this myself in hopes of creating an identical twin to the plaer as an NPC.

Ohh.. I found http://www.gamesas.com/index.php?/topic/1104902-player-question/page__p__16174268__hl__facegen__fromsearch__1&#entry16174268
User avatar
Luis Reyma
 
Posts: 3361
Joined: Fri Nov 02, 2007 11:10 am

Post » Tue May 17, 2011 5:24 am

It's simple and the great mystery behind my 'see you ...' ;).

Set DummyRef to SomeXmarkerRef.placeatme 7 1

there is your newborn player as god made him/her. The hard work is to get the timing, positions and surroundings correct.
User avatar
Thomas LEON
 
Posts: 3420
Joined: Mon Nov 26, 2007 8:01 am

Post » Tue May 17, 2011 6:24 am

It's simple and the great mystery behind my 'see you ...' ;).

Set DummyRef to SomeXmarkerRef.placeatme 7 1

there is your newborn player as god made him/her. The hard work is to get the timing, positions and surroundings correct.


Umm, can you explain that line of code a little more? So i would just say XmarkerRef.PlaceAtMe 7 1, and it would place a copy of the player there? Also, how would I then disable and delete the copy of the player? A little elaboration is all thats needed. :)
User avatar
Melanie
 
Posts: 3448
Joined: Tue Dec 26, 2006 4:54 pm

Post » Tue May 17, 2011 2:55 am

Umm, can you explain that line of code a little more? So i would just say XmarkerRef.PlaceAtMe 7 1, and it would place a copy of the player there? Also, how would I then disable and delete the copy of the player? A little elaboration is all thats needed. :)


Yes, that should place a copy of the player at the xmarker reference. Also, the "set DummyRef to ..." part means that the reference variable "DummyRef" will store a reference to the item placed, in this case, the player copy.

I'm guessing that you should be able to http://geck.gamesas.com/index.php/Disable and http://geck.gamesas.com/index.php/MarkForDelete the copy just like anything else. :shrug:
User avatar
Sarah Evason
 
Posts: 3507
Joined: Mon Nov 13, 2006 10:47 pm

Post » Tue May 17, 2011 3:18 pm

Umm, can you explain that line of code a little more? So i would just say XmarkerRef.PlaceAtMe 7 1, and it would place a copy of the player there? Also, how would I then disable and delete the copy of the player? A little elaboration is all thats needed. :)


That's the reason why I made the 'set to' to get the reference of dummy in a variable.

To create the copy (should be done in Game Mode as always with Placeatme):

Ref DummyRefSet DummyRef to SomeXmarkerRef.placeatme 7 1


and with a simple:

DummyRef.DisableDummyRef.MarkforDelete


I can delete the copy.

(edit) got ninja'd by PoHa! ;)
User avatar
Heather Stewart
 
Posts: 3525
Joined: Thu Aug 10, 2006 11:04 pm

Post » Tue May 17, 2011 5:31 am

I was looking really hard at this myself in hopes of creating an identical twin to the plaer as an NPC.

Ohh.. I found http://www.gamesas.com/index.php?/topic/1104902-player-question/page__p__16174268__hl__facegen__fromsearch__1&#entry16174268

That link will do it then... My player twin with the follower menu, scripting, and packages is still a happy little part of my local save game. I have it parked in megaton house for the moment, but whenever I feel like it, I go and grab the twin to accompany me on a quest just like any other follower.
The only issue I've found is with dialog, and the lack of it, but also the missing voiced attacks and comments. Might be able to change that though by selecting a different voice for the player npc.
User avatar
The Time Car
 
Posts: 3435
Joined: Sat Oct 27, 2007 7:13 pm

Post » Tue May 17, 2011 10:33 am

Doh. Of course... I should have seen that. Man, I am loosing it these past few days. I don't know why. :( I have made so many stupid little mistakes... I sure hope this ends soon, its putting a large dent in my workflow. :/

Thanks guys. I will use that and post back if something goes wrong. :P
User avatar
Jerry Cox
 
Posts: 3409
Joined: Wed Oct 10, 2007 1:21 pm

Post » Tue May 17, 2011 9:02 am

Ok I tried that line exactly, and the copy looks like me, but is naked and without a weapon. Is this supposed to happen?
User avatar
victoria johnstone
 
Posts: 3424
Joined: Sat Oct 14, 2006 9:56 am

Post » Tue May 17, 2011 4:37 am

Yes. The player object has no default inventory so their inventory should be empty to start with.

Cipscis
User avatar
Doniesha World
 
Posts: 3437
Joined: Sun Jan 07, 2007 5:12 pm

Post » Tue May 17, 2011 9:18 am

Ok I tried that line exactly, and the copy looks like me, but is naked and without a weapon. Is this supposed to happen?


That's why I wrote 'there is your newborn player as god made him/her' ;) in my previous post.
User avatar
Claudia Cook
 
Posts: 3450
Joined: Mon Oct 30, 2006 10:22 am

Post » Tue May 17, 2011 10:01 am

Not meaning to hijack this tread, but I'd like to know a little more about this:

That link will do it then... My player twin with the follower menu, scripting, and packages is still a happy little part of my local save game. I have it parked in megaton house for the moment, but whenever I feel like it, I go and grab the twin to accompany me on a quest just like any other follower.
The only issue I've found is with dialog, and the lack of it, but also the missing voiced attacks and comments. Might be able to change that though by selecting a different voice for the player npc.


I'm assuming you used a script to place a clone in the game and to give it equipment and a behavior package. If you start a new game and choose a completley different looking character would the clone come out looking right? I'm just thinking out loud, but could this be adapted to have a PC Clone appear in the game after completing a quest or something? I was actually looking at a way of creating an "Evil Twin" to the PC a while back but never knew about this method.
User avatar
Katey Meyer
 
Posts: 3464
Joined: Sat Dec 30, 2006 10:14 pm

Post » Tue May 17, 2011 2:08 am

Ok. I am slowly loosing my ability to mod... this is freaky.

Another somewhat dumb question. In order to fully recreate the player as they are right there, I make the duplicate, then to equip all the items the player has on, can I just have this in my script?

Ref PlayerEquipmentRef;Then put this within the proper block of the scriptSet PlayerEquipmentRef to Player.GetEquippedObject 0DummyRef.AddItem PlayerEquipmentRef 1DummyRef.EquipItem PlayerEquipmentRef 1Set PlayerEquipmentRef to Player.GetEquippedObject 1DummyRef.AddItem PlayerEquipmentRef 1DummyRef.EquipItem PlayerEquipmentRef 1Set PlayerEquipmentRef to Player.GetEquippedObject 2DummyRef.AddItem PlayerEquipmentRef 1DummyRef.EquipItem PlayerEquipmentRef 1Set PlayerEquipmentRef to Player.GetEquippedObject 3DummyRef.AddItem PlayerEquipmentRef 1DummyRef.EquipItem PlayerEquipmentRef 1


Etc. Now my main question here is, is it ok to set a reference, use it to add the item, then change the reference all within one frame like 20 times? (Once for each slot of armor, 1 through 19) Or should I make it happen ony once per frame? That way the clone has all 19 slots equipped with the exact same armor/object and visually is identical to the player.
User avatar
Marcus Jordan
 
Posts: 3474
Joined: Fri Jun 29, 2007 1:16 am

Post » Tue May 17, 2011 5:55 am

Etc. Now my main question here is, is it ok to set a reference, use it to add the item, then change the reference all within one frame like 20 times? (Once for each slot of armor, 1 through 19) Or should I make it happen ony once per frame? That way the clone has all 19 slots equipped with the exact same armor/object and visually is identical to the player.


I haven't done it yet. For sleeping there is no need. I avoid using FOSE in the moment for the sleeping mod. So simply try it out.
User avatar
Antony Holdsworth
 
Posts: 3387
Joined: Tue May 29, 2007 4:50 am

Post » Tue May 17, 2011 12:02 am

I'm assuming you used a script to place a clone in the game and to give it equipment and a behavior package. If you start a new game and choose a completley different looking character would the clone come out looking right? I'm just thinking out loud, but could this be adapted to have a PC Clone appear in the game after completing a quest or something? I was actually looking at a way of creating an "Evil Twin" to the PC a while back but never knew about this method.

The way I did it was using a quest and/or scripted object to call a 'Set TwinREF to Player.PlaceAtMe 7 1', then some TwinREF.AddItems to give them a predefined outfit and gear, and finally a set of TwinREF.ModAV commands to bump up their skills and stats. Any scripts go right on the player base object in the geck, isolating the OnActivate with IsActionRef Player == 1. AI packages also go right on the base player object, with a condition of GetIsReference PlayerRef != 1. I used a quest to hold variables that are updated from the clones scripted ShowMessage menu, and the AI packages use a GetQuestVariable condition to read that and change behaviors. Set the quest item and no low level processing checkboxes on the player base object so your clone doesn't get removed at cell cleanup, and so it doesn't forget what it should be doing if you're not around. You can set the AI Data right on the geck page too as changing those won't affect the player. Any inventory you add on the npc inventory tab will always be there at the start of a new game.

Yeah, as long as the clone is created dynamically with PlaceAtMe, it will always have the players current FaceGen settings at the time it was created. You could very easily have a player clone show up after a quest, or upon getting a perk, or pretty much anytime. A clone is just a regular old NPC that was created a little differently, that's all. It still does all the same stuff NPCs do. The only precaution is keeping any base object changes from interfering with the player, which honestly hasn't been anything close to as difficult as I imagined it would be.
User avatar
Chloe Botham
 
Posts: 3537
Joined: Wed Aug 30, 2006 12:11 am

Post » Tue May 17, 2011 4:48 am

Ok I tried using those 3 lines 19 times, once for each item slot, and it all appears to be working nicely. Thanks everyone for helping me, and tolerating my stupidity. :P I dont know whats going on with me but I am having the biggest trouble with little simple things I already know how to do now for some reason. >.>
User avatar
Jesus Sanchez
 
Posts: 3455
Joined: Sun Oct 21, 2007 11:15 am

Post » Tue May 17, 2011 3:32 pm

Just passing along some info... I did find a bug with using a player clone as an NPC. They go invisible when they sit on furniture. You can't activate them when like that, but they're still there and you can see them on your radar, they're just not rendered.
NPCs will still greet and try to talk to them. Once they stand up they'll reappear. It seems completely predictable so not too worried about it, though it did throw me for a loop first few times i saw it.
User avatar
Damned_Queen
 
Posts: 3425
Joined: Fri Apr 20, 2007 5:18 pm

Post » Tue May 17, 2011 2:31 am

Just passing along some info... I did find a bug with using a player clone as an NPC. They go invisible when they sit on furniture. You can't activate them when like that, but they're still there and you can see them on your radar, they're just not rendered.
NPCs will still greet and try to talk to them. Once they stand up they'll reappear. It seems completely predictable so not too worried about it, though it did throw me for a loop first few times i saw it.


Wow, good to know. But, Wow, that makes no sense whatsoever. I guess if I can get the rest of an evil twin mod put together I'll be sure not to put them in an area with chairs.
User avatar
Matt Fletcher
 
Posts: 3355
Joined: Mon Sep 24, 2007 3:48 am

Post » Tue May 17, 2011 11:06 am

@Bonedog
Strange... This bug never happened to my sleeping 'Dummy' if he missed the bed and thought the chair nearby would be more comfortable. While testing my bed finding scripts I got a lot of this situations and he always stayed visible.
The reason could be that sitting is a special animation for the player (one of the rare you can see) and the clone is still managed as player by the engine. But if this is the case something has gone wrong in the cloning process. It shouldn't be a 'real' player reference.
User avatar
Stephy Beck
 
Posts: 3492
Joined: Mon Apr 16, 2007 12:33 pm

Post » Tue May 17, 2011 11:34 am

I suspect they could be dialogued, and thus scripted to a point, via this same quest using GetIsID player, I have not tryed this though.

To those who have Shivering Isles for Oblivion, there is a rather spectacular script in which a player clone is made which you fight as part of the Symbols of Office Quest.

Be careful about coding these "player clones".
They were the cause of the the infamous Bruma Statue Crash which made Bruma unvisitable, Crash to Desktop, after closing the Great Gate at Bruma.
User avatar
JeSsy ArEllano
 
Posts: 3369
Joined: Fri Oct 20, 2006 10:51 am

Post » Mon May 16, 2011 11:15 pm

Be careful about coding these "player clones".
They were the cause of the the infamous Bruma Statue Crash which made Bruma unvisitable, Crash to Desktop, after closing the Great Gate at Bruma.


Is that why they ditched the CreateFullActorCopy command? 'Cause I just used that in Oblivion for testing purposes (I was alone, and needed an actor other than my character to use commands on). The placeatme command in Oblivion works exactly like the one in Fallout 3 (the character is dressed in the starting clothes rather than naked, but that's because there ARE starting clothes), but the CreateFullActorCopy command will duplicate the actor as they are at the moment, items and all. I think this is what's used for the Bruma statue.
User avatar
Roberta Obrien
 
Posts: 3499
Joined: Tue Oct 23, 2007 1:43 pm

Post » Tue May 17, 2011 11:07 am

@Bonedog
Strange... This bug never happened to my sleeping 'Dummy' if he missed the bed and thought the chair nearby would be more comfortable. While testing my bed finding scripts I got a lot of this situations and he always stayed visible.
The reason could be that sitting is a special animation for the player (one of the rare you can see) and the clone is still managed as player by the engine. But if this is the case something has gone wrong in the cloning process. It shouldn't be a 'real' player reference.

It shows the "turn around and sit down" part, as well as the "lean forward and stand up" part, just not the actual sitting part between the two. If it is a playgroup sequence, then it would only be the middle idle anim that's causing the problem. I'm sure the clone ceased to be linked to the player the second it was copied from the base object and spawned in game, as it's definately it's own seperate entity now with a unique FFxxxxxx reference ID. I'm nearing the end of my current save game and will be starting a new game.. so I'll have to do some more testing. For all I know at this point, it could be another one of those magical GOTY glitches I've grown so fond of.
User avatar
Ash
 
Posts: 3392
Joined: Tue Jun 13, 2006 8:59 am

Post » Tue May 17, 2011 9:08 am

Truth be told, I think the copy in Bruma was falling through the "platform" which was an activator.
THe other part was making sure one had the ref to the CreateFullACtorCOpy stored in a persistant ref variable.
MartinREF had this variable for the bruma statue, which made nuking it easy. With out this ref, nuking it would be impossible when unable to click on it in the console.
Modded an SI script to remove, disable and markfordelete, the CreateFullActorCopy after the fight in Symbols of office Quest as well, to keep that cell accessable, though I had never had probs with that particular duplicate.
User avatar
Joey Bel
 
Posts: 3487
Joined: Sun Jan 07, 2007 9:44 am


Return to Fallout 3