News: Go to the front page portal to create a Torchmodders account | Visit the wiki!
January 28, 2020, 10:29:13 AM
collapse

*
Information

Please contribute to our


Sign up for a forum account at the Front Page. | Remember to Tag your posts.
Having problems logging in to the forums? Go the front page, log out and back in again.

Author Topic: Use charge bar as health or shield?  (Read 2297 times)

Offline S4r0m

  • Posts: 3
    • View Profile
Use charge bar as health or shield?
« on: January 23, 2016, 09:33:58 PM »
Hi, another newbie here  ;D

I'm (trying to) create a class, but i want to use the chargebar as health or a shield (like the aegis passive skill):
Certain skills fill your chargebar, while you have "charges" in your chargebar it will act as your HP: Every received hit will deplete the chargebar, if there's not enough "charges" in your bar, the remaining damage will then go normally to your HP. And a 2nd function: Certain skills will take an amount of "charge" points as a casting cost or like the engineer: take them if available to power up the effect.

Of course the 2nd feature of that bar can be created, but i'm not sure if that first use could be done. Any help?

Offline Phanjam

  • Operator
  • Legendary
  • *
  • Posts: 2729
  • Country: ph
    • status ready
    • View Profile
  • Mood: mood angel
Re: Use charge bar as health or shield?
« Reply #1 on: January 25, 2016, 04:44:44 AM »
Hi S4r0m. Yes that first feature is do-able.

Not sure how to have the bar start as "always full" but I assume that's what you'd like?

Having it go down as it gets hit is a matter of applying a negative value to it per hit. I'll try to reference some sample files for you to reverse-engineer.

The value of the charge bar at any given time then needs to be linked to an affix which will give the shield effect. Will also try to reference a sample file for this too...



Offline S4r0m

  • Posts: 3
    • View Profile
Re: Use charge bar as health or shield?
« Reply #2 on: January 26, 2016, 06:24:01 PM »
Thank! I'll appreciate it!

Well, i don't think should be needed full from the start. I'm trying to make the charge bar to act as a 2nd HP and MP pools at the same time. Pretty much like a mana shield from diablo 2 or other games.

Offline gytfunke

  • Developer
  • Legendary
  • *
  • Posts: 827
  • Country: us
    • status idle
    • View Profile
  • Mood: mood azn
Re: Use charge bar as health or shield?
« Reply #3 on: January 29, 2016, 05:38:47 PM »
Hey S4rom!

This is an interesting idea!  Yeah, it's possible to sort of use the charge bar as an extra health pool.  But there's going to be a complication.  We'll talk about the complication later.  First, the method.

The general idea is that you'll need to create a system that does 2 things: 1) translate charge into health; and 2) reduce charge when damage is taken (otherwise, you'd be mostly invincible).

For #1...

I would add a hidden passive skill to the class.  The passive should apply a SHIELD BUFFER EFFECT like the Engineer's Forcefield skill does.  Look at that skill to see how to set up the effect. 

Now, we have to make this damage buffer reflect how much charge we have.  We can modify the effect by a stat, and 'percent charge' is a stat.  Now, we want the shield to also scale with level, because otherwise it'll be worthless after a few levels.  So, check the variable in the effect called 'use owner level' with 'true'.  You may need to modify the STAT PERCENT value to something other than 1 or 100, depending on how large the shield actually is when you test it.  Min/Max should be set to 1 so they don't figure into the equation.  Then all of your balance adjustments can happen on STAT PERCENT.

Now, the next thing to think about is the application.  Passive skills only trigger on certain events, such as level-ups, zone changes and changing equipment.  Now, I can't remember if there's a way to make a SHIELD BUFFER not deplete when you get hit... but I don't think there is.  If I'm right and there isn't... well... we want to make sure your 'charge health shield' work when it's supposed to (whenever you have charge).  You'll probably have to approximate this.  I'd suggest using a CAST SKILL ON... effect.

But when should it update?  I'd guess probably both when you hit something else (because your charge will go up) and when something else hits you (because the shield will get depleted and we want your charge to go down).  So, we'll need two effects, but they can cast the same skill to apply the same effect.  Use a CAST SKILL ON STRUCK effect for when enemies hit you, and CAST SKILL ON STRIKE effect for when you hit an enemy.  Here's how our new overall setup should look:

1)Hidden passive that applies the CAST SKILL ON... effects
2)Proc skill that is triggered by the CAST SKILL ON... effects
3)The proc skill applies the SHIELD BUFFER effect

And we need to adjust the SHIELD BUFFER effect to keep it from stacking.  Set EXCLUSIVE to TRUE.  Also, input something into the NAME field... maybe CHARGE_HP_SHIELD_S4R.  The name is necessary to make sure we never get a stacking shield.

