How to make a copy of a player?

Post » Tue Sep 15, 2009 2:08 am

O.k. so I am working on a mod and I need to have a copy of the player spawn and attack when the player enters a room. How can I do this?
User avatar
Terry
 
Posts: 3368
Joined: Mon Jul 09, 2007 1:21 am

Post » Mon Sep 14, 2009 10:39 pm

O.k. so I am working on a mod and I need to have a copy of the player spawn and attack when the player enters a room. How can I do this?


I think something like this should work.

begin spawnPlayerAttackshort Doneif ( Done == 1 )	returnendifif ( Done == 0 )	if ( GetPCCell, "Cell Name" )		PlaceAtPC, player, 1, 256, 0		;the numbers are amount, distance, and direction		StartCombat player		set Done to 1	endifendifEnd

User avatar
Ana Torrecilla Cabeza
 
Posts: 3427
Joined: Wed Jun 28, 2006 6:15 pm

Post » Tue Sep 15, 2009 4:08 am

There are a couple of external programs that use save files to copy meshes (head, hair, body parts, etc.) in specific folder. This folder is used for creating an NPC PC clone. Check L&L mod, Yacoby’s MWSE scripts, and “PC mesh extractor” by Jack Pot (this program does not copy clothes/armor/items). MWSE scripts are, probably, the most suitable for you, but I have only briefly tested them, search Fliggerty mods (I am not an expert in MWSE). As far as I remember now Yacoby’s MWSE scripts are not using save files (not sure).
User avatar
YO MAma
 
Posts: 3321
Joined: Thu Dec 21, 2006 8:24 am

Post » Tue Sep 15, 2009 3:27 am

I think something like this should work.

That's not going to work.
I think you'll need to use MWSE along with an external program that searches your save file.

edit: doh, ninjad by A1x2e3l
User avatar
Jade MacSpade
 
Posts: 3432
Joined: Thu Jul 20, 2006 9:53 pm

Post » Mon Sep 14, 2009 1:50 pm

That's not going to work.
I think you'll need to use MWSE along with an external program that searches your save file.

edit: doh, ninjad by A1x2e3l

I don't think so. It was done in the illuminated order and that doesn't require an external program.
User avatar
Hazel Sian ogden
 
Posts: 3425
Joined: Tue Jul 04, 2006 7:10 am

Post » Mon Sep 14, 2009 10:12 pm

Never mind I finally figured it out. Thanks, for y'alls help though! If you were wondering I think it is a simple place player at pc command attached to a hidden activator.
User avatar
Spaceman
 
Posts: 3429
Joined: Wed May 23, 2007 10:09 am

Post » Tue Sep 15, 2009 5:06 am

That’s very interesting! These scripts create basically a second instance of PC third person (NPC with ID “player”). But how to address this clone in more complex scripts where ID is required? E.g. let this clone to dance for original PC. Maybe MW will deal only with the clone ignoring PC.

:)
User avatar
Chris Guerin
 
Posts: 3395
Joined: Thu May 10, 2007 2:44 pm

Post » Mon Sep 14, 2009 7:26 pm

Be careful, adding a player clone using PlaceAtPC "player" can cause a lot of trouble later in the game. Illuminated Order is rather notorious for that, too, IIRC.

It's actually a lot safer to use MWSE and PCMesh or another pc mesh cloner. ;)
User avatar
Lisa Robb
 
Posts: 3542
Joined: Mon Nov 27, 2006 9:13 pm

Post » Mon Sep 14, 2009 7:45 pm

Be careful, adding a player clone using PlaceAtPC "player" can cause a lot of trouble later in the game. Illuminated Order is rather notorious for that, too, IIRC.

It's actually a lot safer to use MWSE and PCMesh or another pc mesh cloner. ;)

Like what? You have to understand, I really have next to no talent with scripting and MWSE just goes way over my head.
User avatar
Calum Campbell
 
Posts: 3574
Joined: Tue Jul 10, 2007 7:55 am

