Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to call papyrus methods/functions inside c++ plugin? #127

Open
ZikkeyLS opened this issue Jul 5, 2022 · 3 comments
Open

How to call papyrus methods/functions inside c++ plugin? #127

ZikkeyLS opened this issue Jul 5, 2022 · 3 comments

Comments

@ZikkeyLS
Copy link

ZikkeyLS commented Jul 5, 2022

I have really limited knowledge about the papyrus VM. My problem is that I don't know how to properly call any papyrus functions or methods (like placeatme).

I tried to execute the DispatchMethodCall, but it just doesn't work in the game. (all arguments are fully filled in)
return vm.DispatchMethodCall2((*self)->handle, className, functionName, args, functor);

Can you give an example of how to use any of the papyrus methods through a virtual machine? For example, PlaceAtMe.
(I am using latest CommonLibSSE version)

@Ryan-rsm-McKenzie
Copy link
Owner

Invoking papyrus methods is very tedious and error prone due to the asynchronous nature of the VM. If you want to invoke a method exposed in a native game script, then I would recommend you disassemble the function in IDA and re-implement the logic by hand. It will be much faster and easier this way.

@JHansen13
Copy link

Any tutorials you would recommend on disassembly and re-implementation? I'm new to SKSE dev but have experience with Papyrus. Seeing how the papyrus functions work would help me learn a lot

@ZikkeyLS
Copy link
Author

ZikkeyLS commented Jan 8, 2023

@JHansen13 I can only recommend you to watch source code of SKYMP. (skyrim multiplayer)

alandtse pushed a commit to alandtse/CommonLibVR that referenced this issue Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants