Search the Community

Showing results for tags 'mod'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General Discussion
    • Let's Talk About Double Fine
    • Fan Art
    • Topics from the Universe Outside of Double Fine
    • Help I need support!
  • Double Fine Games
    • Psychonauts
    • Headlander
    • Full Throttle Remastered
    • Day of the Tentacle Remastered
    • Broken Age
    • Massive Chalice
    • Grim Fandango Remastered
    • Costume Quest
    • Hack 'n' Slash
    • Spacebase DF-9
    • The Cave
    • Iron Brigade
    • Stacking
    • BrĂ¼tal Legend!
    • Double Fine Games of Yore
  • Double Fine Presents
    • Everything
    • Knights and Bikes
    • Gnog
  • Archived boards
    • Double Fine Adventure
    • Amnesia Fortnight
    • Bugs and Technical Support

Calendars

  • Community Calendar
  • Gaming Events
  • Double Fine Events

Categories

  • Articles

Found 1 result

  1. Changing code in mods

    In a game mod, is it possible to change the actual code in a game asset? I mean the disassembled instructions, as opposed to just replacing globals and such things (as in this example). All my attempts have just resulted in a failure to load the overwritten asset file, "Failed to load {file} (room may be corrupted)". A simple example: local fileName = "Data/Content/Game/DorkForest/Rooms/BobTrap.lua" local disasm = scripts.disassemble(scripts.load(fileName)) local code = disasm.proto.protos[4].code if #code ~= 305 then error("Wrong proto?") end for i = 95,305 do code[i-5] = code[i] end for i = 301,305 do code[i] = nil end assets.overwrite(fileName, scripts.reassemble(disasm)) protos[4] is the closure assigned to BobTrap.playMumbles. The deleted instructions 90 to 94 are -- SELF 10 1 291 -- MOVE 12 8 -- LOADK 13 43 -- LOADK 14 44 -- CALL 10 5 1 scene:speakLineLeft(alicePortrait, "Hey! You're a sprite, right?", "Default3") I checked that no JMP instructions jump past this code in either direction. So I expected this would just result in skipping one line of dialogue when Bob is freed. But entering the second room just gives the "(room may be corrupted)" error. Also, if I do get replaced code working, is there a good way to insert my own assembly instructions? They appear to be some class-like object, at least to support inst:GET_OPCODE_NAME() etc., but there's no obvious interface to create new objects of that type. Can I just copy one with the correct opcode type from another disassembled function and do inst:SETARG_A() etc.?