archabaddon Posted January 9, 2019 Share Posted January 9, 2019 (edited) Trying to debug this mod (https://www.nexusmods.com/fallout4/mods/10029/?tab=forum&topic_id=7293626) since it looks like it stopped working a while back, and I'd really like to use it for my RP sensibilities. The original modder I got the Creation Kit and tried to recompile using the Papyrus Script Compiler and received the following error: "<My local PC Steam Path>SendCompanionsHome.psc(84,27): cannot call the global function FindInIntArray on the variable Self, must call it alone or on a type"Here's the function in question: ; Users can also optionally call this function. Function ResetActor(Actor akActor) If (akActor) ; Search if we have the default location for this actor. int locationIndex = Self.FindInIntArray(akActor.GetActorBase().GetFormID(), CompanionIDs) ; Debug.Notification("Form ID: " + akActor.GetActorBase().GetFormID()) If (locationIndex != -1) WorkshopParent.UnassignActor(akActor as workshopnpcscript, True, True) Self.SetHomeInternal(akActor, DefaultHomeLocationIDs[locationIndex]) Else Debug.Notification("No default home location exists for your companion.") EndIf EndIf EndFunction My CompSci is a little rusty, but I don't know enough about actor save info to know how to parse the object's info to see if they have a start location, or if the function comes up with a -1 to trigger the error text. Personal notes: I'm not sure the Self argument is necessary, since the akActor should assume that the actor currently engaged in dialogue is the active actor.Removing the Self argument here and in the argument after this in the script (not shown) allows the script to compile successfully. I'm just not sure it would work correctly. I'm also a rookie as to how I would compile this into a mod (from the Papyrus script) to upload if the above alteration fixes the issue. Any help would be appreciated. I'm bummed I can't send Piper back to her little sister, Nick back to his office, etc. TIA Edited January 9, 2019 by archabaddon Link to comment Share on other sites More sharing options...
Deleted49413338User Posted January 12, 2019 Share Posted January 12, 2019 Do companions have an actor type? Link to comment Share on other sites More sharing options...
Carreau Posted January 12, 2019 Share Posted January 12, 2019 This mod has been on my radar to update for a while. I keep meaning to do it, and then I get distracted by life. The particular error there is happening on line 84, where the script is calling FindInIntArray(). It's a global function to the script, and shouldn't be called on self. Reg made the original mod when all we had were decompilers and XEdit. Most of the decompilers will add things like self in front of global scripts, so he probably thought at the time that since the decompiler was adding stuff like that to scripts that he should too. The simple fix, here, is to remove the call on self for that call and for the call a few lines down for SetHomeInternal() Link to comment Share on other sites More sharing options...
archabaddon Posted January 13, 2019 Author Share Posted January 13, 2019 This mod has been on my radar to update for a while. I keep meaning to do it, and then I get distracted by life. The particular error there is happening on line 84, where the script is calling FindInIntArray(). It's a global function to the script, and shouldn't be called on self. Reg made the original mod when all we had were decompilers and XEdit. Most of the decompilers will add things like self in front of global scripts, so he probably thought at the time that since the decompiler was adding stuff like that to scripts that he should too. The simple fix, here, is to remove the call on self for that call and for the call a few lines down for SetHomeInternal()Thanks for your reply and the background on XEdit and why the Self argument is there. This is what I thought and the mod seems to compile without the Self calls. Being new to mods, I guess I just need to know at this point how to use the Creation Kit to take this from a PSC file to a PEX file for testing. Could you point me in the right direction? Link to comment Share on other sites More sharing options...
Recommended Posts