nexusclod Posted July 20, 2021 Share Posted July 20, 2021 How do you edit a script, from a mod, in the CK? All I need to do is "add property" or "add new property" to an existing script. Neither options are available (greyed out). Thx Link to comment Share on other sites More sharing options...
YouDoNotKnowMyName Posted July 20, 2021 Share Posted July 20, 2021 You need the actual source code of that script.When a mod is published, usually only the compiled script gets uploaded. Either decompile it yourself or ask the mod author for the source code of that script. Link to comment Share on other sites More sharing options...
aurreth Posted July 20, 2021 Share Posted July 20, 2021 And you can't just add a property. Well, you can, but if the script doesn't specifically make use of that property you aren't accomplishing anything. You're basically declaring a variable and giving it a value but then never using it. Link to comment Share on other sites More sharing options...
nexusclod Posted July 20, 2021 Author Share Posted July 20, 2021 Thx for the replies. I really wish the CK documentation was better, or even complete. I've now got the script decompiled and have made the necessary edits, but am having a real hard time trying to recompile it. Mainly over the name (I think, probably more errors). Luckily all of the associated keywords and entries seem to be there, I'm trying to split a single group containing the minutemen, RR, Institute, and BoS into individual choices. I've been reading old reddit posts from five years ago and watching random youtube tutorials, but I'm not finding exactly what I need. The best thing to help me would probably be recommendation for good tutorials on scripting and the CK. If anyone has any links to good, up to date, guides I would really appreciate it. Thx. Link to comment Share on other sites More sharing options...
nexusclod Posted July 21, 2021 Author Share Posted July 21, 2021 (edited) One of my major issues I'm having is the naming convention of the script. The .psc file is different from the .pex. The .pex adds a title with a set of " : ", and you can't add a colon in a normal file name. "expecting a different name" error message. Ok, got that figured out with the CK name groups. Now it won't compile because there is already a file with that name. Ok, remove the old script(from the associated quest), cleaned MO2 overwrite>script of any mention, now CK cannot see the altered .psc file in the gameplay>papyrus manager, which it could before. I've double-checked that the correct .psc file is in the MO2>mod folder, no other versions of the mod are activated. (I extracted the ba2 containing the scripts and am running the mod on loose files to test). I'm really not sure what I'm doing wrong here. Any help would be appreciated. To recap: 1. I've added the appropriate global variables (three entries using a -1 value that can be altered through MCM. These are identical in format to other existing entries in the mod)2. I've altered the MCM config file to work with the above variables, the menu itself seems to be working, but the specific functions involved in this script are not functional, as expected3. I've decompiled the one script I want to alter, made alterations (all four faction entries were consolidated into a single variable, altered to add individual options exactly following other entries formatting, with correct labels), and removed the old entries.4. I've created a file with a. the altered MCM file b. the ba2 extracted to be loose meshes and scripts folders c. the .esp with the added global variables d. included the altered .psc file in the loose "scripts" folder e. and put this in the MO2 MODs folder and activated it.5. I've tried to compile the altered script, but cannot compile it by itself (it is referencing other entries in the mod, I believe), so I think I have to use the CK to compile. Is there an obvious mistake here, or any suggestions? Also, why is the .psc file only sometimes showing up in the CK Papyrus manger? Thanks. The script I altered:ScriptName ZombieWalkers:ZW_Quest_Replacements_Check extends Quest ;-- Properties --------------------------------------Group AliasesRefCollectionAlias Property CheckReplacementList Auto Const mandatoryRefCollectionAlias Property NeedsReplacementList Auto Const mandatoryEndGroup Group KeywordsKeyword Property ZW_ReplacementNeeded Auto Const mandatoryKeyword Property ZW_ReplacementSkipped Auto Const mandatoryEndGroup Group MiscActor Property PlayerRef Auto Const mandatoryContainer Property ZW_DuffleBag Auto Const mandatoryGlobalVariable Property ZW_Quest_Replacements_LastCount Auto Const mandatoryEndGroup Group Replace_AnimalsGlobalVariable Property ZW_Config_Replace_Animals Auto Const mandatoryKeyword Property ActorTypeAnimal Auto Const mandatoryEndGroup Group Replace_BugsGlobalVariable Property ZW_Config_Replace_Bugs Auto Const mandatoryKeyword Property ActorTypeBug Auto Const mandatoryEndGroup Group Replace_CreaturesGlobalVariable Property ZW_Config_Replace_Creatures Auto Const mandatoryKeyword Property ActorTypeCreature Auto Const mandatoryEndGroup Group Replace_HeavyKnockersGlobalVariable Property ZW_Config_Replace_HeavyKnockers Auto Const mandatoryKeyword Property HeavyKnocker Auto Const mandatoryEndGroup Group Replace_HumansGlobalVariable Property ZW_Config_Replace_Humans Auto Const mandatoryRace[] Property ZW_Config_Replace_Humans_Races Auto Const mandatoryEndGroup Group Replace_Faction_CoAFaction Property ChildrenOfAtomFaction Auto Const mandatoryFaction Property GlowingSeaChildrenFaction Auto Const mandatoryGlobalVariable Property ZW_Config_Replace_Faction_CoA Auto Const mandatoryEndGroup Group Replace_Faction_GunnersFaction Property GunnerFaction Auto Const mandatoryGlobalVariable Property ZW_Config_Replace_Faction_Gunners Auto Const mandatoryEndGroup Group Replace_Faction_BrotherhoodofSteel Added lineFaction Property BrotherhoodofSteel Auto Const mandatory Here's my error, left out "Faction"GlobalVariable Property ZW_Config_Replace_Faction_BoS Auto Const mandatory One of the GLOB I createdEndGroup Group Replace_Faction_Institute sameFaction Property InstituteFaction Auto Const mandatoryGlobalVariable Property ZW_Config_Replace_Faction_Institute Auto Const mandatoryEndGroup Group Replace_Faction_Minutemen sameFaction Property MinutemenFaction Auto Const mandatoryGlobalVariable Property ZW_Config_Replace_Faction_Minutemen Auto Const mandatoryEndGroup Group Replace_Faction_Railroad sameFaction Property RailroadFaction Auto Const mandatoryGlobalVariable Property ZW_Config_Replace_Faction_Railroad Auto Const mandatoryEndGroup Group Replace_Faction_RaidersFaction Property RaiderFaction Auto Const mandatoryFaction Property TheForgedFaction Auto Const mandatoryFaction Property TriggermanFaction Auto Const mandatoryGlobalVariable Property ZW_Config_Replace_Faction_Raiders Auto Const mandatoryEndGroup Group Replace_Faction_SettlementsFaction Property CrimeDiamondCity Auto Const mandatoryFaction Property CrimeGoodneighbor Auto Const mandatoryFaction Property SettlementBunkerHill Auto Const mandatoryGlobalVariable Property ZW_Config_Replace_Faction_Settlements Auto Const mandatoryEndGroup Group Replace_Faction_WorkshopFaction Property WorkshopNPCFaction Auto Const mandatoryGlobalVariable Property ZW_Config_Replace_Faction_Workshop Auto Const mandatoryEndGroup Group Replace_OtherGlobalVariable Property ZW_Config_Replace_Other Auto Const mandatoryEndGroup Group Replace_RobotsGlobalVariable Property ZW_Config_Replace_Robots Auto Const mandatoryKeyword Property ActorTypeRobot Auto Const mandatoryEndGroup Group Replace_SuperMutantsGlobalVariable Property ZW_Config_Replace_SuperMutants Auto Const mandatoryKeyword Property ActorTypeSuperMutant Auto Const mandatoryEndGroup Group Replace_SynthsGlobalVariable Property ZW_Config_Replace_Synths Auto Const mandatoryKeyword Property ActorTypeSynth Auto Const mandatoryEndGroup Group Replace_TurretsGlobalVariable Property ZW_Config_Replace_Turrets Auto Const mandatoryKeyword Property ActorTypeTurret Auto Const mandatoryEndGroup Group Replaceable_FlagsGlobalVariable Property ZW_Config_Replaceable_Companions Auto Const mandatoryGlobalVariable Property ZW_Config_Replaceable_Essential Auto Const mandatoryGlobalVariable Property ZW_Config_Replaceable_NonHostile Auto Const mandatoryGlobalVariable Property ZW_Config_Replaceable_Protected Auto Const mandatoryFaction Property CurrentCompanionFaction Auto Const mandatoryFaction Property HasBeenCompanionFaction Auto Const mandatoryFaction Property PotentialCompanionFaction Auto Const mandatoryRace Property FeralGhoulRace Auto Const mandatoryEndGroup ;-- Variables --------------------------------------- ;-- Functions --------------------------------------- bool Function CheckReplacement(Actor NonZombieActor)If (Self.IsReplaceable(NonZombieActor))If (Self.IsHuman(NonZombieActor))return Self.ProcessHumanReplacement(NonZombieActor)ElseIf (NonZombieActor.HasKeyword(ActorTypeTurret))return Self.RollForReplacement(NonZombieActor, ZW_Config_Replace_Turrets)ElseIf (NonZombieActor.HasKeyword(ActorTypeSuperMutant))return Self.RollForReplacement(NonZombieActor, ZW_Config_Replace_SuperMutants)ElseIf (NonZombieActor.HasKeyword(ActorTypeSynth))return Self.RollForReplacement(NonZombieActor, ZW_Config_Replace_Synths)ElseIf (NonZombieActor.HasKeyword(ActorTypeRobot))return Self.RollForReplacement(NonZombieActor, ZW_Config_Replace_Robots)ElseIf (NonZombieActor.HasKeyword(HeavyKnocker))return Self.RollForReplacement(NonZombieActor, ZW_Config_Replace_HeavyKnockers)ElseIf (NonZombieActor.HasKeyword(ActorTypeAnimal))return Self.RollForReplacement(NonZombieActor, ZW_Config_Replace_Animals)ElseIf (NonZombieActor.HasKeyword(ActorTypeBug))return Self.RollForReplacement(NonZombieActor, ZW_Config_Replace_Bugs)ElseIf (NonZombieActor.HasKeyword(ActorTypeCreature))return Self.RollForReplacement(NonZombieActor, ZW_Config_Replace_Creatures)Elsereturn Self.RollForReplacement(NonZombieActor, ZW_Config_Replace_Other)EndIfEndIfEndFunction bool Function IsHuman(Actor target)bool matchesOneRace = Falseint I = 0While (I < ZW_Config_Replace_Humans_Races.length)If (target.GetRace() == ZW_Config_Replace_Humans_Races)matchesOneRace = TrueI = ZW_Config_Replace_Humans_Races.lengthEndIfI += 1EndWhilereturn matchesOneRaceEndFunction bool Function HasAnyKeyword(Actor target, Keyword[] Keywords)bool matchesOneKeyword = FalseIf (Keywords as bool && Keywords.length > 0)int I = 0While (I < Keywords.length)If (target.HasKeyword(Keywords))matchesOneKeyword = TrueI = Keywords.lengthEndIfI += 1EndWhileEndIfreturn matchesOneKeywordEndFunction bool Function IsReplaceable(Actor target)bool retval = TrueActorBase targetBase = target.GetLeveledActorBase()If (target.GetRace() == FeralGhoulRace)retval = FalseElseIf (ZW_Config_Replaceable_Essential.GetValue() == 0 as float && target.IsEssential())retval = FalseElseIf (ZW_Config_Replaceable_Protected.GetValue() == 0 as float && targetBase.IsProtected())retval = FalseElseIf (ZW_Config_Replaceable_Companions.GetValue() == 0 as float && (target.GetFactionRank(CurrentCompanionFaction) >= -1 || target.GetFactionRank(HasBeenCompanionFaction) >= -1 || target.GetFactionRank(PotentialCompanionFaction) >= -1))retval = FalseElseIf (ZW_Config_Replaceable_NonHostile.GetValue() == 0 as float && !target.IsHostileToActor(PlayerRef) && !target.CastAs("MasterAmbushActorScript"))retval = FalseEndIfreturn retvalEndFunction bool Function RollForReplacement(Actor target, GlobalVariable replaceChance)bool replace = Falseint value = replaceChance.GetValueInt()If (value == 100 || Utility.RandomInt(0, 100) <= value)replace = Truetarget.AddKeyword(ZW_ReplacementNeeded)target.Disable(False)ObjectReference bag = target.PlaceAtMe(ZW_DuffleBag as Form, 1, True, False, True)bag.MoveTo(target as ObjectReference, 0, 0, 0, True)bag.WaitFor3DLoad()target.RemoveAllItems(bag, False)If (!target.IsDisabled())target.Kill(None)target.BlockActivation(True, False)target.Delete()EndIfElsereplace = Falsetarget.AddKeyword(ZW_ReplacementSkipped)EndIfreturn replaceEndFunction Function Run()int count = CheckReplacementList.GetCount()ZW_Quest_Replacements_LastCount.SetValue(count as float)int I = 0While (I < count)Actor NonZombieActor = CheckReplacementList.GetAt(I) as ActorIf (NonZombieActor)If (Self.CheckReplacement(NonZombieActor))NeedsReplacementList.AddRef(NonZombieActor as ObjectReference)EndIfEndIfI += 1EndWhileEndFunction bool Function ProcessHumanReplacement(Actor NonZombieActor)GlobalVariable replaceChance = ZW_Config_Replace_HumansIf (NonZombieActor.IsInFaction(RaiderFaction) || NonZombieActor.IsInFaction(TheForgedFaction) || NonZombieActor.IsInFaction(TriggermanFaction))If (ZW_Config_Replace_Faction_Raiders.GetValue() != (-1) as float)replaceChance = ZW_Config_Replace_Faction_RaidersEndIfElseIf (NonZombieActor.IsInFaction(GunnerFaction))If (ZW_Config_Replace_Faction_Gunners.GetValue() != (-1) as float)replaceChance = ZW_Config_Replace_Faction_GunnersEndIfElseIf (NonZombieActor.IsInFaction(ChildrenOfAtomFaction) || NonZombieActor.IsInFaction(GlowingSeaChildrenFaction))If (ZW_Config_Replace_Faction_CoA.GetValue() != (-1) as float)replaceChance = ZW_Config_Replace_Faction_CoAEndIfElseIf (NonZombieActor.IsInFaction(BrotherhoodofSteelFaction)) These were the combined entries, split them following "Gunners" format aboveIf (Zw_Config_Replace_Faction_BoS.GetValue() != (-1) as float)replaceChance = ZW_Config_Replace_Faction_BoSEndIfElseIf (NonZombieActor.IsInFaction(InstituteFaction))If (ZW_Config_Replace_Faction_Institute.GetValue() != (-1) as float)replaceChance = ZW_Config_Replace_Faction_InstituteEndIfElseIf (NonZombieActor.IsInFaction(MinutemenFaction))If (ZW_Config_Replace_Faction_Minutemen.GetValue() != (-1) as float)replaceChance = ZW_Config_Replace_Faction_MinutemenEndIfElseIf (NonZombieActor.IsInFaction(RailroadFaction))If (ZW_Config_Replace_Faction_Railroad.GetValue() != (-1) as float)replaceChance = ZW_Config_Replace_Faction_RailroadEndIfElseIf (NonZombieActor.IsInFaction(CrimeDiamondCity) || NonZombieActor.IsInFaction(CrimeGoodneighbor) || NonZombieActor.IsInFaction(SettlementBunkerHill))If (ZW_Config_Replace_Faction_Settlements.GetValue() != (-1) as float)replaceChance = ZW_Config_Replace_Faction_SettlementsEndIfElseIf (NonZombieActor.IsInFaction(WorkshopNPCFaction))If (ZW_Config_Replace_Faction_Workshop.GetValue() != (-1) as float)replaceChance = ZW_Config_Replace_Faction_WorkshopEndIfEndIfreturn Self.RollForReplacement(NonZombieActor, replaceChance)EndFunction UPDATE: I decided to decompile the other three scripts associated with the one I was having issues with, then when recompiling them three of the four failed. So yeah, that's where I'm at. The error message: Papyrus Compiler Version 2.8.0.4 for Fallout 4Copyright © ZeniMax Media. All rights reserved.Starting 4 compile threads for 4 files...Compiling "ZombieWalkers\ZW_Quest_Replacements.psc"...Compiling "ZombieWalkers\ZW_Quest_Replacements_Check.psc"...Compiling "ZombieWalkers\ZW_Quest_Replacements_Spawn.psc"...Compiling "ZombieWalkers\ZW_Quest_Replacements_Static.psc"...E:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\User\ZombieWalkers\ZW_Quest_Replacements_Static.psc(41,32): unknown type zombiewalkers:zw_utilE:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\User\ZombieWalkers\ZW_Quest_Replacements_Spawn.psc(29,32): unknown type zombiewalkers:zw_utilE:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\User\ZombieWalkers\ZW_Quest_Replacements_Static.psc(93,25): zombiewalkers:zw_util is not a known user-defined script typeE:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\User\ZombieWalkers\ZW_Quest_Replacements_Static.psc(93, :cool:: type mismatch while assigning to a actor (cast missing or types unrelated)No output generated for ZombieWalkers\ZW_Quest_Replacements_Static.psc, compilation failed.E:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\User\ZombieWalkers\ZW_Quest_Replacements_Spawn.psc(59,25): zombiewalkers:zw_util is not a known user-defined script typeE:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\User\ZombieWalkers\ZW_Quest_Replacements_Spawn.psc(59, :cool:: type mismatch while assigning to a actor (cast missing or types unrelated)No output generated for ZombieWalkers\ZW_Quest_Replacements_Spawn.psc, compilation failed.E:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\User\ZombieWalkers\ZW_Quest_Replacements_Check.psc(258,36): variable BrotherhoodofSteelFaction is undefinedNo output generated for ZombieWalkers\ZW_Quest_Replacements_Check.psc, compilation failed.Compilation succeeded. Batch compile of 4 files finished. 1 succeeded, 3 failed.Failed on ZombieWalkers\ZW_Quest_Replacements_Static.pscFailed on ZombieWalkers\ZW_Quest_Replacements_Spawn.pscFailed on ZombieWalkers\ZW_Quest_Replacements_Check.psc Another UPDATE:So I added every script (.psc version) in the mod to the steam data\scripts\etc folder and now none of them work. Again, because they are looking for files with the "name group" added. Is there a fix for this or should I just rewrite the entire mod to follow a better naming system? Edited July 21, 2021 by nexusclod Link to comment Share on other sites More sharing options...
aurreth Posted July 21, 2021 Share Posted July 21, 2021 Because the Papyrus Manager is cranky. If you changed the script you are better off saving it with a new name, then changing whatever uses that script to use the new name. Now: unknown type zombiewalkers:zw_util The scripts you are compiling reference zw_util. That script has a variable, zombiewalkers, with a type not recognized by the compiler. This is likely because zw_util uses a type from something else, like F4SE. If you don't have the sources for F4SE (or whatever it is) then the compiler can't figure out what zw_util is doing with zombiewalkers, and it all comes tumbling down. Now Zombie Walkers doesn't look like it has any requirements... did you decompile zw_util? You need that source code too. Yeah, you have the compiled version, but my experience has been if you don't have the source of the entire chain then the script won't compile. I can't compile anything for Skyrim because the dependencies have dependencies which have dependencies and it is impossible to get the script development environment set up properly. Link to comment Share on other sites More sharing options...
nexusclod Posted July 21, 2021 Author Share Posted July 21, 2021 Thanks for reply, I think I have it figured out. Just like you said, everything comes back to the sourcing. Just got it to compile, checked/set properties, and checked in fo4edit. I was over complicating things. My script sourcing was mixing between MO2 overwrite and the steam file script/source/user. I got that all straightened out, actually putting the .psc file in the right steam folder helps (user). Also I learned not to trust the refresh button in the Papyrus manager. Resetting the CK between every change made a difference. I was messing with too much, I just needed the one file. Also I found an error in my coding. Still, learned a lot about scripting, cheers. Link to comment Share on other sites More sharing options...
aurreth Posted July 21, 2021 Share Posted July 21, 2021 Oh, yeah, if you want a change in Papyrus Manager you have to restart the CK. It's annoying at times, like if you have a source file in the wrong folder and move it you have to restart CK before the compiler can find it. Glad you got it sorted. Link to comment Share on other sites More sharing options...
AndyTheSaurus Posted August 25 Share Posted August 25 Not the right place to ask this but I am out of ideas. I finally got the Creation Kit fully working???? and am getting scripts to compile, HOWEVER. I have created a quest whch runs on startup. I have called Start(), I have fill all properties (whatever that does), but SetStage(0) is not starting the quest and my inventary related commands are not working either. I other words the quest is not running, or not connecting with the game. In Skyrin there was a RegisterForUpdate(...,...) command, I know why that was needed for a quest to do function. It's not available for Fallout4. So now, I.m out of ideas. Any ideas about what I am missing?????? Link to comment Share on other sites More sharing options...
Recommended Posts