Jump to content

Recommended Posts

As the title says I am trying to add a bleed mechanic (similar to ignite, just wont burn loot at drop) that will do damage over time ( a random value between 2-5 seconds) that will do (x) damage a tick.  I have looked at Heavenfalls RPG mod and im not entirely sure on how to add it in even after all of that x.x

 

I have a weapon that I want to attach the bleed to, so it won't have to go onto every weapon in the game, but I am stuck here and could really use some help with it if you can find the time for it. :) 

 

Thank you for your time!! 

 

-- Troubled modder

Link to comment
https://forums.kleientertainment.com/forums/topic/30329-mod-idea-bleed-mechanic/
Share on other sites

I'm kinda taking a shot in the dark, here... but I think you might be able to achieve this by creating two components.

One that makes a character/monster bleedable, like the component that specifies whether they can catch fire...
And one that makes a weapon/item trigger the bleed, like the one that causes flammable targets to ignite.

 

Once you have those, your modmain would just need to be a bunch of prefab post-inits, to add those new components.

I would say an "onattack" function using time events to cause a certain amount of damage at certain times. This isn't at all correct, but like this:

 

[codesyntax]

Timeevent stuff: 4

Target: dodelta -damage

 

Timevent stuff: 8

Target:dodelta -damage

 

timeevent stuff: 12

Target: dodelta -damage

[/codesyntax]

 

Don't actually try copying that stuff in. I'll get back to this after dinner.

When you say 'similiar to ignite' you don't mean that you can go up to the creature and right click it to make it bleed, do you?

If so then Danas solution is the way to go. Otherwise Mr. Tiddles idea sounds more promising.

Yeah, mine works perfectly. I'll get a quick video demonstration up. I'll also upload the scripts after the last few tweaks.    

 

Here's the video:

http://www.youtube.com/watch?v=2CpH8SsfqFk&feature=youtu.be

 

 

And the script:         I chose the spider hit response because it's a failry plain "splatty" sound that works with almost any enemy... apart from the Chess enemies.

local bleedchance = 0.8  local function onattack(inst, owner, target)    if math.random() < bleedchance then     owner:DoTaskInTime(2, function() target.components.health:DoDelta(-5) end)     owner:DoTaskInTime(2, function() target.SoundEmitter:PlaySound("dontstarve/creatures/spider/hit_response") end)    owner:DoTaskInTime(2, function() SpawnPrefab("splash").Transform:SetPosition(target:GetPosition():Get()) end)    owner:DoTaskInTime(4, function() target.components.health:DoDelta(-5) end)    owner:DoTaskInTime(4, function() target.SoundEmitter:PlaySound("dontstarve/creatures/spider/hit_response") end)    owner:DoTaskInTime(4, function() SpawnPrefab("splash").Transform:SetPosition(target:GetPosition():Get()) end)    owner:DoTaskInTime(6, function() target.components.health:DoDelta(-5) end)    owner:DoTaskInTime(6, function() target.SoundEmitter:PlaySound("dontstarve/creatures/spider/hit_response") end)    owner:DoTaskInTime(6, function() SpawnPrefab("splash").Transform:SetPosition(target:GetPosition():Get()) end)    owner:DoTaskInTime(8, function() target.components.health:DoDelta(-5) end)    owner:DoTaskInTime(8, function() target.SoundEmitter:PlaySound("dontstarve/creatures/spider/hit_response") end)    owner:DoTaskInTime(8, function() SpawnPrefab("splash").Transform:SetPosition(target:GetPosition():Get()) end)    endend

The "0.8" and "-5"s can be changed. The "-5"s are how much damage the enemy takes, the "0.8" is the chance to cause bleeding. Also, you can copy and paste the script and change the "DoTaskInTime" for the bleeding to last longer or be shorter.

 

 

And don't forget to add:

    inst.components.weapon.onattack = onattack
Edited by Mr. Tiddles

