Modding Help Trying to make a combined Morph Ball mod

Discussion in 'Starbound Modding' started by DaWrecka, Feb 6, 2017.

  1. DaWrecka

    DaWrecka Pangalactic Porcupine

    The idea I had was a unified script for the Morph Ball techs, but its capabilities would change depending on which of the techs you'd unlocked. For example, you could have Distortion Sphere in your actual tech slot, but if you had the Sonic Sphere unlocked, you could hold your Run button to charge a boost and release it to fire.

    That was the idea, anyway. I've recently learned that the function I was hoping to use, player.enabledTechs(), can't be executed from the context of a tech's script. In fact, it seems player.functions are only available in a very small number of contexts...

    So the question; does anyone know of an alternate way for a tech to find out whether specific other techs are available for the player? Whether that involves a script that CAN call player.enabledTechs() saving the result somewhere that the tech script can get at it, or something else entirely?
  2. The | Suit

    The | Suit Agent S. Forum Moderator

    Have the unlock script also write in a variable to the players stat. (player.config)
    Such as bounce ball 1 as a player stat.

    The tech can read to see if that player stat exists - knowing it has unlocked it.
    Some really old experimental code I was working on for a farming mod.

    When the player "picks" a plant. The plant checks to see what is the farming level of the player. ( this was set as a player stat )
    Then based on that it creates a drop.
    Cyel likes this.
  3. bk3k

    bk3k Oxygen Tank

    The other thing you could do is hook into the tech GUI's scripts. That DOES have the functions you need.

    You could have different versions of your techs that are enabled or disabled based upon what vanilla techs are unlocked (or enabled). I'm currently hooking this interface in my tech mod if you wanted to take a look(or copy). I was thinking I should modify my approach from "auto unlock"(chips required) to "auto enable", but only if the vanilla tech it was based off of was already enabled. It wouldn't be a terribly difficult change to make.

    Yet again I'm reminded that I've been neglecting my tech mod.
    Last edited: Feb 7, 2017

Share This Page