jaredlll08 / ModTweaker

ModTweaker is an addon for CraftTweaker, which provides Integration for an amount of mods.
MIT License
69 stars 63 forks source link

[Suggestion] Iguana's Tinker Tweaks - XP #241

Closed MagisterXero closed 9 years ago

MagisterXero commented 9 years ago

I believe this one falls under Modtweaker...

Anyway, nearly every other aspect of tools can be modified in the scripts, but it looks like tool XP, which is something I assume is being added by Iguana, is not able to be changed via script.

Any chances we could get that one added in?

UndeadZeratul commented 9 years ago

Correct me if I'm wrong, but can't you just tweak each material's stats using ITT to begin with, including their XP stat? Why do you need ModTweaker to do this?

MagisterXero commented 9 years ago

I have a modtweaker script that goes in and dynamically updates every (currently editable and meaningful -- meaning not shoddy/reinforced) value for TiC tools, using a set of equations and variables based on arrays/custom defined difficulty/attack/durability/speed/handle/damage ratings.

While I could edit the values directly in ITT, it's just more valuable to me to be able to add it in my script

UndeadZeratul commented 9 years ago

Ah, fair enough. I was under the impression you were just trying to change a stat here and there; carry on.

MagisterXero commented 9 years ago

To make it a bit more understandable:

In my current modpack, I have approximately 98 different valid materials for which I can modify the values of. In ITT, each material is printed out on its own line, and each attribute on its own line. (10 lines per material + 1 buffer space) This ends up being close to about 1100+ lines of things to edit or view. Quite tedious :-1:

My script, however, is a mere 86 lines of code, meaning I have more actual materials being modified, than I have lines of code =P

Oh and, the first 26 lines of that scripts are comments... xD

UndeadZeratul commented 9 years ago

:o I would very much like to see an example of your changes if you don't mind, do you have them posted anywhere?

MagisterXero commented 9 years ago

The changes themselves are... rather specific for an "RPG" esque genre where monsters get stronger and stronger as you move out from spawn area, or go into other dimensions. (Done via MobProperties) So the damage values on some of the "Higher End" metals might be quite high is you are just using it as is.

But it's very easily tweaked, provided that you line up the array values appropriately Also, I'm sure that many many many people would enjoy having this particular script.

Please remember to keep the credits to in there if you use it :)


// File Explanation:
/*
    This file is used to auto-calculate all Tinker Tool values on the fly.
    The ratings are based on an "Intended Purpose" basis. Purposes are as followed:
        0 - Multi-purpose Tool
        1 - Weapon focused
        2 - Tool focused (mining/durability)
        3 - Handle focused
        4 - XP Modifier focused (currently not implemented in ModTweaker/MineTweaker)
        5 - Nerf nerf

    When taking these materials into consideration for "intended purpose" copy the values into a spreadsheet from the following arrays:
        materials
        purposeIDs
        difficultyRatings
        dimensionIDs (optional, use if you have a multi-dimension world where certain metals materials be obtained from, or if you want to support materials from The End/Nether/Overworld/Etc)

    Putting these values into a spreadsheet will make your life much easier when trying to line up the values.

    Each material is given a designated "Difficulty of being obtained" where most of the values are calculated based on.
    The rest of the ratings allow for intended purposes to create variation, and extremities for sacrifices in other areas.

    All Credit to: MagisterXero/FiromisCaine

*/

var damageRatings = [3, 7, 1, 1, 1, 1] as int[];
var durabilityRatings = [3, 2, 5, 4, 1, 1] as int[];
var handleRatings = [0.5, 0.2, 0.8, 1.65, 0.3, 0.01] as float[];
var xpRatings = [0.86, 1.0, 0.77, 0.6, 0.35, 0.01] as float[];
var speedRatings = [3, 1, 9, 2, 2, 0] as int[];
var dimensionRatings = [1, 2, 3, 4, 5, 5, 6, 6, 6.5, 7, 7.3, 7.6, 8, 8.5, 9, 9.3, 9.6, 10, 10.3, 10.7, 11, 11.2, 11.5, 11.8, 12, 13, 14, 14, 14] as float[];

