Jump to content

Adding Keywords by script?


Recommended Posts

Posted

I have this in an Alias Reference script but it won't compile, any ideas?

Scriptname SynthPlayer:Synth9RSE extends ReferenceAlias

Group Misc
	Keyword Property kwSynthMilk Auto
	Potion Property potRSE_BottleOfMilk Auto
EndGroup

;-----------------------------------------------------------------------------------------------------------------------------

Event fnInit()
	potRSE_BottleOfMilk = Game.GetFormFromFile(0x0000CFA9, sModName) as Potion
	If (potRSE_BottleOfMilk)
		potRSE_BottleOfJMilk.AddKeyword(kwSynthMilk)
	EndIf
EndEvent
Quote

C:\Users\Owner\AppData\Local\Temp\PapyrusTemp\SynthPlayer\Synth9RSE.psc(88,22): AddKeyword is not a function or does not exist

 

Posted

Addkeyword() only works on references whereas you’re trying to add the keyword to the base object. To make it work, you would need to get the reference id of the potion. 

Posted
3 hours ago, Carreau said:

Addkeyword() only works on references whereas you’re trying to add the keyword to the base object. To make it work, you would need to get the reference id of the potion. 

Unfortunately I want to add the keyword to the base object, not just one reference.

 

	potRSE_BottleOfJizz = Game.GetFormFromFile(0x0000CFA9, sModName) as Potion
	If (potRSE_BottleOfJizz)
		ObjectReference orBottleJizz = potRSE_BottleOfJizz.GetReference()
		orBottleJizz.AddKeyword(kwSynthCum)
	EndIf

I did this and now get this :P

Quote

C:\Users\Owner\AppData\Local\Temp\PapyrusTemp\SynthPlayer\Synth9RSE.psc(92,53): GetReference is not a function or does not exist

It seems it can't be done without a dirty edit of another mod which I don't want to make a dependency:P

Posted

I added keywords to base armors for fallout vore, but to do it required manually adding the keyword in a bridging plugin. That way i didn’t create armor dependencies on the core mod for people who didn’t want the optional functionality I was adding through the keywords.

 

I’m thinking the cleaner way to do it would be to use getformfromfile to load a formlist with base IDs. Then, you can watch if the item being used is in the list through onequip and do your magic that way. That’s basically how survival works when using food and drink. 

Posted
2 hours ago, Carreau said:

I added keywords to base armors for fallout vore, but to do it required manually adding the keyword in a bridging plugin. That way i didn’t create armor dependencies on the core mod for people who didn’t want the optional functionality I was adding through the keywords.

 

I’m thinking the cleaner way to do it would be to use getformfromfile to load a formlist with base IDs. Then, you can watch if the item being used is in the list through onequip and do your magic that way. That’s basically how survival works when using food and drink. 

Yeah I worked out a way to do basically that, hopefully we might get a F4SE function one day to add keywords to base objects :)

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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