Jump to content

Simple Script Tweak Help


jedp15

Recommended Posts

So I'm having trouble getting a script to compile. I've tried using both the CK and Notepad++ and both fail. I'm getting an error that says "variable EnchEbonyGreatswordFire05 is undefined." I'm new to scripting am just trying to add a specific sword to an NPC during a certain stage of a vanilla quest, because this is how they designed the quest (I'd rather just edit his inventory manually but that's not an option).

 

The line of code I've added is in bold:

 

;BEGIN FRAGMENT Fragment_5
Function Fragment_5()
;BEGIN CODE
;Go Speak to Geldis at the Cornerclub
if IsObjectiveDisplayed(5) == 1
SetObjectiveCompleted(5,1)
endif
SetObjectiveDisplayed(10,1)
Alias_DLC2RR02VendilAlias.GetActorRef().Disable()
Alias_DLC2RR02VendilAlias.GetActorRef().MoveTo(pDLC2RR02EndMarker)
pDLC2RRVendilSeverin.SetEssential(false)
Alias_DLC2RR02VendilAlias.GetActorRef().RemoveFromFaction(pDLC2CrimeRavenRockFaction)
Alias_DLC2RR02VendilAlias.GetActorRef().RemoveFromFaction(pDLC2RRSeverinSpouseFaction)
Alias_DLC2RR02VendilAlias.GetActorRef().RemoveFromFaction(pDLC2RRSeverinManorFaction)
Alias_DLC2RR02VendilAlias.GetActorRef().AddToFaction(pDLC2MoragTongFaction)
Alias_DLC2RR02VendilAlias.GetActorRef().SetAv("Aggression",1)
Alias_DLC2RR02VendilAlias.GetActorRef().SetOutfit(pDLC2VendilSeverinBattleOutfit)
Alias_DLC2RR02VendilAlias.GetActorRef().AddItem(EnchEbonyGreatswordFire05, 01)
;END CODE
EndFunction
;END FRAGMENT

 

Here's the complete error code:

 

C:\Program Files (x86)\Notepad++>"G:\Steam\steamapps\common\Skyrim\Papyrus Compi
ler\PapyrusCompiler" "DLC2_QF_DLC2RR02_02018B14.psc" -f="TESV_Papyrus_Flags.flg"
-i="G:\Steam\steamapps\common\Skyrim\Papyrus Compiler\..\Data\Scripts\Source" -
o="G:\Steam\steamapps\common\Skyrim\Papyrus Compiler\..\Data\Scripts"
Starting 1 compile threads for 1 files...
Compiling "DLC2_QF_DLC2RR02_02018B14"...
G:\Steam\steamapps\common\Skyrim\Data\Scripts\Source\DLC2_QF_DLC2RR02_02018B14.p
sc(103,48): variable EnchEbonyGreatswordFire05 is undefined
G:\Steam\steamapps\common\Skyrim\Data\Scripts\Source\DLC2_QF_DLC2RR02_02018B14.p
sc(176,12): dlc2rr02questscript is not a known user-defined type
G:\Steam\steamapps\common\Skyrim\Data\Scripts\Source\DLC2_QF_DLC2RR02_02018B14.p
sc(238,12): dlc2rr02questscript is not a known user-defined type
G:\Steam\steamapps\common\Skyrim\Data\Scripts\Source\DLC2_QF_DLC2RR02_02018B14.p
sc(296,29): unknown type dlc2rr00questscript
G:\Steam\steamapps\common\Skyrim\Data\Scripts\Source\DLC2_QF_DLC2RR02_02018B14.p
sc(308,29): unknown type dlc2rr02questscript
No output generated for DLC2_QF_DLC2RR02_02018B14.psc, compilation failed.

Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on DLC2_QF_DLC2RR02_02018B14.psc

C:\Program Files (x86)\Notepad++>pause
Press any key to continue . . .

 

 

The script name is "DLC2_QF_DLC2RR02_02018B14" it's for the quest "Served Cold" in the Dragonborn DLC.

 

