Jump to content

Create a messagemenu or a holotape that would change Companion's outit


ouibonjour

Recommended Posts

I tried different things, but I can't get it to work .

For the Holotape, I was able to create the holotape, the terminal menu and its submenu with 8 different entries for 8 different outfits, I was able to make a recipe, to go in game and craft the holotape and open it and browse into it, but that's all. I don't know what to put in the papyrus script to get my companion (piper fin this ex) to equip specific outfits or pieces of clothes already in her inventory.

I tried putting console commands there, like 2f1f.equipitem 000DEDEB 1 and things like that and it does not work. (even if I get it to work via the console in game) I understand I need a different coding that the one of the console, but can't seem to find the information for it.

On the other hand, I created a MessageMenu with different menu buttons that I linked to a bottle of milk activator (didn't know how to activate it by pressing a key while aiming at Piper), and I'm able to get the menu to appear.

 

However, I don't know what to include in the If iButton == 0 , ElseIf iButton == 1 , etc , to get her to equip specific outfits. Tried to put console commands there too, still does not work.

How should I do ? I'm very new at this.

If possible, I'd prefer the MessageMenu option. I'd like that when I aim at Piper, I would see X)TALK B)OUTFIT (then B opens MessageMenu, and menu buttons change her outfit).

So far I linked my menu to an activable milk bottle and the script I've put in it is :

Scriptname Jessy_PO_Script1 extends ObjectReference Const


message property messagebox_999_PO auto   

Event OnActivate(ObjectReference akActionRef)
   
	Int iButton = messagebox_999_PO.Show() ; Shows the menu.
		
If iButton == 0   
			 2f1f.additem bf000d8d 1
 			 2f1f.equipitem bf000d8d 1
		
ElseIf iButton == 1
			 2f1f.unequipall
  2f1f.equipitem fe012841 1
  2f1f.equipitem fe012840 1 

		  elseif button ==2
  2f1f.unequipall
  2f1f.equipitem 65000f41 1
  2f1f.equipitem 65000fa3 1


  elseif button ==3
  2f1f.unequipall 
  2f1f.equipitem 6c000800 1
  2f1f.equipitem 6c000803 1
  

  elseif button ==4
  2f1f.unequipall
  2f1f.equipitem 0303a556 1

elseif button ==5
  2f1f.unequipall
  2f1f.equipitem 39a66 1
  2f1f.equipitem a81b0 1
 

  elseif button ==6
  2f1f.unequipall
  2f1f.equipitem fe012841 1
  2f1f.equipitem fe012840 1
  

 elseif button ==7
  2f1f.unequipall
  2f1f.equipitem a81b0 1
  2f1f.equipitem 66001071 1
  
 elseif button ==8
endif
 endEvent




Message Property MessageBox_999_PO Auto Const
{Message that will appear}



(and I get the menu to show but I know I should change the console commands for something else) Please help!

Link to comment
Share on other sites

Companion Outfit Function(s) exist in AFT (Amazing Follower Tweaks) by various methods/contexts.

You can use that, or decompile the script to see how it was acheived.

It is pretty sophisticated but you appear to be rather capable.

Similarly there is Outfit Switcher but that is for the player only.

Link to comment
Share on other sites

I already use Outfit Switcher, and I loved it. Decompiled it, but it was way too complicated for me to even know where to start.

For some reason, I ended up uninstalling AFT because there was something I didn't like.

I would still like to be able to do it in a MessageMenu with buttons, and activate it with a key while aiming at Piper.

I already found the right syntax to get her to equipitems, but now I'm getting a different error message while I save my script :

(Edit :  please see next comment : No more Error Message while saving the script, menu appears, but does not affect Piper at all)


			
		
Link to comment
Share on other sites

EDITED AGAIN : Please jump to next comment. Again. Now my mod is 90% working.

 

Update : I was able to compile the entire script without any error message. I also linked all properties to their respective items (so Armor_BOS_Knight_Underarmor value was edited to the scrolldown menu where I selected Armor_BOS_Knight_Underarmor, and I did so for all properties).

 

As for Piper, when I tried to edit her property, for some reason the dropdown menu was looking for her in Sanct. Ext. and was not finding her. Changed Sanctuary to (Any) and found refPiper in Diamond City. Linked it to her property as well.

 

Reloaded the script again, saved it, compiled it. Saved ESP. Exported Archives (Main.ba2 and Textures.ba2), extracted both b2a's in a folder and move the ESP in the same folder, added to RAR and dragged into Vortex.

