Patching/Transpiling an IEnumerator + What are OpCodes? #381
Unanswered
JArmstrongArt
asked this question in
Help and Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Got a problem I've been stuck with for the last few hours, I started a topic about this 2 days ago and got a very good answer but it was still a bit too much for me to understand without some guidance, so sorry if I'm being a nuisance.
I need to modify some lines from the following IEnumerator
The closest I've got was the following, which I was wanting to print 'hi' every time the enumerator is called which is every 5 seconds or so in-game, but it ended up printing 'hi' 5 or 6 times all at once then never again
I've tried looking around at other examples of using HarmonyX to modify IEnumerators as well as the docs but it keeps going over my head especially since I don't fully understand CodeInstructions or OpCodes.
Anyone know where I'd begin modifying individual lines from the IEnumerator? The game hasn't been updated in a long time so I'd also settle for being able to replace the IEnumerator with my own altered copy.
UPDATE: I guess I got carried away a bit and didn't realize the obvious that the coroutine itself is only called once and the looping every 5 seconds happens within the ienumerator itself, so of course it printed 'hi' 5 times then never again!
Beta Was this translation helpful? Give feedback.
All reactions