Modding Help [Unstable] Changing the MM upgrades

Discussion in 'Starbound Modding' started by TeamFluff, Dec 30, 2014.

  1. TeamFluff

    TeamFluff Void-Bound Voyager

    I've been messing around with a matter manipulator mod to understand how patching works. I wanted every version of the matter manipulator to mine out a 4x4 block. I noticed in items/tools/miningtools that there are six of these: beamaxe, beamaxe1, beamaxe2, beamaxe3, beamaxe4, and beamaxex. However, beamaxe1 doesn't appear to be used; the upgrade path appears to be beamaxe -> beamaxe2 -> beamaxe3 -> beamaxe4 -> beamaxex.

    In addition, my patch doesn't seem to work for beamaxe4. After the 'size' upgrade that takes 10 gold and 10 titanium bars, the matter manipulator appears to revert to default beamaxe4 behavior (with a 3x3 size instead of a 4x4). beamaxe3 worked just fine.

    Here's my beamaxe3 patch:
    Code:
    [
    {
        "op":"replace",
        "path":"/fireTime",
        "value":0.2
    },
    {
        "op":"replace",
        "path":"/blockRadius",
        "value":4
    },
    {
        "op":"replace",
        "path":"/tileDamage",
        "value":4
    }
    ]
    And here's my beamaxe4 patch:
    Code:
    [
    {
        "op":"replace",
        "path":"/fireTime",
        "value":0.15
    },
    {
        "op":"replace",
        "path":"/blockRadius",
        "value":4
    },
    {
        "op":"replace",
        "path":"/tileDamage",
        "value":4
    }
    ]
    To retain value to the upgrade, I intended to decrease the fireTime instead of increasing the blockRadius. However, it just doesn't work. I've tried changing things that are more visible like the inventory icon, but those changes don't work either.

    Questions:
    1. Is beamaxe1 used or not?
    2. What am I doing wrong with beamaxe4? I've checked filenames to make sure the patch file matches the original filename with .patch appended on the end.

    EDIT: After progressing further with the game, I see that the upgrade path isn't as clear as I had thought. beamaxe -> beamaxe2 -> beamaxe3 covers the first few upgrades, but the next two (10 gold/10 titanium, 20 durasteel) don't appear to have anything to do with any of the beamaxe files in the items/tools/miningtools folder.
     
    Last edited: Dec 30, 2014
  2. Olxinos

    Olxinos Scruffy Nerf-Herder

    Best Answer
    There is this
    Code:
    "enableAiCommands" : [ "upgradeBeamaxe1" ]
    in quest/tutorial/tutorial1.questtemplate
    More interesting, there are 6 upgradebeamaxe[n].aicommand in ai/, and upgradebeamaxe[n].aicommand:action/parameters seem to describe the actual ingame beamaxe upgrade. I don't know why there are 6 .beamaxe files in items/tools/miningtools and 6 .aiupgrade files (instead of one of those, but not both) and how they are used, but i feel like the .aicommand files may help to undestand the beamaxe upgrades.
     
    The | Suit likes this.
  3. TeamFluff

    TeamFluff Void-Bound Voyager

    Here's my findings after playing with this some more. It appears that the only item stats that matter are the ones on beamaxe.beamaxe. All the upgrades are effectively replaced over the top of those stats, not added.

    To test this, I replaced the altBlockRadius value to 2 and the blockRadius value to 4 in beamaxe.beamaxe.patch. In all of the other beamaxe patch files, I replaced the altBlockRadius with increasing amounts and left the blockRadius at 2. I then used /admin on a new character and ran through all the upgrades. After the first upgrade, the blockRadius remained at 4 and the altBlockRadius remained at 2. During the first size upgrade, the blockRadius dropped from 4 down to 3 (which would have been correct if the original, unmodified value of 2 had been used). The last upgrade increased the blockRadius back to 4 just like it should. Throughout the process, the altBlockRadius remained 2. Because altBlockRadius is never replaced during the upgrade process, its value carried over from the initial item. If any other beamaxe patch file had been used, the altBlockRadius would have changed.

    It looks like I cannot customize the matter manipulator upgrade path in this manner. I gave a quick check through the lua scripts, but nothing caught my eye. Any ideas on the real place to look to change how the matter manipulator is upgraded?
     
  4. Olxinos

    Olxinos Scruffy Nerf-Herder

    Best Answer
    There is this
    Code:
    "enableAiCommands" : [ "upgradeBeamaxe1" ]
    in quest/tutorial/tutorial1.questtemplate
    More interesting, there are 6 upgradebeamaxe[n].aicommand in ai/, and upgradebeamaxe[n].aicommand:action/parameters seem to describe the actual ingame beamaxe upgrade. I don't know why there are 6 .beamaxe files in items/tools/miningtools and 6 .aiupgrade files (instead of one of those, but not both) and how they are used, but i feel like the .aicommand files may help to undestand the beamaxe upgrades.
     
    The | Suit likes this.
  5. TeamFluff

    TeamFluff Void-Bound Voyager

    That's exactly it, Olxinos. The aicommands update the beamaxe parameters with each upgrade. The .beamaxe files in items/tools/mining are apparently legacy artifacts except for the original beamaxe.beamaxe file; that one is the base beamaxe before upgrades.

    This is much better. Now I can customize the text for each upgrade to match what I'm actually doing. Thanks so much for the response.
     
    The | Suit likes this.
  6. Ki-Tarn

    Ki-Tarn Orbital Explorer

    Ok where did you both find the quest/tutorial/tutorial1.questtemplate from as the unpacker in the win32 folder did not include a quest folder when it unpacked the .pak file in assets, and the ai/ folder only has four .frames files and one .aimission file.
     
  7. Olxinos

    Olxinos Scruffy Nerf-Herder

    Do you have the unstable or stable version? We're talking about the unstable, but i'm not sure you have it.
    Edit:
    mmmh, that's strange, if you have a ai folder, you should have the unstable version, but the unstable also has a quest folder, is it up to date?
     
  8. Ki-Tarn

    Ki-Tarn Orbital Explorer

    Think I had a messed up copy as it was <something> Koala and now is Upbeat Giraffe so will try unpacking again.
     
    Olxinos likes this.
  9. Zkaface

    Zkaface Scruffy Nerf-Herder

    Did you solve the problem with fireTime? It seems like the only thing upgradebeamaxe[n].aicommand don't change is the "fireTime" modifier. But why? There is no limitation, when I used to change it in beamaxe.beamaxe.
     
  10. TeamFluff

    TeamFluff Void-Bound Voyager

    There's not a problem with fireTime. Just don't put your matter manipulator upgrades in the beamaxe files and expect them to work; they go in the aicommands as modifiers. If you want your matter manipulator to always have a certain fireTime, you should be able to set it in the initial beamaxe.beamaxe file. That one value should carry over throughout the upgrade process since fireTime isn't modified by any of the aicommands.
     
  11. Zkaface

    Zkaface Scruffy Nerf-Herder

    But why it is not able to upgrade this value with aicommands? There is no other value creating a change on this,
     

Share This Page