Thanks in advance!

Edited by jedp15
Link to comment
Share on other sites

Okay, you are working with a fragment script. Fragment scripts must have all properties added to them via the property window before they can be compiled.

You have added the item EnchEbonyGreatswordFire05 and without that variable being defined by a property as a weapon and subsequently with the item assigned to the property, the compiler cannot handle it.

 

If you want to skip the property thing, you can add the following instead:

Form myForm = Game.GetFormFromFile(0x0001cfba,"Skyrim.esm") ;assigns the base form of "Ebony Greatsword of the Inferno"
Alias_DLC2RR02VendilAlias.GetActorRef().AddItem(myForm, 01)

If the supplied ID is not correct for the weapon you want, change it accordingly.

Link to comment
Share on other sites

  • 2 weeks later...

Thanks so much for the help, will try it out and see how it goes.

 

Edit: so where in the fragment script do I place the "myForm" code? Right before ";END CODE" where I placed my original code? Or do I have to create a new script?

Edited by jedp15
Link to comment
Share on other sites

Okay tried it within the original script and it failed. Like I said I'm NEW to scripting. Need to know verbatum what to do.

 

Here's what I put

 

 

;BEGIN FRAGMENT Fragment_5
Function Fragment_5()
;BEGIN CODE
;Go Speak to Geldis at the Cornerclub
if IsObjectiveDisplayed(5) == 1
SetObjectiveCompleted(5,1)
endif
SetObjectiveDisplayed(10,1)
Alias_DLC2RR02VendilAlias.GetActorRef().Disable()
Alias_DLC2RR02VendilAlias.GetActorRef().MoveTo(pDLC2RR02EndMarker)
pDLC2RRVendilSeverin.SetEssential(false)
Alias_DLC2RR02VendilAlias.GetActorRef().RemoveFromFaction(pDLC2CrimeRavenRockFaction)
Alias_DLC2RR02VendilAlias.GetActorRef().RemoveFromFaction(pDLC2RRSeverinSpouseFaction)
Alias_DLC2RR02VendilAlias.GetActorRef().RemoveFromFaction(pDLC2RRSeverinManorFaction)
Alias_DLC2RR02VendilAlias.GetActorRef().AddToFaction(pDLC2MoragTongFaction)
Alias_DLC2RR02VendilAlias.GetActorRef().SetAv("Aggression",1)
Alias_DLC2RR02VendilAlias.GetActorRef().SetOutfit(pDLC2VendilSeverinBattleOutfit)
Form myForm = Game.GetFormFromFile(0x0001cdc8,"Skyrim.esm") ;assigns the base form of "Ebony Greatsword of the Blaze"
Alias_DLC2RR02VendilAlias.GetActorRef().AddItem(myForm, 01)

;END CODE
EndFunction
;END FRAGMENT

 

Link to comment
Share on other sites

What failed? The compilation of the script fragment? The adding of the item in-game?

 

Edit: Hmm... Have you considered adding the item directly to the alias' inventory rather than scripting it in?

 

Additionally, if you are looking at keeping it compatible with other mods that might want to affect the same thing, you could create a new quest with its own alias that gets filled with the target alias of the desired quest. Your new quest can be started with the story manger's OnLocationChange event with the condition that the target quest has been started.

 

At least those are some alternative routes to think about.

Edited by IsharaMeradin
Link to comment
Share on other sites

Yeah it failed to compile. The part I showed is just a small fragment in a much larger script. The reason it needs to be scripted in is because according to the events of the story I'm merging into the quest, the weapon is supposed to be "taken" from a slain NPC much later on. I'd rather keep it simple, so maybe the script property would work.

 

You wrote "Fragment scripts must have all properties added to them via the property window before they can be compiled."

I'm not sure how this would be done, do you mind showing me :smile: lol

 

Here's the beginning of the script up to the point I showed you

 

 