For some reason, there were some conflicts with brown eyes and hazel eyes from Beautiful Eyes, and Cube something from Enhanced Blood (that was weird, as I only played with messages, outfits, piper, Sanctuary Ext (where I put a milk bottle). Anyway, I gave priority to Beautiful Eyes and Enhanced Bloods for those 3 files and ran the game.

I'm in Sanctuary, just besides my milk bottle. I activate it, I see my menu with all the buttons. But none of them do anything.

I tried to "prid piper + moveto player" to make sure that Piper was the real one : it was. Same RefID as usual 2f1f. Tried recycling her. She disappeared (probably to DC). Prid + moveto player = She was back but naked, without all of the oufits that were previously in her inventory, except one leather armor or something.

Anyways, here's my script. Any idea what could be the issue ?


 

 

(EDITED)

 

Some of the items are from other mods, but they were loaded in Creation Kit, and are still loaded in my load order.

First Button = 0 = Naked = Give her a ring that unequips everything.

 

Button 1 to 5 = Different outfits. For each, I added the ring to unequip previous outfit, then wait(menu) 0.5 seconds, then equip the outfit.

But none of these do anything. Also, I have a mod that is "more detailed console" or something, that lets me see which mod last modified the PRID item/actor, and when I click on Piper, it shows her RefID, says she's from Fallout4.esm, and last modification was from Loving_Piper.esp

Anything I do with my menu and my milk bottle does nothing and does not even put my mods name in the last modifying mod. So it seems like my script is not even reaching her at all.

I'll try to remove the mod Loving Piper and maybe put my mod Last in Vortex order or something. Otherwise, I don't know what I'm missing.

Link to comment
Share on other sites

Okay, sorry for the triple-post, but I think I'm going somewhere !

Now I can load my menu through that magic milk bottle and I can change her outfits.

However, any non-vanilla item does not want to equip, even though I checked the related mods in the DATA in Creation Kit, and even though the mods in question are active in my load order.

In fact, the outfits that are coming from mods are currently in Piper's inventory and they work fine when used through her inventory or container. But they wont equip through EquipItem.

It's a shame because my outfit #1 is "Naked" and my first choice was to equip the Nude ring (does not work tru menu), my second was Piper.UnequipAll() which does not work as it only unequips her gun and puts her in a fist-fight stance, so my only remaining option is to Unequip each of the outfits and items of the other Outfits in the menu. It does work and make her naked, but it will not as soon as she'll be wearing anything else.

I might try Piper.EquipItemExt, do you think it could work ? Or do you have any other ideas ?

Also, I'm still open to suggestions on how to activate this menu through a button while facing Piper.

Here's my 90% working script so far :

Scriptname Jessy_PiperMenu_Script extends ObjectReference

int Button 

Event OnActivate(ObjectReference akActionRef)

If akActionRef == Game.GetPlayer()
   
	Button = messagebox_999_PO.Show() ; Shows the menu.

EndiF
		
If Button == 0   
		Piper.EquipItem(NudeThemasYouWant, True) ; A ring that unequips everything when wore 
 		Piper.UnequipItem(Eli_NWRaiderOutfitRL)
		Piper.UnequipItem(ClothesPiperGoggles)	
		Piper.UnequipItem(Armor_BoS_Knight_Underarmor)
		Piper.UnequipItem(ClothesSturgesBeltAddons)
		Piper.UnequipItem(DLC03_Armor_Marine_UnderArmor_Body)	
		Piper.UnequipItem(Biker_Gal)
		Piper.EquipItem(NudeThemasYouWant, True)
		
ElseIf Button == 1
			;xxx Piper.EquipItem(NudeThemasYouWant) ; A ring that unequips everything when wore 
			;xxx Utility.WaitMenuMode(1.0) ; Made this so that there is a pause between both EquipItem, so that they dont try to equip something that unequip everything at the same time as equipping other items
			Piper.EquipItem(ClothesPiperGoggles, True)			
			Piper.EquipItem(Eli_NWRaiderOutfitRL, True)
			
			
			
			
elseif button == 2
			;xxx Piper.EquipItem(NudeThemasYouWant) ; A ring that unequips everything when wore 
			;xxx Utility.WaitMenuMode(1.0)
			Piper.EquipItem(Armor_BoS_Knight_Underarmor, True)
			Piper.UnequipItem(ClothesPiperGoggles)

ElseIf Button == 3
			;Piper.EquipItem(NudeThemasYouWant) ; A ring that unequips everything when wore 
			;Utility.WaitMenuMode(1.0)
			Piper.EquipItem(ClothesSturgesBeltAddons, True)
			Piper.EquipItem(ClothesPiperGoggles, True)

elseif Button == 4 
			;Piper.EquipItem(NudeThemasYouWant) ; A ring that unequips everything when wore 
			;Utility.WaitMenuMode(1.0)
			Piper.EquipItem(DLC03_Armor_Marine_UnderArmor_Body, True)
			Piper.UnequipItem(ClothesPiperGoggles)
			
  
elseif Button == 5 ; biker
			;Piper.EquipItem(NudeThemasYouWant) ; A ring that unequips everything when wore 
			;Utility.WaitMenuMode(1.0)
			Piper.EquipItem(Biker_Gal, True)

elseif Button == 6 ; Cancel


endif
 endEvent

ObjectReference Property Milk_999_PO Auto

actor Property Piper Auto

actor Property PiperRef Auto

Armor Property NudeThemasYouWant Auto 

Armor Property Eli_NWRaiderOutfitRL Auto 

Armor Property ClothesPiperGoggles Auto 

Armor Property Armor_BoS_Knight_Underarmor Auto 

Armor Property ClothesSturgesBeltAddons Auto 

Armor Property DLC03_Armor_Marine_UnderArmor_Body Auto 

Armor Property Biker_Gal Auto 

Armor Property AA_NudeThem Auto

Message Property MessageBox_999_PO Auto Const
{Message that will appear}

Message Property b0 Auto  
Message Property b1 Auto  
Message Property b2 Auto  
Message Property b3 Auto  
Message Property b4 Auto  
Message Property b5 Auto  
Message Property b6 Auto  

Armor Property NewProperty Auto Const

Armor Property RobotLeg Auto Const






 

 

PS : I still don't know how to Quote/Code as a "Spoiler"

Link to comment
Share on other sites

However, any non-vanilla item does not want to equip, even though I checked the related mods in the DATA in Creation Kit, and even though the mods in question are active in my load order.

Unless the other mod is a master (esm), the CK will strip any plugin (esp/esl) from your mod once saved, therefore any property pointing to the records of such mod gets "orphaned".

 

The way to workarround this is using GetFormFromFile.

 

You need to find out the FormID's of your outfits.

 

Let's say that the outfits property "Eli_NWRaiderOutfitRL" has the form Id 1234ABCD, and the plugin containing it is named EliAwesomeOutfits.esp, you would need to remove the property and fill it in the OnInit event:

Scriptname Jessy_PiperMenu_Script extends ObjectReference

Armor Eli_NWRaiderOutfitRL

Event OnInit()
	Eli_NWRaiderOutfitRL = Game.GetFormFromFile(0x1234ABCD, "EliAwesomeOutfits.esp") as Armor
EndEvent

Event OnActivate(ObjectReference akActionRef)
	If akActionRef == Game.GetPlayer()
		int Button = messagebox_999_PO.Show() ; Shows the menu.
		
		If Button == 0   
			Piper.EquipItem(NudeThemasYouWant, True) ; A ring that unequips everything when wore 
			Piper.UnequipItem(Eli_NWRaiderOutfitRL)
			Piper.UnequipItem(ClothesPiperGoggles)	
			Piper.UnequipItem(Armor_BoS_Knight_Underarmor)
			Piper.UnequipItem(ClothesSturgesBeltAddons)
			Piper.UnequipItem(DLC03_Armor_Marine_UnderArmor_Body)	
			Piper.UnequipItem(Biker_Gal)
			Piper.EquipItem(NudeThemasYouWant, True)
		ElseIf Button == 1
			;xxx Piper.EquipItem(NudeThemasYouWant) ; A ring that unequips everything when wore 
			;xxx Utility.WaitMenuMode(1.0) ; Made this so that there is a pause between both EquipItem, so that they dont try to equip something that unequip everything at the same time as equipping other items
			Piper.EquipItem(ClothesPiperGoggles, True)
			Piper.EquipItem(Eli_NWRaiderOutfitRL, True)
		elseif button == 2
			;xxx Piper.EquipItem(NudeThemasYouWant) ; A ring that unequips everything when wore 
			;xxx Utility.WaitMenuMode(1.0)
			Piper.EquipItem(Armor_BoS_Knight_Underarmor, True)
			Piper.UnequipItem(ClothesPiperGoggles)
		ElseIf Button == 3
			;Piper.EquipItem(NudeThemasYouWant) ; A ring that unequips everything when wore 
			;Utility.WaitMenuMode(1.0)
			Piper.EquipItem(ClothesSturgesBeltAddons, True)
			Piper.EquipItem(ClothesPiperGoggles, True)
		elseif Button == 4 
			;Piper.EquipItem(NudeThemasYouWant) ; A ring that unequips everything when wore 
			;Utility.WaitMenuMode(1.0)
			Piper.EquipItem(DLC03_Armor_Marine_UnderArmor_Body, True)
			Piper.UnequipItem(ClothesPiperGoggles)
		elseif Button == 5 ; biker
			;Piper.EquipItem(NudeThemasYouWant) ; A ring that unequips everything when wore 
			;Utility.WaitMenuMode(1.0)
			Piper.EquipItem(Biker_Gal, True)
		elseif Button == 6 ; Cancel
			;do nothing
		endif
		
	endif
endEvent

ObjectReference Property Milk_999_PO Auto
actor Property Piper Auto
actor Property PiperRef Auto
Armor Property NudeThemasYouWant Auto 
Armor Property ClothesPiperGoggles Auto 
Armor Property Armor_BoS_Knight_Underarmor Auto 
Armor Property ClothesSturgesBeltAddons Auto 
Armor Property DLC03_Armor_Marine_UnderArmor_Body Auto 
Armor Property Biker_Gal Auto 
Armor Property AA_NudeThem Auto

Message Property MessageBox_999_PO Auto Const
{Message that will appear}

Message Property b0 Auto  
Message Property b1 Auto  
Message Property b2 Auto  
Message Property b3 Auto  
Message Property b4 Auto  
Message Property b5 Auto  
Message Property b6 Auto  

Armor Property NewProperty Auto Const
Armor Property RobotLeg Auto Const

Edited by DieFeM
Link to comment
Share on other sites

Thanks, that makes complete sense!

(1)(2) I edited my two first questions, as they were asking how to find the Form IDs of my Items, but I fount it by extanding the Form ID column on the left of Count :laugh: I will try to incorporate them in my script ! Thanks

I had a few other questions though if you do not mind!

(3) One of my Item is shown as ARMA (Armor Addon) instead of Armor. Should I add ARMA at the ends of its GetFormFromFile code like this : « NudeThemasYouWant = Game.GetFormFromFile(0x1234ABCD, "NudeThemasYouWant.esp") as ARMA » or should I keep ARMOR ? (In my property, I used ARMOR because ARMA was not shown as a valid function in my Notepad++/Papyrus++ editor's suggestions. Should I change this as well ( Armor Property NudeThemasYouWant Auto )

(4) Also, should I put all of my GetFormID codes under the same
Event OnInit() , one under the other before the EndEvent, or I should make a different Event OnInit() / EndEvent for each ?

(5) And lastly, if you have a suggestion on how to activate my menu by hitting the (B) button while facing my companion, that'd be awesome! :smile:

Thanks a lot !

Link to comment
Share on other sites

Update : So I found all the form IDs, added 0x in front of them, and matched them to their respective ESPs and Saved/Compiled the script without any error message.

I added this at the beginning of my script, and removed the property codes of those items at the end. However, she will still not equip those outfits once in the game even after reinstalling the mod.

Any suggestions ?

Scriptname Jessy_PiperMenu_Script extends ObjectReference

int Button 

Event OnInit()
	Biker_Gal = Game.GetFormFromFile(0x0600c909, "BikerGal.esp") as Armor
	NudeThemasYouWant = Game.GetFormFromFile(0x05000800, "Nude Them.esp") as Armor
	Eli_NWRaiderOutfitRL = Game.GetFormFromFile(0x04001071, "Eli_Robo Leg Outfits.esp") as Armor
EndEvent
 

EDIT : In the meantime, I was able to attach the same script to CompanionPiper, but I changed the name/intro for this :

 

Scriptname Jessy_PiperActivate_Script extends Actor conditional

The rest of the script is pretty much the same. I got no error message, but once in game the menu was not accessible from her as she was not activable (only option was to talk or control). Still trying stuff out. Still haven't found a way to get the Modded outfits to be equiped, even with the GetFormIDs. Still open to suggestions !

I'll try to find a mod where a NPC is activable and study the scripts. I checked AFT again, but this mod is too massive, there was like hundreds of scripts.

Link to comment
Share on other sites

Probably the problem is that you are attaching the script to Piper, and OnInit happens once the reference is initialized, but Piper's reference is already initialized.

You can solve this problem by first solving the activation problem which you can solve adding an activation option through a perk.

There are various perks that add activation options: Animal Friend, Cannibal, Intimidation, Mister Sandman and Wasteland Whisperer.

Take a look at those to learn how to add an activation option, this activation option has a script fragment that is called when you use this activation option, there you should add your code, you can't use events there, so you'll need to put everything together.

Link to comment
Share on other sites

Probably the problem is that you are attaching the script to Piper, and OnInit happens once the reference is initialized, but Piper's reference is already initialized.

You can solve this problem by first solving the activation problem which you can solve adding an activation option through a perk.

There are various perks that add activation options: Animal Friend, Cannibal, Intimidation, Mister Sandman and Wasteland Whisperer.

Take a look at those to learn how to add an activation option, this activation option has a script fragment that is called when you use this activation option, there you should add your code, you can't use events there, so you'll need to put everything together.

 

Thanks, I'll look into that !

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...