Jump to content

I'm trying to add different perk conditions to a workbench under different circumstances


JunkV3nd0r

Recommended Posts

WOAH! Thanks!
Man this is like the most helpful mod forum ever, thank you very much.

But yeah, I'll look into running it with a quest. I didn't thnik about it before you re-iterated it but that's probably the best thing to do. But I don't think using the global variable thing is that big a deal. I wrote the global variable. If someone else overrides it then yeah it'll be inaccurate but I don't see why they would.
I also tried registering for a menuopenclose event with a consumable script, but I was having problems getting it to work. maybe it'll just work better as a quest script? I'll work on it.
Thanks again for all the help! :D

HORRRAY! We did it! IT works!
So to recap:
made global variable set to 0.
Made or condition on workbench that it can be crafted if that global variable is 0
made quest that runs on start to plug into event workshop enter menu.
When event is fired variable changes to number of settlers in the workshop linked to the workbench we just activated.
Using THIS code:

Scriptname SMO_QuestTestScript extends Quest

GlobalVariable Property pMyPopulation Auto Const Mandatory
Keyword Property pLocTypeWorkshop Auto Const Mandatory
WorkshopParentScript Property pWorkshopParent Auto Const Mandatory

Event OnQuestInit()
	RegisterForCustomEvent(pWorkshopParent , "WorkshopEnterMenu")
EndEvent

 


Event WorkshopParentScript.WorkshopEnterMenu(WorkshopParentScript P, Var[] b)
ObjectReference pPlayerRef = Game.GetPlayer()
	If pPlayerRef.GetcurrentLocation().Haskeyword(pLocTypeWorkshop)
  		WorkshopScript WorkshopREF = pWorkshopParent.GetWorkshopFromLocation(pPlayerRef.GetcurrentLocation())
 		If (WorkshopREF.OwnedByPlayer == TRUE)
			If(WorkshopREF.GetBaseValue(pWorkshopParent .WorkshopRatings[pWorkshopParent .WorkshopRatingPopulation].resourceValue) > 0)
     			pMyPopulation.SetValue(WorkshopREF.GetBaseValue(pWorkshopParent .WorkshopRatings[pWorkshopParent .WorkshopRatingPopulation].resourceValue))
 			Else
      			pMyPopulation.SetValue(0)
			EndIf
		EndIf
	EndIf
EndEvent

and if the value is still 0 you can craft a chem bench without the CHARISMA perks!

THANK YOU ALL SO MUCH! XD
Is their something I have to do like close this forum posting now?

Edited by JunkV3nd0r
Link to comment
Share on other sites

  • 2 weeks later...
  • Recently Browsing   0 members

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