Script to change ID of existing in-game actor? Possible?

Post » Mon Jun 18, 2012 5:28 pm

I want a constant (could be several different things depending on what's easiest) to change the ID of an in-game creature/actor that the player has already come into contact with.

In other words, player meets ActorEncX . After 24 hrs (or after buying an item, etc) ActorEncX becomes ActorEncY.


A very simple example would be that after 24 hours of dog ownership, the dog actor ID is replaced by a different dog actor ID identical in every way except retextured to have a collar.


Is this even possible? If so, can someone get me started on this? I'm a total script noob.
User avatar
Sabrina Steige
 
Posts: 3396
Joined: Mon Aug 20, 2007 9:51 pm

Post » Mon Jun 18, 2012 4:12 pm

bump
User avatar
Louise
 
Posts: 3407
Joined: Wed Nov 01, 2006 1:06 pm

Post » Mon Jun 18, 2012 11:37 am

I do not think this is possible. I wish to do something similar in my mod I'm making, but I could not figure out a way to make it happen. You can "emulate" the experience, but it won't be as perfect as you want. (Or at least in my case it isn't.)

However, from the brief example you gave, I have a feeling you do not need to do this at all. If you give more details some alternatives could possibly be provided.
User avatar
Phillip Brunyee
 
Posts: 3510
Joined: Tue Jul 31, 2007 7:43 pm

Post » Mon Jun 18, 2012 8:49 am

Okay, here are the specifics.


I'm almost done with a Wild Horses of Skyrim mod.

I've retextured 8 different horse versions and they are scattered around Skyrim and act like wild animals until caught. Once caught they change in behavior to player-owned horses.

All of that ^ is already done.


However, there are seperate character IDs for horses without saddles and horses with. My wild horses, as you would expect, have no saddles. What I would like is to have something (either the purchase of a saddle at an existing stable or a certain period of time passing) cause the horse to gain a saddle.

It's not stictly neccessary, and the mod works as-is, but I think it would be much neater.

Any ideas???
User avatar
Shianne Donato
 
Posts: 3422
Joined: Sat Aug 11, 2007 5:55 am

Post » Mon Jun 18, 2012 11:04 am

There may be separate IDs in the CK for saddled/unsaddled horses, but in the meshes, there is a separate mesh for horse saddles. So you should be able to equip the saddle to your horse, rather than change the entire horse in-game.
meshes\actors\horse\character assets\saddle.nif

For example, if you look at the Shadowmere mesh, you'll see it has no saddle.
meshes\actors\horse\character assets\shadowmere.nif
User avatar
Bambi
 
Posts: 3380
Joined: Tue Jan 30, 2007 1:20 pm

Post » Mon Jun 18, 2012 8:17 pm

Maybe put the NPC you buy the saddle from inside an interior. That way you can just spawn a new horse at the location of the old one, then disable the old one.
User avatar
ladyflames
 
Posts: 3355
Joined: Sat Nov 25, 2006 9:45 am

Post » Mon Jun 18, 2012 6:40 pm

Maybe put the NPC you buy the saddle from inside an interior. That way you can just spawn a new horse at the location of the old one, then disable the old one.

That won't really work, the horses are wild and located in wilderness areas. Additionally, you have to chase them to get em.


There may be separate IDs in the CK for saddled/unsaddled horses, but in the meshes, there is a separate mesh for horse saddles. So you should be able to equip the saddle to your horse, rather than change the entire horse in-game.
meshes\actors\horse\character assets\saddle.nif

For example, if you look at the Shadowmere mesh, you'll see it has no saddle.
meshes\actors\horse\character assets\shadowmere.nif


I knew about the different (additional rather) meshes for the saddles, but I'm not sure how to achieve what you're describing.

Obviously, I guess the first step would be to make a unique item with only that saddle mesh.

But how to equip it?
User avatar
KIng James
 
Posts: 3499
Joined: Wed Sep 26, 2007 2:54 pm

Post » Mon Jun 18, 2012 7:19 am

Ok so how exactly do the saddles work? If I'm understanding this correctly, you wish to find a wild horse, tame it, and then equip a saddle to the horse--but make sure that the saddled horse looks the exact same as the wild one with a saddle added.

If I'm gathering that correctly, then this is what you would do.

Have two "Actors" for each horse. One for the unsaddled version and one for the saddled. You'd adjust the models appropriately and then name them something like:
GreenHorse
GreenHorseWithSaddle
RedHorse
RedHorseWithSaddle

Then, once the player attempts to attach the saddle to the horse, you perform an if statement to check the "actors" base object ID.
Something along the lines of:
If SaddleTarget == GreenHorse	ObjectReference NewHorse = SaddleTarget.PlaceAtMe(GreenHorseWithSaddle, 1)	NewHorse.RunCodeToMakeItOwnedByThePlayerElseIf SaddleTarget == RedHorse	ObjectReference NewHorse = SaddleTarget.PlaceAtMe(GreenHorseWithSaddle, 1)	NewHorse.RunCodeToMakeItOwnedByThePlayerElse	Error MessageEndIfSaddleTarget.Disable()

This would create a new horse of the appropriate type at the feet of the saddle target, and then disable the saddle target. You can probably make it look smoother with setpos commands but I haven't really messed with those yet so I can't confidently say that that would work.
User avatar
Damien Mulvenna
 
Posts: 3498
Joined: Wed Jun 27, 2007 3:33 pm

Post » Mon Jun 18, 2012 5:53 am

Instead of replacing the Horse, why not simply add the saddle (its an Armor item) to the horse's inventory, and force the horse to equip it?

http://www.creationkit.com/ObjectReference.AddItem_%28Papyrus%29
http://www.creationkit.com/EquipItem_-_Actor

Edit: :ninja:
User avatar
Trish
 
Posts: 3332
Joined: Fri Feb 23, 2007 9:00 am

Post » Mon Jun 18, 2012 8:47 am

I knew about the different (additional rather) meshes for the saddles, but I'm not sure how to achieve what you're describing.

Obviously, I guess the first step would be to make a unique item with only that saddle mesh.

But how to equip it?

myhorse.additem HorseSaddle 1
myhorse.equipitem horseSaddle

There are 3 different saddles under Items > Armor

ninja'd by Poha!
User avatar
Cesar Gomez
 
Posts: 3344
Joined: Thu Aug 02, 2007 11:06 am

Post » Mon Jun 18, 2012 12:14 pm

Instead of replacing the Horse, why not simply add the saddle (its an Armor item) to the horse's inventory, and force the horse to equip it?

http://www.creationkit.com/ObjectReference.AddItem_%28Papyrus%29
http://www.creationkit.com/EquipItem_-_Actor

Edit: :ninja:
Much simpler than what I was sayin if you actually have it set up as an item. <.<
User avatar
Elizabeth Lysons
 
Posts: 3474
Joined: Fri Feb 02, 2007 7:16 am

Post » Mon Jun 18, 2012 5:41 pm

Thanks for the help guys, but I'm still missing the biggest piece of the puzzle.

I know there are individual inventory item saddle armors, and "Outfits" that automatically include them.

I have no trouble adding a saddle to my horses in the CK.

But problems begin there. I cannot add the item in-game with the consol command you gave. Of course, these aren't player"owned" horses. So, I also clicked the horse in the console and used the specific code with consol commands and they don't work.

But even if they had, that still falls short of what I actually want to do.

What a need is a way (script?) that adds the saddle to inventory and equips it automatically after buying a saddle from a merchant or something like that.

What I'm thinking is that the following would work, but I don't know how to do all of it:

1) Give armor HorseSaddle a world model, inventory icon, and mark playable
2) Create merchant NPCs to sell item
3) Add script to make inventory of all horses accessible. (no clue how to do this)
4) Add a script to HorseSaddle armor that makes it auto-equip. (no clue how to do this.)


Maybe I'm missing something, because the last few posts read like you guys think the problem is solved.......so maybe I'm overlooking something very simple.

As it stands now, I can add the HorseSaddle armor to the horse only in the CK but can't place it by itself anywhere (other than on the horse due to no existing world model) or give it to the animal in game by consol command.

Thanks.
User avatar
Erin S
 
Posts: 3416
Joined: Sat Jul 29, 2006 2:06 pm

Post » Mon Jun 18, 2012 1:53 pm

If you are doing it through the console, you need to use the FormID, not the editor ID.
So for the regular horse saddle, you'd use 60797 instead of HorseSaddle.
User avatar
clelia vega
 
Posts: 3433
Joined: Wed Mar 21, 2007 6:04 pm


Return to V - Skyrim