Post » Mon Sep 14, 2009 2:58 pm

Yacoby's PCMesh maker comes with instructions on how to make a clone of the player.
User avatar
Rachel Cafferty
 
Posts: 3442
Joined: Thu Jun 22, 2006 1:48 am

Post » Mon Sep 14, 2009 2:58 pm

You can use PlaceAtPC "player" or, in some cases, PlaceAtPC "PlayerSaveGame" (although that doesn't like to compile without some tweaks). Something you can generally rely on, if you cleanup properly, is the copy of the player will have the second possible extended ID (player00000001, in most cases), so as long as you create and delete a templated object with that ID, you should be able to script-target the clone.
I don't remember all the details, but there was a discussion about this some time ago and IIRC, someone got a working mirror using these methods. Just be careful cleaning up, make sure you delete any copies of player or PlayerSaveGame before the game is saved (the PlayerSaveGame object is manufactured in the engine, so having duplicates could really screw things up).
User avatar
Amysaurusrex
 
Posts: 3432
Joined: Wed Aug 09, 2006 2:45 pm

Post » Mon Sep 14, 2009 9:19 pm

It would be very nice if MW scripting gurus could clarify that (with some examples) in add-ons to MWSfD or MW scripting libraries.

:)
User avatar
Ally Chimienti
 
Posts: 3409
Joined: Fri Jan 19, 2007 6:53 am

Post » Tue Sep 15, 2009 3:14 am

I don't remember all the details, but there was a discussion about this some time ago and IIRC, someone got a working mirror using these methods. Just be careful cleaning up, make sure you delete any copies of player or PlayerSaveGame before the game is saved (the PlayerSaveGame object is manufactured in the engine, so having duplicates could really screw things up).

I can't find the thread using the forum search (which admittedly svcks) - do you remember who started it, or anything? I'd like to read it. IIRC that kind of thing crashed on game load for me but some people said it worked for them, so IDK if it's a good idea really.

@A1x2e3l:
Sorry, what was it you wanted clarified?
User avatar
phillip crookes
 
Posts: 3420
Joined: Wed Jun 27, 2007 1:39 pm

Post » Mon Sep 14, 2009 5:38 pm

Yes, I would like to know how to create PC clones with this approach: PlaceAtPC "player"/PlaceAtPC "PlayerSaveGame". What are “some tweaks” for saving/compiling such scripts?
Under “cleanup properly” I understand deleting “any copies of player or PlayerSaveGame before the game is saved”. How to script that correctly? Track when a player is going to save.
How to address a PC clone? “player”? But what will be then a “real” player? Or this clone will be “player00000001”?
For a not scripting specialist Peachykeen’s post is intriguing but not that clear, sorry. Some simple working example scripts would be great.

As far as I understand Wild Bama Boy’s script:
“PlaceAtPC, player, 1, 256, 0” – creates a clone
“StartCombat player” – instructs this clone to attack the real player

Could that be written like that: “player00000001->StartCombat player” ?

How to attach custom animations to this clone? It is obviously not present in the esp/TESCS.

:)
User avatar
Judy Lynch
 
Posts: 3504
Joined: Fri Oct 20, 2006 8:31 am

Post » Mon Sep 14, 2009 7:04 pm

The fact that you couldn't add a set of animations to the player clone was why I wrote PCMesh or whatever I called it. Fligg wanted it for a project.
User avatar
Pants
 
Posts: 3440
Joined: Tue Jun 27, 2006 4:34 am

Post » Mon Sep 14, 2009 4:26 pm

Yes, I would like to know how to create PC clones with this approach: PlaceAtPC "player"/PlaceAtPC "PlayerSaveGame". What are “some tweaks” for saving/compiling such scripts?
Under “cleanup properly” I understand deleting “any copies of player or PlayerSaveGame before the game is saved”. How to script that correctly? Track when a player is going to save.
How to address a PC clone? “player”? But what will be then a “real” player? Or this clone will be “player00000001”?
For a not scripting specialist Peachykeen’s post is intriguing but not that clear, sorry. Some simple working example scripts would be great.

