Meridias561 Posted January 29, 2013 Share Posted January 29, 2013 Hey all. I'm sure this is going to be a rather simple question for those who are more code knowledgeable than I am so here goes. In an effort to adapt the homestead system for use in a mod I'm making, I've been digging through the code to figure out how everything ties together. In the BYOHWorkbenchScript script that is on the drafting table at the homesteads, there is this line of code:BYOHHouseCraftingTriggerScript mytrigger = (GetLinkedRef() as BYOHHouseCraftingTriggerScript)So I can figure out what this does, would someone be willing to translate that to english for me? :) Link to comment Share on other sites More sharing options...
kromey Posted January 29, 2013 Share Posted January 29, 2013 BYOHHouseCraftingTriggerScript mytrigger = (GetLinkedRef() as BYOHHouseCraftingTriggerScript)The method GetLinkedRef does exactly what it says on the tin -- it gets the reference linked to from the specified object. That there is no specified object (e.g. it's not someObject.GetLinkedRef()) is a sort of shorthand for running it on the current object, i.e. it's equivalent to self.GetLinkedRef(). The linked ref is then cast to a BYOHHouseCraftingTriggerScript object and stored in the variable mytrigger; based on these names I can only assume that the linked reference is a trigger of some kind with a script attached to it (named BYOHHouseCraftingTriggerScript), in which case this line is getting to that script so that it can call functions and/or access properties stored in it. Link to comment Share on other sites More sharing options...
Recommended Posts