Holy crap tiddles you are awesome.  Now I jsut put this in the onattack function in weapon prefabs file right?  like it will be trident.lua for that, also how did you get health bars on the bottom of the enemies, that is an awesome mod holy crap

 

Yeah, in the weapons prefab file. And don't forget the "inst.components.weapon.onattack = onattack"!

 

 And the mod is FutaraDragon's Dynamic Status Bar.

 

http://forums.kleientertainment.com/files/file/271-futaradragon-dynamic-status-bar/

Edited by Mr. Tiddles

 

 

Yeah, in the weapons prefab file. And don't forget the "inst.components.weapon.onattack = onattack"!

 

 And the mod is FutaraDragon's Dynamic Status Bar.

 

http://forums.kleientertainment.com/files/file/271-futaradragon-dynamic-status-bar/

 

Everything works great thank you so much!!! and ya that mod is sweet have to download that 

I'm kinda taking a shot in the dark, here... but I think you might be able to achieve this by creating two components.

One that makes a character/monster bleedable, like the component that specifies whether they can catch fire...

And one that makes a weapon/item trigger the bleed, like the one that causes flammable targets to ignite.

 

Once you have those, your modmain would just need to be a bunch of prefab post-inits, to add those new components.

7kYudTO.png

You should set aside some time to study programming, seriously. You have some pretty good instincts about it.

But I think your method would be overkill for the present purposes. @Mr. Tiddles's solution is simpler for the problem at hand.

7kYudTO.png

You should set aside some time to study programming, seriously. You have some pretty good instincts about it.

But I think your method would be overkill for the present purposes. @Mr. Tiddles's solution is simpler for the problem at hand.

I think I have good instincts about a lot of things... I guess I'm sort of intuitive, in that sense - if someone was trying to do something technical in a 3D animation, and couldn't figure it out, I'd usually have an idea that would set them on the right path.

I'm just... clever.

I mean... not trying to sound full of myself, or anything... but...

brilliant_zps354e7647.gif

 

I really should learn some programming in a serious context... there are just so many artistic things I want to learn about.

Different animation packages... styles of art and animation... sculpting, painting, all that stuff.

There's just too much I want to learn! ;A;

I've finished the new bleed appearance and tweaked some of the stats of the Trident for you. Base damage: 60 - a bit less  than the Dark Sword but more than the hambat and Thulucite club. The bleeding deals 5 damage, occurs once every tick for 8 ticks (before you set it to deal 32 damage every 2 ticks for 4 ticks, which I thought seemed a bit too much damage in too little time). I'll include a version with.without the base stat changes so you can choose!

 

Also: Here's a (still using free Fraps because I'm still too lazy to get it off my old computer) a video demonstrating the new, red blood, and the way it's faster. Fist, I see how long it takes to kill a tallbird, and then myself, and then my cat. It's pretty good at killing things without having to be near them!

 

The "me" has 750 health, so it takes a while.

 

http://www.youtube.com/watch?v=yW_WPk86fS4

 

 

Changed stats.zip       Unchanged stats.zip

Edited by Mr. Tiddles

I've finished the new bleed appearance and tweaked some of the stats of the Trident for you. Base damage: 60 - a bit less  than the Dark Sword but more than the hambat and Thulucite club. The bleeding deals 5 damage, occurs once every tick for 8 ticks (before you set it to deal 32 damage every 2 ticks for 4 ticks, which I thought seemed a bit too much damage in too little time). I'll include a version with.without the base stat changes so you can choose!

 

Also: Here's a (still using free Fraps because I'm still too lazy to get it off my old computer) a video demonstrating the new, red blood, and the way it's faster. Fist, I see how long it takes to kill a tallbird, and then myself, and then my cat. It's pretty good at killing things without having to be near them!

 

The "me" has 750 health, so it takes a while.

 

http://www.youtube.com/watch?v=yW_WPk86fS4

 

 

attachicon.gifChanged stats.zip       attachicon.gifUnchanged stats.zip

 

 

Thank you so much Tid!!!!!! :333333

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...