Modding Help Any way to add Individual Race Perks?

Discussion in 'Starbound Modding' started by IncredibleMeh, Nov 15, 2015.

  1. IncredibleMeh

    IncredibleMeh Scruffy Nerf-Herder

    Recently got into modding Starbound and I've been fiddling around with things. I wanted to try my hand at something that I don't think has been done yet, and see if there was any method on adding race perks that aren't tied to armor or the tech system. I figure that there must be some way run a check for the player's current race and then modify things like falling and running speed or breathProtection values.

    I have moderate experience in coding stuff like small game projects, so pointing me in the right direction should be enough and I should be able to find my way. Thanks in advance for any help!
     
    Last edited: Nov 15, 2015
  2. The | Suit

    The | Suit Agent S. Forum Moderator

    Best Answer
    No I am simply stating some mechanics can't be changed because the features are currently not available in the game yet.
    The only difference as far as I am aware between persistent effect and a normal effect is persistent does not have a count down timer.
    But it still requires an activator - so upon death it would disappear unless something "resets" it.

    The only thing which applies a "reset" on a character on death consistently is primary player.lua
    But that current doesn't not have access to entity.species.
    I know this because - this is how my temperature mod originally worked.

    Lets just say there is one possible way -
    where starting clothes defined an entity species by using a numerical reference assigned to species.
    Then based on the value given - you write code into primary player to apply accordingly through this work around.
    This is done by a S/E which adds a resource \ stat value. In which the primary player lua will reference.

    You face issue of incompatibility with race mod - who do not have it on their starting clothes.
    Of course you could fix this by writing in a default value when no value is given.

    ---
    That is the only work around I can think would be possible.
    The thing is I don't like messing with primary player.lua as it determines quite a bit of the core functionality of the player.
    So small changes can have massive impacts in both performance and game play with interaction with other mods.
     
  3. The | Suit

    The | Suit Agent S. Forum Moderator

    Essentially there isn't.
    The only way that would have been able to be done would be through the primary player.lua in stats folder.
    But that does not have access to the entity.species() function which would have given the race.
     
  4. IncredibleMeh

    IncredibleMeh Scruffy Nerf-Herder

    Well, what does have access to entity.species()? Depending on the answer it should be possible to run that function, then tell the code to run a lua file based on the the results of that function that alters various effects. Or am I wrong?
     
  5. The | Suit

    The | Suit Agent S. Forum Moderator

    Status Effects and probably techs.
     
  6. Mackinz

    Mackinz The Waste of Time

    I think it's possible by scripting a status effect that checks a characters race, then adding the status effect to starter clothing so it applies on character generation. Not sure if status effects can be permanent. If they can be, then you'll need something to cancel out the effect fpr uninstalling.
     
  7. IncredibleMeh

    IncredibleMeh Scruffy Nerf-Herder

    I've been experimenting with the above mentioned method, it works exactly as intended. Through the use of status.setPersistentEffects(), I can set certain stats such as biomeradiationImmunity to be turned on permanently from the beginning. I can even use an IF statement involving world.entitySpecies(entity.id()) to make sure the bonus is never received by other races who obtain a copy of the starter clothing. (I have to thank xxswatelitexx for discovering how to use that command for status effects initially.)

    The only thing I can't do yet is cause status effects to remain forever, but I believe this is possible to do as searching has turned up results of people getting griefed by players who have modded their game to inflict infinite duration effects on people. Once the method for doing this is found out, I should be capable of applying any effect to any specific character race.
     
  8. The | Suit

    The | Suit Agent S. Forum Moderator

    Such a status effect generally should disappear once the character dies with different clothing equipped.
     
  9. IncredibleMeh

    IncredibleMeh Scruffy Nerf-Herder

    Damn, your absolutely right. There goes that plan.

    At least any effects set by status.setPersistentEffects() remain regardless of clothing though. However I have no idea just how much that influences outside of various immunities to other status effects, and if it turns out that it doesn't effect anything outside of the scope of what I already know than my options have become yet more limited.
     
  10. The | Suit

    The | Suit Agent S. Forum Moderator

    One simple option is just to add race status effects into suits.
    Since you have to wear suits ( tech suit ) in the game anyway to progress.

    Since suits have access to species - it can be inherently tied throughout the game.
     
  11. IncredibleMeh

    IncredibleMeh Scruffy Nerf-Herder

    You're correct that applying it to techs would be incredibly simple of a solution, but the reason I didn't want to do this to begin with was that I wanted a method of inflicting a racial perk on someone from the very beginning. There is not a single tech in the game that the player starts equipped with right away, so the system is not very ideal for my goal.

    It's a thing to consider once I've hit rock bottom and there's no other way around it, but until I've completely exhausted my options I'm going to keep exploring ways to make this work the way I intend.
     
  12. The | Suit

    The | Suit Agent S. Forum Moderator

    Just add a quest to give you a suit from the beginning.
     
  13. IncredibleMeh

    IncredibleMeh Scruffy Nerf-Herder

    I.. don't know if that would really work. While that would cause the player to start with the suit tech available, it wouldn't automatically equip the tech for the player. So really it's effectively the same solution you mentioned before.
     
  14. Mackinz

    Mackinz The Waste of Time

    An alternative solution is have the effect applied by all armors by patching every single one to apply the effect. Starter clothes to vanity armors. As well as by techs, if you want.
     
  15. The | Suit

    The | Suit Agent S. Forum Moderator

    Well dude you got to work with the tools presented to you - until the point in time such features either become available or the source of the game becomes available.
     
  16. IncredibleMeh

    IncredibleMeh Scruffy Nerf-Herder

    So basically what your saying is I shouldn't try to figure out if there's a way to do it because other people haven't figured it out yet? There's nothing unhealthy or unproductive about me trying to see if there's a solution to this issue or not, and I don't take any value in the statement that I should "work with the tools presented" when I've yet to completely understand what more than half of the tools I have can do yet.

    Can you at least provide some information on whether status.setPersistentEffects() is capable of actually using status effects in any way? The name implies that it's able to, and if it can I'll have exactly what I'm looking for. If it can't for certain than I can at least avoid wasting my time trying to find out.
     
  17. The | Suit

    The | Suit Agent S. Forum Moderator

    Best Answer
    No I am simply stating some mechanics can't be changed because the features are currently not available in the game yet.
    The only difference as far as I am aware between persistent effect and a normal effect is persistent does not have a count down timer.
    But it still requires an activator - so upon death it would disappear unless something "resets" it.

    The only thing which applies a "reset" on a character on death consistently is primary player.lua
    But that current doesn't not have access to entity.species.
    I know this because - this is how my temperature mod originally worked.

    Lets just say there is one possible way -
    where starting clothes defined an entity species by using a numerical reference assigned to species.
    Then based on the value given - you write code into primary player to apply accordingly through this work around.
    This is done by a S/E which adds a resource \ stat value. In which the primary player lua will reference.

    You face issue of incompatibility with race mod - who do not have it on their starting clothes.
    Of course you could fix this by writing in a default value when no value is given.

    ---
    That is the only work around I can think would be possible.
    The thing is I don't like messing with primary player.lua as it determines quite a bit of the core functionality of the player.
    So small changes can have massive impacts in both performance and game play with interaction with other mods.
     
  18. IncredibleMeh

    IncredibleMeh Scruffy Nerf-Herder

    This works, thank you. Though I had figured using global variables to work around the issue would have been a solution, I should have tried it sooner. I also shouldn't have hastily assumed that status.setPersistentEffect was truly persistent.

    On an extremely personal note, I have no misguided fears regarding instability or incompatibility with other mods. The nature of this personal project meant that those were inevitable risks and I was never hung up on that. I also want to say I despise the way that your advise was given, and how it created the false perception that this task was in any way difficult. If you knew of a method for doing this it should have been stated from the very beginning, and if you didn't you should have at least held some semblance of encouragement towards exploring the limitations of modding.
     
  19. Mackinz

    Mackinz The Waste of Time

    It may be a personal project for you, but I am legitimately interested in the progress and direction you take with it.
     
  20. The | Suit

    The | Suit Agent S. Forum Moderator

    I don't discourage - exploring of possibilities - as always I tend to answer if any work around possible.
    Though - I also rather look for options which would cause the least amount of conflict if possible.

    Also this is a method I implemented a while for one of my test mods - but for some reason I dropped the plan.
    Though I can't readily remember why.
     
  21. IncredibleMeh

    IncredibleMeh Scruffy Nerf-Herder

    I apologize. I'm not normally like this, but I get hot blooded when feeling like I'm told I shouldn't set out to do something I've already set my sights on. It's stupid and foolish to let myself act this way when I really don't even understand what I'm doing. And I shouldn't be making assumptions towards people who clearly have more experience than me.

    I'm going to try taking what has been said so far to heart. I'll keep learning how to mod the game and I'll do it in a way that causes the least amount of issues, and I'll see if I can turn this into something more than just a personal project for my own sake.
     

Share This Page