View previous topic :: View next topic |
Author |
Message |
curtwagner1984 How do I cheat? Reputation: 0
Joined: 27 Feb 2019 Posts: 3
|
Posted: Wed Feb 27, 2019 10:50 am Post subject: Execute code on value change |
|
|
Hello all!
I'm trying to modify Kingdoms of Amalur: Reckoning XP gain speed.
In this game, it's extremely easy to over level to remedy this I wanted to nerf the amount of XP the player is getting every time he gets any XP.
I found the memory address which stores the overall XP for the player. My idea was to trigger a function each time this value changes and nerf the XP.
For example, if the player currently has 100 XP and then he gets 10xp for killing a monster, the new value would be 110. What I would do is store the old value, subtract the new from the old (thus getting the amount XP gained) and multiply it by the nerf value. In other words:
Then:
Code: | 10 * 0.5[Nerf factor] = 5[New gain value] |
So, in the end, the new value would be 100 + 5 = 105.
This is all a good, however, I wasn't able to find how to do something that triggers code or functions on value change. Is this sort of thing at all possible?
Thank You!
|
|
Back to top |
|
|
ParkourPenguin I post too much Reputation: 140
Joined: 06 Jul 2014 Posts: 4299
|
Posted: Wed Feb 27, 2019 2:19 pm Post subject: |
|
|
That's what code injection is for.
If you must use Lua, look into debug_setBreakpoint. Note that break-on-write breakpoints must use a debug register.
You could also just use a timer and simulate it, but that might cause strange behaviour.
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
Back to top |
|
|
curtwagner1984 How do I cheat? Reputation: 0
Joined: 27 Feb 2019 Posts: 3
|
Posted: Thu Feb 28, 2019 6:35 am Post subject: |
|
|
ParkourPenguin wrote: | That's what code injection is for.
If you must use Lua, look into debug_setBreakpoint. Note that break-on-write breakpoints must use a debug register.
You could also just use a timer and simulate it, but that might cause strange behaviour. |
Thank you for your reply. I'm fairly new to CE. Are there some tutorials about how to use code injection, debug register and the timer?
|
|
Back to top |
|
|
ParkourPenguin I post too much Reputation: 140
Joined: 06 Jul 2014 Posts: 4299
|
Posted: Thu Feb 28, 2019 9:32 am Post subject: |
|
|
Go through the CE tutorial located in the "Help" menu of CE. You'll find plenty of videos and other kinds of tutorials showing the basics of code injection if you search for it.
You can also search for information on debug registers. One good way to learn is to start going down a wiki rabbit hole.
For Lua-specific help, there's documentation that can be accessed through CE's "Help" menu.
The CE Wiki has more information than it used to, but it's also sometimes misleading or wrong.
Using a search engine is always an option to look for examples and problems other people have had.
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
Back to top |
|
|
curtwagner1984 How do I cheat? Reputation: 0
Joined: 27 Feb 2019 Posts: 3
|
Posted: Sat Mar 02, 2019 10:55 am Post subject: |
|
|
Thank You!
|
|
Back to top |
|
|
|