antstubell Posted October 25, 2020 Share Posted October 25, 2020 Why do I get an error for this in papyrus fragment compiling...Alias_SurgeonAlias.GetReference().EvaluatePackage() EvaluatePackage is not a function or does not exist Link to comment Share on other sites More sharing options...
dylbill Posted October 25, 2020 Share Posted October 25, 2020 Using GetReference returns an object reference. So instead use GetActorReference: Alias_SurgeonAlias.GetActorReference().EvaluatePackage() Link to comment Share on other sites More sharing options...
antstubell Posted October 25, 2020 Author Share Posted October 25, 2020 Thanks. Could you explain to me then why this works. Both refer to unique actors.Alias_PDocAlias.GetReference().Disable() Link to comment Share on other sites More sharing options...
dylbill Posted October 25, 2020 Share Posted October 25, 2020 No problem, it's because Disable() can be run on actor and object references, where as EvaluatePackage() can only be run on Actors. Link to comment Share on other sites More sharing options...
antstubell Posted October 26, 2020 Author Share Posted October 26, 2020 I see. So a better error message would be "EvaluatePackage can only be run on an actor." Informing me that EvaluatePackage does not exist is really unhelpful and contradictory. I know none of this is your fault... just saying. Link to comment Share on other sites More sharing options...
dylbill Posted October 26, 2020 Share Posted October 26, 2020 That would be a better error message, but that would require papyrus to check for that function in all other scripts , which would be time consuming. When running a function on an objectReference, papyrus only checks the ObjectReference script, and the Form script because the ObjectReference script extends form. Just know in the future if you get that error and you know the function exists, you're trying to run it on the wrong type of property. Link to comment Share on other sites More sharing options...
antstubell Posted October 27, 2020 Author Share Posted October 27, 2020 Following what you already said, I just entered this line into papyrus fragment. Shock is an object reference property which is a Xmarker activator. Shock.GetReference().Activate(Self) Error: GetReference is not a function or does not exist Link to comment Share on other sites More sharing options...
dylbill Posted October 27, 2020 Share Posted October 27, 2020 You don't need to use GetReference() as that's for Reference Alias's. Shock is already the object reference, so just do Shock.Activate(Self) Link to comment Share on other sites More sharing options...
antstubell Posted October 28, 2020 Author Share Posted October 28, 2020 That's the first thing I did and got this error -(51,6): type mismatch on parameter 1 (did you forget a cast?) This is the complete fragment which gives that error unless I remove Shock,Activate(Self) ; surgeon mutilates bodyAlias_SurgeonAlias.GetActorReference().EvaluatePackage()Shock.Activate(Self)Utility.Wait(5); time before blood splatterBlood.Enable()Splat.Play(Splathere)Utility.Wait(35); time after blood splatterSetStage(40) Link to comment Share on other sites More sharing options...
dylbill Posted October 28, 2020 Share Posted October 28, 2020 Ah, I didn't know it was a fragment on a quest. You can't use Self because that points at the quest. So instead do Shock.Activate(shock) Link to comment Share on other sites More sharing options...
Recommended Posts