Okay, complicated enough?  Well, there's still some loose ends.  What about when your charge bar depletes from inactivity?  You might be still running around with a full charge shield, but no charge.  To tidy this up, add a TRIGGERABLE to your passive skill with the condition CHARGEDEPLETE.  Have it cast the same proc skill as the CAST SKILL ON effects.

That's all I can think of for that.  It should get you a pretty close approximation of using your charge bar for HP.


Now for #2...

To get the charge bar to deplete when you get hit by an enemy, we'll have to approximate this.  This is where our problem comes in and things get janky...

Okay.  There's no way to reference a hit's worth of damage.  So, when an enemy attacks you, you can't use the amount of damage they do to modify any other event.  We might want that so we could compare it to the amount of health we have, or the max amount of shielding from the charge bar we might get.  Then we could figure out the % of the charge bar to deplete from that hit.  Bigger hits would take off more charge bar.

I don't think this can be done with GUTS.  I've never found a way to reference damage dealt from a strike.  It's just not available to us.

So, what can you do?

I would make each hit take off a predetermined percentage of the charge bar.  Maybe 25%.  That would be 4 hits from full shield to no shield.  Seems good to me.

To do this, go back to that CAST SKILL ON STRUCK effect.  The effect should be packed in an affix and you should add another CAST SKILL ON STRUCK effect.  Create a new proc skill for this new effect to trigger and have the proc skill apply an effect called CHARGE PERCENT.  Set the min/max to -25 and voila.  Every time you get hit, you'll lose 25% of your charge bar.


There you have it.  Somewhat complicated, somewhat rough, but a pretty good approximation of what you're looking for.

Offline Phanjam

  • Operator
  • Legendary
  • *
  • Posts: 2729
  • Country: ph
    • status ready
    • View Profile
  • Mood: mood angel
Re: Use charge bar as health or shield?
« Reply #4 on: January 30, 2016, 07:18:32 AM »
Hey Gyt, your reply also gave me what I needed for the Alch's "blightbar"! Thanks!  ;D



Offline gytfunke

  • Developer
  • Legendary
  • *
  • Posts: 827
  • Country: us
    • status idle
    • View Profile
  • Mood: mood azn
Re: Use charge bar as health or shield?
« Reply #5 on: January 30, 2016, 04:55:50 PM »
Cool!  You're welcome, PJ!

Offline S4r0m

  • Posts: 3
    • View Profile
Re: Use charge bar as health or shield?
« Reply #6 on: February 05, 2016, 05:48:37 AM »
gytfunke Wooww!! That's not exactly what i had in mind but i like it a lot anyways! I'm sorry for not answering, i was busy doing some other things and just now i've returned to "work" in my mod. I'm going to use your approach. I think that way is simpler and more effective in higher levels: A shield which blocks 4 immensely powerful hits from an uber elite boss, sounds good and no too overpowered if the class needs some time to fully recharge that shield.

Tags: chargebar 
 

* Quick Search


* Member Information

 
 
Welcome, Guest. Please login or register.

* Mod Boards Activity

* Who's Online

  • Dot Guests: 2
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Calendar

January 2020
Sun Mon Tue Wed Thu Fri Sat
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 [28] 29 30 31

No calendar events were found.

* Recent Topics

[Tool] another localization tool by Awkward
[Today at 05:55:57 AM]


Variant Classes Mod Information by Awkward
[January 24, 2020, 11:50:50 AM]


What free software do you guys use? by Phanjam
[January 24, 2020, 06:25:40 AM]


Essentials and Tenebris conflict by Awkward
[January 20, 2020, 03:57:51 PM]


[SCRIPT] Automatic Mesh Rebuilding by Kva3imoda
[January 10, 2020, 01:33:48 AM]


FEP+ by Sch123
[January 08, 2020, 05:59:25 AM]


First Topic by Phanjam
[December 01, 2019, 03:05:25 AM]


Trouble with summons by Phanjam
[November 23, 2019, 12:16:19 PM]


Help Making Custom Minion Skills by DiakEagle
[November 18, 2019, 04:11:40 PM]


Diablo II Charms possible in Torchlight II? by Waves_Blade
[November 11, 2019, 05:40:43 PM]


[TOOL] TL2 Translation Utility by Phanjam
[November 06, 2019, 07:11:09 AM]


[Tool] Item Unit file maker Script by Phanjam
[October 21, 2019, 01:36:42 PM]


Will these plans be even possible to do? by Saber
[October 15, 2019, 06:13:17 PM]


Variant Classes Bug Reports by negreanu11
[October 05, 2019, 07:23:09 PM]


Mod Changelogs by Viz
[September 22, 2019, 05:06:52 AM]

* Popular Topics