5E Product Walkthrough Playlist
  1. #1

    Coding armor and item abilities

    I've made a few homebrew items n things that are a little awkward to code, it doesn't help I barely understand how it's parsed...

    Big one that's been annoying to keep track of is a magic medkit that bandages its carrier every turn as long the holder isn't unconscious and the medkit still has charges (only works 15 times before needing to be refilled with medical supplies). I figure the easiest way to do it is to go via "REGEN: 1d4+3" for the basic healing, but then I don't know how to get it to only work if the person is not unconscious... I tried muddling about with "IF: !Unconscious" but I didn't find that it worked. It either broke the effect entirely or was ignored; though I might have just not put it in the right place.

    I'd also prefer if it didn't apply any healing toward damage from psychic, poison, thunder, or force damage but I doubt that it's possible to section off a portion of the damage to not heal. Worst case I can either disable it for a turn if receiving those damage types or remove the incorrect amount manually.

    Item's description is as follows:
    A breadbox-sized metal medical kit able to sense injury and heal such wounds on those who carry it. Once per round on the holder's turn if the holder of this kit has been injured by damage other than Force, Psychic, Thunder, or Poison, the kit will open slightly and bandage or soothe injuries sustained, healing 1d4+3 health. This effect does not activate after damage that has knocked the holder unconscious, however the holder only needs to make 2 successful death saves to become stable, Rolling a 20 on a death save will recover 5HP instead of 1. This kit's effects can occur up to a total of 15 times before the kit is exhausted. If restocked with more medical equipment, the kit is functional again. As an action, you can expend one use of the kit to stabilize a creature that has 0 hit points, without needing to make a Wisdom (Medicine) check.
    It's probably busted to hell but I run a tough game. If you have thoughts on how to better word it or have changes you think would be worthwhile please feel free to share. I built the thing ages ago and haven't really touched it up at all so it could probably use some work.



    I've also started to implement a bunch of the overlays and underlays from KotOR 1 and 2 as bonuses to apply to armor. Most of them are pretty simple to code in, being flat bonuses. I translated them mechanically to better suit 5e's system given a bunch of them use percentile reductions to things in their original games; as well as thematically so they aren't talking about energy weapons and high-tech stuff. Again, probably pretty broken, and probably needs some work. On the plus side, I haven't used them much yet and I plan to have them be prohibitively difficult to obtain in some cases. Pictures of them attached to post.
    I haven't coded most of them simply because I haven't needed to yet. The only thing I'm not sure of is if it's possible to reduce damage down to 1 instead of 0.

    First-time poster, don't kill me.
    Attached Images Attached Images

  2. #2
    Zacchaeus's Avatar
    Join Date
    Dec 2014
    Location
    Scotland
    Posts
    20,824
    Welcome to the forums.

    There isn't a way to do an IF NOT function which is whey the pling character isn't working (the ! only works as a logical NOT to exclude damage types in resistances and immunities).

    There is also not a way to exclude healing based on a damage type.

    So you'll need to work that one out manually and only apply the healing at the appropriate time.

    I'm kinda lost as to what that table is doing so I'm not sure how to advise. I see the armour ones and as you say that's just AC: x; not sure what the others are doing.
    If there is something that you would like to see in Fantasy Grounds that isn't currently part of the software or if there is something you think would improve a ruleset then add your idea here https://www.fantasygrounds.com/featu...rerequests.php

  3. #3
    yeah, that's what I was afraid of. Oh well. Was worth a shot I suppose.
    If the if statement can't work with a 'not', would it work with using something else? like if I just always had the character 'stable'?

    The table is mostly just to show stuff off. Each row is an upgrade of sorts to be applied to armor or robes that can help specialize one's defenses. The first column is what the upgrade was originally called in the game I stole them from. Second is what I call it to fit better thematically. Third is what kind of armor/clothes a particular upgrade is applicable to, some are only functional on heavy armor, and some are functional on all kinds of armor. The rest of the columns are the tiers that the upgrades come in.
    Most of the said upgrades come in at least 3 tiers of power, getting more potent at higher tiers. The one called "Ballistic Shielding / Reinforced Materials" kind of works like the heavy armor master feat and reduces damage from non-magical bludgeoning, piercing, and slashing, which I shorten to B.P.S. to make things faster.
    Anything with "-x down to 1" means it would reduce incoming damage of specified type down to 1 point at minimum.

    The only ones of those I don't know exactly how I would code out are the "bio-restorative / regenerative weave" underlay specifically, and any of the others that modify ability scores. Although the latter I assume I'd probably just have to modify manually when the upgrade is being used.
    And like I mentioned in the original post, as to whether or not I can actually just reduce incoming damage to 1 rather than 0.
    Eg. Someone has the "heat shielding / advanced tempering" overlay at tier 3 and takes 5 fire damage as part of an attack. The fire damage should still apply 1 point of damage rather than being removed. Currently because I have it set as just "RESIST: 5 fire" it will remove all fire damage that is 5 or lower rather than still leaving one point of damage. Picture attached to show.
    fire.PNG
    The damage received would ideally be 4 rather than 3, as only 3 of the 4 fire damage would have been removed.
    Last edited by chillpants; February 28th, 2023 at 02:42. Reason: clarifiction on photo

  4. #4
    https://forge.fantasygrounds.com/shop/items/591/view for IF's based on NOT.

    But doing things like changing how death saves work would probably require you to learn Lua and code it up yourself.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
FG Spreadshirt Swag

Log in

Log in