;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment
;NEXT FRAGMENT INDEX 24
Scriptname DLC2_QF_DLC2RR02_02018B14 Extends Quest Hidden

;BEGIN ALIAS PROPERTY DLC2RR02TombQTAlias
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_DLC2RR02TombQTAlias Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY DLC2RR02VendilAlias
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_DLC2RR02VendilAlias Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY DLC2RR02SeverinHouseMarkerAlias
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_DLC2RR02SeverinHouseMarkerAlias Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY DLC2RR02VelethAlias
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_DLC2RR02VelethAlias Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY DLC2RR02GeldisAlias
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_DLC2RR02GeldisAlias Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY DLC2RR02TilisuAlias
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_DLC2RR02TilisuAlias Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY DLC2RR02MorvaynAlias
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_DLC2RR02MorvaynAlias Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY DLC2RR02MirriAlias
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_DLC2RR02MirriAlias Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY DLC2RR02AdrilAlias
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_DLC2RR02AdrilAlias Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY DLC2RR02GuardQT
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_DLC2RR02GuardQT Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY DLC2RRHoldingSafeAlias
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_DLC2RRHoldingSafeAlias Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY DLC2RR02EvidenceAlias
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_DLC2RR02EvidenceAlias Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY DLC2RR02SafeAlias
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_DLC2RR02SafeAlias Auto
;END ALIAS PROPERTY

;BEGIN ALIAS PROPERTY DLC2RR02PlayerAlias
;ALIAS PROPERTY TYPE ReferenceAlias
ReferenceAlias Property Alias_DLC2RR02PlayerAlias Auto
;END ALIAS PROPERTY

;BEGIN FRAGMENT Fragment_4
Function Fragment_4()
;BEGIN CODE
;Quest is in holding pattern, Player isn't taking it right now
if isObjectiveDisplayed(5) == 0
SetObjectiveDisplayed(5,1)
endif
;END CODE
EndFunction
;END FRAGMENT

;BEGIN FRAGMENT Fragment_5
Function Fragment_5()
;BEGIN CODE
;Go Speak to Geldis at the Cornerclub
if IsObjectiveDisplayed(5) == 1
SetObjectiveCompleted(5,1)
endif
SetObjectiveDisplayed(10,1)
Alias_DLC2RR02VendilAlias.GetActorRef().Disable()
Alias_DLC2RR02VendilAlias.GetActorRef().MoveTo(pDLC2RR02EndMarker)
pDLC2RRVendilSeverin.SetEssential(false)
Alias_DLC2RR02VendilAlias.GetActorRef().RemoveFromFaction(pDLC2CrimeRavenRockFaction)
Alias_DLC2RR02VendilAlias.GetActorRef().RemoveFromFaction(pDLC2RRSeverinSpouseFaction)
Alias_DLC2RR02VendilAlias.GetActorRef().RemoveFromFaction(pDLC2RRSeverinManorFaction)
Alias_DLC2RR02VendilAlias.GetActorRef().AddToFaction(pDLC2MoragTongFaction)
Alias_DLC2RR02VendilAlias.GetActorRef().SetAv("Aggression",1)
Alias_DLC2RR02VendilAlias.GetActorRef().SetOutfit(pDLC2VendilSeverinBattleOutfit)
;END CODE
EndFunction
;END FRAGMENT

 

 

It's confusing because none of the things in the fragment I'm trying to change are mentioned as properties beforehand (like the pDLC2VendilSeverinBattleOutfit is not set as an outfit property), yet the script works.

This is what I would try just by looking at what was written earlier in the script, but yeah, have no idea what I'm doing lol.

 

;BEGIN ALIAS PROPERTY EnchEbonyGreatswordFire05Alias
;ALIAS PROPERTY TYPE WeaponAlias
WeaponAlias Property Alias_EnchEbonyGreatswordFire05 Auto
;END ALIAS PROPERTY

Edited by jedp15
Link to comment
Share on other sites

  • Recently Browsing   0 members

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