MaddDreamer Posted November 29, 2017 Author Share Posted November 29, 2017 (edited) I feel like im so close, but i just cant get my head around it no matter how hard I try.Child scriptFormList Property DGPLocations Auto Function GoDungChild (int iQuestStage) Actor PlayerRef = Game.GetPlayer() int iIndex = DGPLocations.GetSize() if iQuestStage == 111 PlayerRef.MoveTo(DGPLocations.GetAt(0)) EndIfEndFunction The master script seems to call upon the child but because there are errors with the child it wont compile. The error on the child script I get, (9,14): type mismatch on parameter 1 (did you forget a cast?), what does this mean?The scripts for determining the location, once the quest stage is set, have been attached to the quest and the activator for the portal has a script that calls the function from the quests when activated if that helps show what I'm doing.any leads? Edited November 29, 2017 by MaddDreamer Link to comment Share on other sites More sharing options...
JonathanOstrus Posted November 29, 2017 Share Posted November 29, 2017 (edited) The formlist.GetAt() returns generic form. You need to cast as ObjectReference. Try PlayerRef.MoveTo(DGPLocations.GetAt(0) as ObjectReference). Edited November 29, 2017 by BigAndFlabby Link to comment Share on other sites More sharing options...
MaddDreamer Posted November 29, 2017 Author Share Posted November 29, 2017 so obvious, even ck wiki says to do that haha. Yes that helped, the master and child are compiling. I think i only need help with one more thing, when i compile the activator, I get the error : argument iqueststage is not specified and has no default value. Does this mean on the activator I need to define the quest in the properties? Scriptname DrmGatePortAct extends ObjectReference {Script for activator to call function attached to quest}DrmGatePortMaster Property DGFunction Auto {refrence to master script for portal}Event onActivate (ObjectReference akActionRef) DGFunction.GoDungMaster()EndEvent Link to comment Share on other sites More sharing options...
JonathanOstrus Posted November 29, 2017 Share Posted November 29, 2017 Assuming that DGFunction.GoDungMaster() is calling a function to the script on the quest, the function should look something like this: ScriptName DrmGatePortMaster Extends Quest Function GoDungMaster() int iQuestStage = self.GetStage() if iQuestStage >= 110 && iQuestStage < 140 ; instead of doing a whole bunch of if branches in the master make a simple scope check (self as DrmGatePortChild1).GoDungChild(iQuestStage) elseif iQuestStage >= 140 && iQuestStage < 170 ; another scope check. how many quest stages in the range can be larger if you need (self as DrmGatePortChild1).GoDungChild(iQuestStage) endif EndFunction And then your child script would look like this: Scriptname DrmGatePortChild1 Extends Quest Function GoDungChild (int iQuestStage) ; some stuff ; ... if iQuestStage == 111 ; do more stuff endif EndFunction Alternatively the child script who should be on the same quest could do the GetStage itself so you don't have to pass it like this: Scriptname DrmGatePortChild1 Extends Quest Function GoDungChild () ; just call this with GoDungChild() instead. int iQuestStage = self.GetStage() ; some stuff ; ... if iQuestStage == 111 ; do more stuff EndIf EndFunction On another note, thinking about it this solution may lend more towards being able to do future additional destinations through updates. You would just create a new child script, make another form list with the additional locations, then just add another if check in the master script. Link to comment Share on other sites More sharing options...
MaddDreamer Posted November 30, 2017 Author Share Posted November 30, 2017 all the scripts are compiling meaning i can test, but when i use the activator in game it does nothing Scriptname DrmGatePortChild extends DrmGatePortMasterFormList Property DGPLocations Auto Function GoDungChild (int iQuestStage) int iIndex = DGPLocations.GetSize() Actor PlayerRef = Game.GetPlayer() if iQuestStage == 111 PlayerRef.MoveTo(DGPLocations.GetAt(0) as ObjectReference) EndIfEndFunction Scriptname DrmGatePortMaster extends QuestFunction GoDungMaster() int iQuestStage =self.GetStage() if iQuestStage >=111 && iQuestStage <211 (Self as DrmGatePortChild).GoDungChild(iQuestStage) EndIfEndFunction Scriptname DrmGatePortAct extends ObjectReference {Script for activator to call function attached to quest}DrmGatePortMaster Property DGFunction Auto {refrence to master script for portal}Event onActivate (ObjectReference akActionRef) DGFunction.GoDungMaster()EndEvent Link to comment Share on other sites More sharing options...
JonathanOstrus Posted November 30, 2017 Share Posted November 30, 2017 Code looks good from what I can tell. Two things that might be causing issue:Properties are not set correctly for one of the scripts. The object reference in the formlist is invalid. Usually because it's not persistent or loaded when trying to be used.If you have papyrus log debugging turned on take a look at the debug log and see if you find any errors at the time you try to use the activator. You can also put in Debug.Trace lines at different locations of the functions to see which are firing and where it is failing. My primary suspicion is that the object reference in the formlist is wrong. Therefore when it's trying to do the moveto command it fails and should spit out an error to the log. Link to comment Share on other sites More sharing options...
MaddDreamer Posted December 3, 2017 Author Share Posted December 3, 2017 Everything runs, up until its time to teleport, so maybe something wrong with the formlist, but i dont have any ideas. The form list has a single unique id static object xmarker and said marker placed in an other cell Link to comment Share on other sites More sharing options...
Recommended Posts