Hack 'n' Slash

Hack 'n' Slash

41 ratings
Magic Lamp Old Value Reader
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
125.773 KB
Sep 18, 2014 @ 1:13pm
Sep 21, 2014 @ 8:16am
3 Change Notes ( view )

Subscribe to download
Magic Lamp Old Value Reader

Description
This mod will change a small thing with your interaction with Halcyon through the Magic Lamp. Normally when you have found a fact, you need to enter a new value without knowing what the old value was. When this mod is enabled (and is not broken with game updates), it will show you the old value in the prompt where you need to enter the new value.

No frustrations anymore when an empty value gets applied after you pressed Escape!

General information
Note from June 10th, 2015: I created this mod some time ago, and I quickly lost interest in Hack 'n' Slash after I noticed how limited the modding API was (also because of Double Fine stealth-patching certain, although unsafe, methods I used, without DF mentioning these changes somewhere, thanks again for the awesome communication DF! No... really... /s). My mod contains a rough idea of how to inject custom code in the Lua assembly code. I'm unsure if other and better tools exist nowadays. If not, go ahead and adept the code to your likings, just be sure to give me credit for that part of the code.

I probably don't have the source files anymore either, so I'm unable to fix issues if there are any. It worked last year, so if nothing drastically changed, it should still work. Have fun ;)

Technical information
At the start of loading your save, it will try to inject assembly code that will trigger when you use the lamp. This mod will only work with values that are one of the following: a string, a number or a boolean. Yes, this means that you can even change stuff that is a table with the lamp. Currently, I do not know of an easy way to support a table as well. Even if I were able to do this, the game will still crash when trying to load data from the table (since when you change it, it will be a string instead, and a string != a table).

It's probably overly complicated for such a trivial change (I mean, it only changes a few lines in Lua), but hey, here goes a first mod that actually changes something in the code that's not related to translations, however small it may be :P. Have fun!
7 Comments
aieousavren Nov 2, 2014 @ 10:40am 
This is very useful during gameplay, because sometimes I'll accidentally load the wrong location into the lamp, and then forget the original value. Thanks!
DrBlock42 Oct 26, 2014 @ 7:10am 
Hi, looks cool!
Could you maybe explain how to start to make a HaS mod, because I couldn't figure it out...
Archomeda  [author] Sep 21, 2014 @ 2:49pm 
Haha... yeah, let me rephrase that to "not explicitly mentioned" then :P
Anyway, I'm glad they added the safe functions though. Especially with tostring() while debugging and testing out stuff.

And indeed, it definitely is rediculously complicated. I really don't know if it can be any shorter, editing assembly is really tricky. At the moment I'm sorting out my disassembly helper to be less confusing though, and also cleaning up my code again. I'll see where it'll end up.
Thanks though! :)
SmashManiac Sep 21, 2014 @ 12:57pm 
It was in the release notes. They called it "Assorted other fixes". :P

Also... wow. Your code is indeed ridicuously complicated, but it's a good start for a generic assembly code editor. Good job! :)
Archomeda  [author] Sep 21, 2014 @ 8:42am 
Okay, I fixed it on my end. I do hope it's also fixed for others.
Thanks again for reporting it, I really appreciate it. Especially since it wasn't mentioned anywhere in the patch notes, which I read just in case they fixed it (since it wasn't there, I assumed it wasn't fixed).
Archomeda  [author] Sep 20, 2014 @ 5:00pm 
Oh that's fun... :(
I'll take a look at it later, thanks for reporting it :)
SmashManiac Sep 20, 2014 @ 3:35pm 
You'll need to fix your mod. Double Fine patched the loadstring() exploit you were using to access _G.