var materials = ["Wood", "Cactus", "Cardboard", "Flint", "Paper", "Stone", "Bone", "Certus Quartz", "Iron", "Plastic", "Silver", "Angmallen", "Brass", "Copper", "Lead", "Nickel", "Bronze", "Electrum", "Glue", "Hepatizon", "Manasteel", "Peridot", "Platinum", "Ruby", "Sapphire", "Thaumium", "Yellorium", "Invar", "Slime", "Cyanite", "Damascus Steel", "Ludicrite", "Obsidian", "Alumite", "Amethyst", "BlueSlime", "Blutonium", "Enderium", "Jade", "Limonite", "Rosite", "Signalum", "Steel", "Lumium", "Pink Slime", "Elementium", "Bedrockium", "Terrasteel", "Void Metal", "Nether Quartz", "Netherrack", "Midasium", "PigIron", "Bloodwood", "Darkwood", "Ghostwood", "Fusewood", "Ardite", "Cobalt", "Manyullyn", "Emberstone", "Bloodstone", "Crystalitestone", "Skeletal", "Prometheum", "Fiery", "Ironwood", "Knightmetal", "Steeleaf", "Astral Silver", "Carmot", "Deep Iron", "Black Steel", "Oureclase", "Mithril", "Quicksilver", "Haderoth", "Ceruclase", "Inolashite", "Shadow Iron", "Shadow Steel", "Ignatius", "Vyroxeres", "Orichalcum", "Celenegil", "Vulcanite", "Kalendrite", "Amordrine", "Sanguinite", "Eximite", "Desichalkos", "Atlarus", "Adamantine", "Tartarite", "Ender Amethyst", "Fairy", "Pokefennium", "Red Aurum"] as string[];
var purposeIDs = [0,    1,  4,  1,  4,  1,  0,  0,  0,  0,  4,  4,  2,  2,  2,  0,  0,  4,  4,  0,  1,  1,  2,  1,  1,  1,  0,  1,  3,  0,  1,  3,  2,  1,  1,  3,  0,  2,  2,  0,  3,  2,  1,  2,  3,  0,  3,  4,  1,  1,  0,  4,  0,  1,  2,  0,  1,  0,  2,  1,  0,  1,  1,  0,  0,  1,  2,  1,  4,  4,  3,  1,  1,  2,  0,  4,  1,  0,  1,  0,  1,  0,  0,  2,  1,  0,  0,  1,  1,  0,  1,  4,  0,  1,  3,  4,  0,  1] as int[];
var dimensionIDs = [0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  2,  3,  4,  6,  8,  8,  8,  8,  9,  11, 12, 12, 13, 14, 14, 14, 15, 15, 16, 16, 18, 19, 20, 20, 21, 22, 22, 23, 24, 24, 25, 25, 25, 26, 27, 27, 27] as int[];
var difficultyRatings = [1, 2,  2,  2,  2,  2,  3,  3,  3,  3,  3,  4,  4,  4,  4,  4,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  6,  6,  7,  7,  7,  7,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  9,  11, 14, 15, 15, 16, 4,  4,  5,  5,  6,  6,  6,  7,  8,  9,  10, 9,  11, 12, 13, 24, 17, 14, 16, 15, 27, 29, 30, 32, 33, 36, 37, 39, 40, 42, 41, 44, 45, 46, 48, 53, 49, 50, 60, 55, 56, 68, 60, 62, 76, 42, 72, 85, 100,] as int[];

