Help! Help with adding coins

A.Flores

Platinian
Hi everyone. In dump.cs, I found this method:
Code:
// RVA: 0x16657f8 VA: 0x77a6ad07f8
 public Void AddCoins(Int32 amount, CoinsEarnedMethod earnedMthod, Boolean storeBackup) { }
I tried to hook it using different methods to call it, and it works; coins are added under certain conditions.

But I'm interested in whether it's possible to call such methods in the LGL menu when a switch is pressed in the running game. That is, I want the balance to be increased by, for example, 5000 coins when the button is pressed
 
From my understanding,you wan call the method whenever you click "some button" right ?

When you hook the method,the method will be called depending on the game flow.For example,

-the game will only called this method when you pickup some coin.

So in short,you wan to "call" this method "freely" whenever you wan ?

Is this correct ?

If the method is "static" without an "instance",you can invoke the method freely whenever you wan.

But this method have their instance or their own class.There are two method you can accomplish this.

1. If the class has update method or whatever method that be called frequently,you can called this method inside a method that frequently called.

2. You need to make a function pointer for the instance of the class.Whenever you wan to call the method freely,you need to call the instance of the class first,then invoke the method.I think you can find the tutorial at he tutorial section.One of the senior member has share the way he find and make pointer of any instance of class.I forget what the title.
You understood everything correctly.
If the method is static or if there is another method in the class that is frequently called, I don't encounter any issues. However, in this case, the method is not static, and there are no other methods in the class that are frequently called.

Regarding the guide on the forum, it's probably this one: Finding & Creating instance of any classes and Static fields, methods.
I haven't fully figured it out. The game either crashed when trying to add coins or nothing happened
 
You understood everything correctly.
If the method is static or if there is another method in the class that is frequently called, I don't encounter any issues. However, in this case, the method is not static, and there are no other methods in the class that are frequently called.

Regarding the guide on the forum, it's probably this one: Finding & Creating instance of any classes and Static fields, methods.
I haven't fully figured it out. The game either crashed when trying to add coins or nothing happened
Drop the class,method including your code for calling the instance of the class and invoking the method.

Lets see what we can improve.
 
Back
Top Bottom