Hack 'n' Slash

Hack 'n' Slash

Ocen: 41
Magic Lamp Old Value Reader
   
Przyznaj nagrodę
Ulubione
Ulubione
Usuń z ulubionych
Rozmiar pliku
Zamieszczono
Zaktualizowano
125.773 KB
18 września 2014 o 13:13
21 września 2014 o 8:16
Listy zmian: 3 ( zobacz )

Zasubskrybuj, aby pobrać
Magic Lamp Old Value Reader

Opis
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!
Komentarzy: 7
aieousavren 2 listopada 2014 o 10:40 
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 26 października 2014 o 7:10 
Hi, looks cool!
Could you maybe explain how to start to make a HaS mod, because I couldn't figure it out...
Archomeda  [autor] 21 września 2014 o 14:49 
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 21 września 2014 o 12:57 
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  [autor] 21 września 2014 o 8:42 
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  [autor] 20 września 2014 o 17:00 
Oh that's fun... :(
I'll take a look at it later, thanks for reporting it :)
SmashManiac 20 września 2014 o 15:35 
You'll need to fix your mod. Double Fine patched the loadstring() exploit you were using to access _G.