Will58448 Posted December 3, 2017 Share Posted December 3, 2017 So I'm making changes to the Lead Belly Perk. I'd like rank 2 to allow extra meat from animal kills, which is currently attached to the Wasteland Survival Guide Mag 9. I know a script activates the Global to allow the extra meat, but I don't know how to attach the script to the Lead Belly Perk, rather than the magazine. (I know nothing about scripting) Is this something relatively easy to do? Does anyone know how I would go about it? Link to comment Share on other sites More sharing options...
Will58448 Posted December 5, 2017 Author Share Posted December 5, 2017 I have now created a new quest and added a script to it, but it doesn't seem to be doing anything. Have I missed something important from the script? ;BEGIN FRAGMENT CODE - Do not edit anything between this and the end commentScriptname SurvivalistScript Extends Quest Hidden Const;BEGIN FRAGMENT Fragment_Stage_0100_Item_00Function Fragment_Stage_0100_Item_00();BEGIN CODEExtraMeatChance.SetValue(0);END CODEEndFunction;END FRAGMENT;END FRAGMENT CODE - Do not edit anything between this and the begin commentGlobalVariable Property ExtraMeatChance Auto Const Any help would be appreciated. Link to comment Share on other sites More sharing options...
FlashyJoer Posted December 5, 2017 Share Posted December 5, 2017 (edited) I have now created a new quest and added a script to it, but it doesn't seem to be doing anything. Have I missed something important from the script? ;BEGIN FRAGMENT CODE - Do not edit anything between this and the end commentScriptname SurvivalistScript Extends Quest Hidden Const ;BEGIN FRAGMENT Fragment_Stage_0100_Item_00Function Fragment_Stage_0100_Item_00();BEGIN CODEExtraMeatChance.SetValue(0);END CODEEndFunction;END FRAGMENT ;END FRAGMENT CODE - Do not edit anything between this and the begin comment GlobalVariable Property ExtraMeatChance Auto Const Any help would be appreciated. This is a fragment, and all it is doing is setting the value of the global variable "extrameatchance" to 0. Im sure if you get to this point in your testing and then open the console up and type "getglobalvalue ExtraMeatChance" the result will be 0.00. Thats all this code snippet does... and if the result IS 0.00, then it is working exactly as you coded it. But here's the question... which stage did you set this fragment on? And do you ever in your main script or in dialogue set stage to this fragment stage? IE: in a playerREF script, do you 'QuestName.setstage(xx)' to set to the stage where the fragment in? If not, this is why you see nothing... Edited December 5, 2017 by joerqc Link to comment Share on other sites More sharing options...
SKKmods Posted December 5, 2017 Share Posted December 5, 2017 (edited) This is probably a triggering issue - what action or activity should trigger your script that sets the global ? A good bet would be to register your script to watch for a remote event of the mag being read like this (not guaranteed code, may need tweaks); ObjectReference Property pPlayerRef Auto Const Mandatory Book Property pPerkMagWastelandSurvivalGuide09 Auto Const Mandatory Event OnQuestInit() RegisterForRemoteEvent(pPerkMagWastelandSurvivalGuide09, "OnActivate") EndEvent Event Book.OnActivate(Book akSender, ObjectReference akActionRef) If akSender == pPerkMagWastelandSurvivalGuide09 && akActionRef == pPlayerRef ; do your stuff GetOwningQuest().Stop() ; do cleanup the quest when done Endif EndEvent Edited December 5, 2017 by SKK50 Link to comment Share on other sites More sharing options...
Will58448 Posted December 5, 2017 Author Share Posted December 5, 2017 I'm an idiot. This is embarrassing to admit but, I'd actually forgotten to edit the Perk to set the quest stage. It's working as intended now. Sorry to bother you with this! But thank you for the help! Link to comment Share on other sites More sharing options...
Recommended Posts