Jump to content

Vanilla Script Help


Will58448

Recommended Posts

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

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 comment
Scriptname SurvivalistScript Extends Quest Hidden Const

;BEGIN FRAGMENT Fragment_Stage_0100_Item_00
Function Fragment_Stage_0100_Item_00()
;BEGIN CODE
ExtraMeatChance.SetValue(0)
;END CODE
EndFunction
;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.

Link to comment
Share on other sites

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 comment

Scriptname SurvivalistScript Extends Quest Hidden Const

 

;BEGIN FRAGMENT Fragment_Stage_0100_Item_00

Function Fragment_Stage_0100_Item_00()

;BEGIN CODE

ExtraMeatChance.SetValue(0)

;END CODE

EndFunction

;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 by joerqc
Link to comment
Share on other sites

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 by SKK50
Link to comment
Share on other sites

  • Recently Browsing   0 members

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