for x, material in materials {

    var purposeID = (purposeIDs[x]);
        var damageRating = damageRatings[purposeID];
        var durabilityRating = durabilityRatings[purposeID];
        var handleRating = handleRatings[purposeID];
        var xpRating = xpRatings[purposeID];
        var speedRating = speedRatings[purposeID];
    var difficultyRating = (difficultyRatings[x]);
    var dimensionID = (dimensionIDs[x]);
        var dimensionRating = dimensionRatings[dimensionID];
    print(material + "-- Damage Rating:" + damageRating + " Durability Rating:" + durabilityRating + "-- Handle Rating:" + handleRating + "-- XP Rating:" + xpRating + "-- Purpose ID:" + purposeID + "-- Difficultiy Rating:" + difficultyRating + "-- Dimension ID:" + dimensionID + "-- Dimension Rating:" + dimensionRating);

    var damage = (difficultyRating + (((damageRating + 4) * dimensionRating) + (difficultyRating / 2.5) - 10) / 5);
    var baseDurability = 175 + (((difficultyRating * dimensionRating) * durabilityRating * 2 ) / 3.5);
    var handleModifier = (((handleRating * 8) * dimensionRating + (difficultyRating / 7)) / 11.53);
    var miningSpeed =  (225 * dimensionRating) / 2 + (difficultyRating * ((speedRating * 3) / 2));
    if (miningSpeed == 0) {
        miningSpeed = 40;
    }
    var bowDrawSpeed = 26 + ((90 + baseDurability) / miningSpeed) * 53;
    if (bowDrawSpeed == 0) {
        bowDrawSpeed = 10;
    }
    //var xpModifier = ((5 + (xpRating * dimensionRating)) / (1 + difficultyRating / dimensionRating ) * xpRating);
    //if (xpModifier == 0) {
    //  xpModifier = 0.1;
    //}
    var arrowFlightSpeed = 2 + bowDrawSpeed / 21;
    var weight = (((baseDurability * (damage / 13))) / arrowFlightSpeed / (29 + miningSpeed / (damage + difficultyRating))) + 1;
    var breakChance = ((baseDurability / 100) / weight);

    print(material + "-- Damage:" + damage + " Durability:" + baseDurability + "-- Handle:" + handleModifier + "-- Speed:" + miningSpeed + "-- DrawSpeed:" + bowDrawSpeed + "-- FlightSpeed:" + arrowFlightSpeed + "-- Weight:" + weight + "-- BreakChance:" + breakChance);

    mods.tconstruct.ToolStats.setBowDrawspeed(material, bowDrawSpeed);
    mods.tconstruct.ToolStats.setBowFlightSpeed(material, arrowFlightSpeed);
    mods.tconstruct.ToolStats.setArrowMass(material, weight);
    mods.tconstruct.ToolStats.setArrowBreakChance(material, breakChance);
    mods.tconstruct.ToolStats.setDamage(material, damage);
    mods.tconstruct.ToolStats.setHandleModifier(material, handleModifier);
    mods.tconstruct.ToolStats.setDurability(material, baseDurability);
    mods.tconstruct.ToolStats.setSpeed(material, miningSpeed);
}
UndeadZeratul commented 9 years ago

Oh wow, yeah that's way more in-depth than I've ever ventured to try in any of the packs I've worked on. While I won't take it, I'll definitely use it as an example on how to mess with TiC Tool Stats. Thanks!

bookerthegeek commented 9 years ago

That is amazing. And I have no qualms about asking if you care if I use this as a basis for my pack?

MagisterXero commented 9 years ago

Go for it, just remember to leave the comments in, please :)

Yulife commented 9 years ago

Wow :+1:

MagisterXero commented 9 years ago

So yeah Yulife, think you can hook this one up in the next build maybe? xD

Yulife commented 9 years ago

Uhm....thats a script though :) I can post it somewhere in the documentation though!

MagisterXero commented 9 years ago

No no, I mean. Is setting tool XP already implemented via script?

jaredlll08 commented 9 years ago

(Yulife is not a coder, ok well he is, but not this stuff... And he isn't a person with enough power to force me to addsupport for a mod) It will come, rventually, maybe, will have to look at the api.

On Wednesday, September 9, 2015, MagisterXero notifications@github.com wrote:

No no, I mean. Is setting tool XP already implemented via script?

— Reply to this email directly or view it on GitHub https://github.com/jaredlll08/ModTweaker2/issues/241#issuecomment-138912844 .

MagisterXero commented 9 years ago

Ahh, okay Thanks for the update though Jared I was hoping this one would be a rather simple one

jaredlll08 commented 9 years ago

Honestly, it could be easy, I am just fairly busy currently

On Wednesday, September 9, 2015, MagisterXero notifications@github.com wrote:

Ahh, okay Thanks for the update though Jared I was hoping this one would be a rather simple one

— Reply to this email directly or view it on GitHub https://github.com/jaredlll08/ModTweaker2/issues/241#issuecomment-138914859 .

MagisterXero commented 9 years ago

No big rush on this one, because of the script I made for setting all the other values, this one is more of a "First world problem". I used a lot of variable equations to calculate the values and force them to be balanced across the board using a designated scaling system, so writing this script assisted in my not needing to muck with stuff manually.

Voidi commented 9 years ago

If this can be modified in ITT config why should we bother to support it Modtweaker? Because this require extra work compared to other TinkersFeatures (this feature sould only available if ITT is present)