As far as I understand Wild Bama Boy’s script:
“PlaceAtPC, player, 1, 256, 0” – creates a clone
“StartCombat player” – instructs this clone to attack the real player

Could that be written like that: “player00000001->StartCombat player” ?

How to attach custom animations to this clone? It is obviously not present in the esp/TESCS.

:)

I can answer a couple of those. The clone has all the numbers after it and if I understand correctly the real player is not actually called "player", but is reffered to as the saved game that is loaded. Also, the problem with player0000001->startcombat player by itself is that the clone has not spawned, because no place at pc function was used. Once again my scripting knowledge is rather small, but I think that's right.
User avatar
RUby DIaz
 
Posts: 3383
Joined: Wed Nov 29, 2006 8:18 am

Post » Mon Sep 14, 2009 7:37 pm

I can't find the thread using the forum search (which admittedly svcks) - do you remember who started it, or anything? I'd like to read it. IIRC that kind of thing crashed on game load for me but some people said it worked for them, so IDK if it's a good idea really.

I looked briefly yesterday, but it was well over a year ago (maybe 2 or more), so I think it got pruned. I'll try Googling again later.


Yes, I would like to know how to create PC clones with this approach: PlaceAtPC "player"/PlaceAtPC "PlayerSaveGame". What are “some tweaks” for saving/compiling such scripts?

For a script to compile, the object you refer to (eg "player"->doSomething) has to exist. So, for you to use script commands on "PlayerSaveGame" or player00000001 (or 2), they would have to exist. So, make a dummy object with that ID, compile the script, then delete the dummy. The compiled script will now refer to an invalid ID, unless you make it valid by creating that ingame. I think it works, but it's been a while since I tried.

Under “cleanup properly” I understand deleting “any copies of player or PlayerSaveGame before the game is saved”. How to script that correctly? Track when a player is going to save.

You would have to prevent the PC from saving while the clone was active. for example, make a "mirror" cell. Set CharGenState to 1 in it, then when they leave, delete the copy and set it back to -1. Something along those lines should work for this.
How to address a PC clone? “player”? But what will be then a “real” player? Or this clone will be “player00000001”?

The "real" player will still be "player", the clone would have the numbers added on.

I can answer a couple of those. The clone has all the numbers after it and if I understand correctly the real player is not actually called "player", but is reffered to as the saved game that is loaded. Also, the problem with player0000001->startcombat player by itself is that the clone has not spawned, because no place at pc function was used. Once again my scripting knowledge is rather small, but I think that's right.

The player can be accessed by using "player" in-game. The actual model, though, if you click it, is PlayerSaveGame (or was last I checked). I think it's a special NPC, hard-coded to respond to commands.

It's been a long time since this came up, so I don't remember all the details... The difference between the player and the saved game is important. I think the saved copy has the player's inventory, but I don't remember. Forcing them not to save is important to avoid breaking the game. Other than that, I don't remember much.
User avatar
LuBiE LoU
 
Posts: 3391
Joined: Sun Jun 18, 2006 4:43 pm

Post » Tue Sep 15, 2009 6:11 am

Wait, the illuminated order uses the mirror thing you were talking about and it still has some bugs. Are those related to the copy or just something else?
User avatar
Kelsey Hall
 
Posts: 3355
Joined: Sat Dec 16, 2006 8:10 pm

Post » Tue Sep 15, 2009 12:44 am

Naja, because this clone (PlaceAtPC "PlayerSaveGame") is a temporary dynamic actor it should be used carefully and only in certain cases. This is definitely not a generic solution like PCMesh.

Thank you for clarifications.

:)
User avatar
Laura Mclean
 
Posts: 3471
Joined: Mon Oct 30, 2006 12:15 pm


Return to III - Morrowind