New modder requesting advice on adding custom schematics.

Discussion in 'Modding and Scripting Support' started by Khaldore, Nov 11, 2007.

Remove all ads!
Support Terra-Arcanum:

GOG.com

PayPal - The safer, easier way to pay online!
  1. Khaldore

    Khaldore New Member

    Messages:
    6
    Likes Received:
    0
    Joined:
    Nov 11, 2007
    (as a pre-introduction, I want to apologize beforehand for this ungodly long post... came out far longer than I planned, but I wanted to explain what I wanted as best as possible)

    'Lo everyone... I've been lurking around for the past week or two reading, searching, and learning what I can about modding this incredible game. Since I'm not out to make my own full-blown module yet, I've decided to focus on making changes to the main storyline (so to speak). Customized backgrounds were easy to figure out and implement, but I'm starting to crave a bit more...

    I've got a soft spot for Tech characters (with a bit of conveyance magick thrown in to dull the ache from walking nearly everywhere), so the more schematics I can get my hands on, the better. I've noticed quite a few items go unused as far as schematics go (the shotgun and power axe come to mind, though I could swear I saw a schematic using the latter once upon a time).

    In a nutshell, I'd like to add more variety to the available schematics, as well as tweaking some of the existing ones. Granted, the latter is probably far easier than the former, but *shrugs*. I'm well aware it may (more likely *will*) take some hex editing and script writing, but I'll manage.
    • To go on a tangent for a moment:
      I've been digging around in the schematic_text and schematic.mes files, and I've noticed that some of the schematic placements in-game don't match up to their placements in these files... Fuel being the most obvious to me. Both files list it as a Chemistry schematic, but it shows up as Explosives in-game. The Clockwork Physician is another... files: Herbology, in-game: Mechanical. That strikes me as incredibly odd, but the in-game placements make more sense, so I'm not sure what difference it makes.
    Anyhow, to the meat of the problem. It has to do with this post:
    http://www.terra-arcanum.com/phpBB/view ... hp?t=13230
    I'm reading this one of two ways, and if possible, I'd like some clarification as to which (if either) is correct:
    • A) User-created schematics will always go to the Herbology tab, unless both ingredients are already used in a given discipline, or
      B) User-created schematics will go into the Herbology tab only if neither of the ingredients is already used in a given discipline.
    If that comes across as a bit confusing, allow me to elaborate: let's say I create a new firearm. The ingredients would be a Fine Revolver and Metal Plates, let's call it a Low Recoil Revolver (the plates adding weight to reduce kickback, thereby increasing firing speed and accuracy). Obviously, this would be intended for the Gun Smithy discipline, which brings me to my question:

    Since the metal plates aren't used in any default Gun Smithy schematic (but the Fine Revolver is), would the game place it under the Gun Smithy discipline, or Herbology?
     
  2. rroyo

    rroyo Active Member

    Messages:
    3,319
    Likes Received:
    0
    Joined:
    Oct 13, 2006
    Welcome to the forum, Khaldore!

    Ok, the schematics... Those can be annoying because of where the game engine places them.

    Having created a small handful of new ones myself, I can say that; normally; as long as one ingrediant is of a specific disipline and has been used in a schematic of that disipline before, then the new schematic will go to that specific disipline.

    For example: You mentioned creating a gun from a fine revolver and metal plates. I did a fast test using those and set the result for a hand cannon. Not a problem - it went straight into the found Gunsmith section.

    On the other side of the coin though, when I made Create Vendigrothian Padded Gloves (leather gloves and bandages), the schematic went into Herbology even though leather gloves had been used in Smithy.

    In other words, creating new schematics is like a crap-shoot. Will it go where I want it to?

    And you're right. The file locations of fuel, the Clockwork Physician, and even the Iron Clan Key don't make sense, but - as long as they work.....

    Edit: One other thing. If I remember correctly, you're stuck with whatever comes stock with the game for your end result. The Low-Recoil Pistol doesn't exist in the stock game, and modifying a prototype to make one won't let it be "created" with a schematic.

    If I'm wrong, I apologise now.
     
  3. Khaldore

    Khaldore New Member

    Messages:
    6
    Likes Received:
    0
    Joined:
    Nov 11, 2007
    Thanks for the reply, rroyo... for the most part, that's precisely the information I was hoping for.

    Unfortunately, you've got a good point about adding 'new' items to the stock campaign. The description.mes file does state only to modify it if adding prototypes, but that doesn't get around the restriction you mentioned. Nor have I found a way to point the items to their respective .art files. Perhaps that's something that can only be done via the WorldEd.

    In any case, I'll keep chopping away at it, maybe I'll get lucky... simply felt there was a few things missing. Of course, if all else fails, I'll bite the bullet and start honing my WorldEd skills. :)
     
  4. rroyo

    rroyo Active Member

    Messages:
    3,319
    Likes Received:
    0
    Joined:
    Oct 13, 2006
  5. Khaldore

    Khaldore New Member

    Messages:
    6
    Likes Received:
    0
    Joined:
    Nov 11, 2007
    Well, after a couple of days of poring over nearly every file I could think of, I've had some pretty nifty progress. As expected, I've had to replace a schematic to place one of mine in (as opposed to stacking it on top, but I've not given up on that yet :p ), but...

    I've managed to do everything but get the .art files correct... although I'm pretty sure I can nail those down too, but for one small problem: My copy of bmp2art keeps erroring out, and creating empty .art files (about 1.1k in size).

    All I did was used art2bmp, and made a few minor edits (using The GIMP, I've found it preserves the original image attributes the best) and saved the files with new names as 256 color, 8-bit bmps (just like the originals). Tried using both the drag-drop method, as well as command-line, with the same result...

    [​IMG]

    Oddly enough, I don't get that error using a 24-bit bmp (16.7m colors), but the end result is the same. Any ideas?

    As a side note, here's the sequence of what I've done so far:
    • 1) Chose a weapon to replace (Acid Gun)
      2) Used DKoepp's Editor to create a copy of the Acid Gun's proto file with the stats I wanted for my weapon (resembles an improved Fine Revolver)
      3) Opened description.mes, schematic.mes, schematic_text.mes, and interface.mes and replaced all instances of the Acid Gun with the Low Recoil Revolver
      4a) Fired up my hex editor and altered the following offsets: 0x143/0x144 (unknown/known names), and 0x1C2 (to make it a one handed weapon)
      4b) (note: changing the 0x24/0x25 offset wasn't necessary, as it's still the same proto file)
      5) Overwrote the original proto with this modified version
    And voila, the LRR is ingame, although due to my issues with bmp2art outlined above the artwork still resembles the Acid Gun, and the schematic result image is missing. Once I get that squared away, I'll finish editing the necessary .mes files and see what happens. :)

    (failing that, I'm going to hex the proto again to point at the Fine Revolver artwork, since they're fairly similar in their look anyhow... at least to see if it's doable completely)
     
  6. rroyo

    rroyo Active Member

    Messages:
    3,319
    Likes Received:
    0
    Joined:
    Oct 13, 2006
    I'm a bit short on time this morning so I'll have to just answer the question about BMP2ART.
    It's a picky S.O.B. in that it only wants to create 1 image per file and is very selective about the sizes it will convert.

    TONGSyaBASS was good enough to send me a list of sizes that worked for him and I've managed to expand it.
    Here ya go:

    12 X 15
    18 X 24
    22 X 51
    26 X 32
    30 X 30
    30 X 58
    30 X 99
    38 X 74
    46 X 50
    46 X 118
    49 X 32
    60 X 62
    60 X 63
    62 X 36
    62 X 54
    62 X 58
    62 X 60
    63 X 58
    63 X 61
    82 X 60
    90 X 60
    90 X 64
    98 X 116
    118 X 193
    122 X 120
    126 X 146
    142 X 62
    146 X 126
    158 X 43
    158 X 167
    182 X 224
    185 X 114
    210 X 300
    218 X 189
    242 X 140
    294 X 118
    294 X 218 (Used for schematics)*
    350 X 180 (Largest known size)

    *The schematic size is a bit smaller than original so you may see a black line below the picture when you bring your new one up.
     
  7. Khaldore

    Khaldore New Member

    Messages:
    6
    Likes Received:
    0
    Joined:
    Nov 11, 2007
    Ah, that could explain a great deal... I've simply resaved the files in the size they converted from the .art format to (in the schematic case, 295x225)... I'll do a bit of resizing and try again.

    Another odd issue... been re-reading the proto docs, in particular, the MiscProtoOffsets, and according to that, the offsets for the the art are 0x184 (inventory), 0x18C (wielded on the sprite), and 0x1C6 (equipped). Did a bit of checking against a couple protos, and here's what I found:

    In the case of the fine revolver, it uses #128 in all the .mes art files, which corresponds to 80 in hex. In every case, hex 80 is in all those positions. On the other hand, the Acid Gun (which I replaced with my LRR) uses #216, which is D8 in hex. That particular number is only in *one* location in the acid gun's proto: offset 0x190.

    Before I start hacking that apart tho, I'll work on resizing the bmps to something appropriate, and change the entries in the .mes files to match.

    Edit: Worked like a charm for the schematic images, they converted clean as could be... working on the equip/inventory images now.
    Edit2: No go... as pointed out above, the offsets for inventory/equip art are all over the map, so to speak... gonna just use existing images for now, giving me a headache. :p
     
  8. rroyo

    rroyo Active Member

    Messages:
    3,319
    Likes Received:
    0
    Joined:
    Oct 13, 2006
    I'm sorry to say but someone else needs to jump in here and help you with the hex-editing.
     
  9. Khaldore

    Khaldore New Member

    Messages:
    6
    Likes Received:
    0
    Joined:
    Nov 11, 2007
    That's quite all right, I appreciate all the help you've given me so far :)

    Here's an interesting note, adding on to my comments about schematic.mes vs. in-game location of learned schematics: On a whim, I replaced the Bellringer with the Tesla Pistol (which should have placed it in Electrical, where the bellringer was)... it ended up in Gun Smithy. Not what I expected at all, considering where its big brother the Tesla Gun is.

    So here's a theory I'm gonna test out... gonna start from scratch and add *only* new schematic result .art files, now that I know the trick (thanks again, rroyo) to doing those. Weapon editing is golden with DK's editor, then it's just a matter of changing a few easy-to-find hex values to match whatever's needed.

    Mes editing is a breeze, so I intend to (essentially) totally rewrite the schematic, tech, and schematic_text .mes files with all-new stuff. Placement of new items within the .mes files doesn't seem to much matter, given the results I've had so far. And even if it does, I don't care, as it's only the single player game :)

    Again, thank you so much for all the advice so far, it's been a great help. I do hope other people will add to this, I never get tired of getting good pointers :)
     
Our Host!