View unanswered posts | View active topics It is currently Sun Dec 01, 2024 4:01 am



Reply to topic  [ 7 posts ] 
 Damage-over-Time Effects? 
Author Message
User avatar

Joined: Sun Jan 28, 2007 10:32 pm
Posts: 1609
Location: UK
Reply with quote
Post Damage-over-Time Effects?
I need a little additional assistance with my latest project.

Simply put, I need some way to have a bullet/projectile of some description apply a damage-over-time type effect to the actor it strikes. Does anyone have any good ways to implement such a feature? I know you can attach additional wounds to actors and so on, but I have no idea how to actually go about implementing such a thing.


Fri Oct 17, 2014 9:49 pm
Profile YIM

Joined: Fri Nov 23, 2012 5:42 am
Posts: 143
Reply with quote
Post Re: Damage-over-Time Effects?
As far as I know (which admittedly, isn't much), there is (currently) no way to directly add wounds via lua. You could use the techion nanorifle method, which just spawns a damage particle at the right position and speed to damage the target every x seconds. Alternatively, you could attach an AEmitter, which emits a damage particle, to the target. The base c4 script provides a nice basis to work from for that method. I might even still have a modified version of it, if you want.

If it's supposed to be, say, a poison effect or so, you can also just manipulate the actors HP, so you don't have to faff around with wounds.


Fri Oct 17, 2014 10:28 pm
Profile
Forum Moderator
User avatar

Joined: Fri Feb 02, 2007 3:53 pm
Posts: 1896
Location: in my little gay bunker
Reply with quote
Post Re: Damage-over-Time Effects?
If I recall correctly, the way I did it in Brolands was to "attach" a lua'd MOPixel to the actor it hit and then decrease their health until it kills itself off. I am sure there are better ways than this, but if you don't feel like getting fancy then it's pretty simple to implement


Sat Oct 18, 2014 2:38 pm
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Fri Jan 07, 2011 8:01 am
Posts: 6211
Location: In your office, earning your salary.
Reply with quote
Post Re: Damage-over-Time Effects?
I once made a whole mod that had weapons that worked with HitScans and it dealt wounds with Lua. It was cool because when you use the AttachEmitter function you can choose if it counts towards the gib limit or not, so I basicaly had some handguns that could deal infinite wounds but never gib the limp. IIRC though, after hitting the limit with wounds that didn't gib the limb, a single wound that did count gibbed it, but I might be wrong, I did this long ago.


Code:
target:AttachEmitter(WoundEmitter,WoundPosition,BooleanCanGib)


You just have to create a cool emitter that applies the damage how you'd like to with ini. I remember I couldn't get the wound to rotate properly according to how the "bullet" hit it and it was always horizontal, but that doesn't matter if the wound doesn't have any emissions.


Sat Oct 18, 2014 7:05 pm
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post Re: Damage-over-Time Effects?
Have you tried rotating the emitter before attaching it? Like,

Code:
local wound = CreateAEmitter("Some Wound");
wound.RotAngle = (-1*self.Vel).AbsRadAngle;
target:AttachEmitter(wound, WoundPosition, BooleanCanGib);


Sat Oct 18, 2014 7:46 pm
Profile
User avatar

Joined: Sun Jan 28, 2007 10:32 pm
Posts: 1609
Location: UK
Reply with quote
Post Re: Damage-over-Time Effects?
Hm. Interesting thought. Hitscan weapons aren't too common, but I already have the lasers sort-of doing that. Hitscan-with-DOT also might be kind of OP.


Sat Oct 18, 2014 8:56 pm
Profile YIM
Data Realms Elite
Data Realms Elite
User avatar

Joined: Fri Jan 07, 2011 8:01 am
Posts: 6211
Location: In your office, earning your salary.
Reply with quote
Post Re: Damage-over-Time Effects?
Yeah Cave, I did do that but not as fancy as you did, mine looks like

Code:
      self.inflictedWound = CreateAEmitter(self.criticalFleshWound,"HSWeapons.rte")   
         self.inflictedWound.RotAngle = self.FireAngle+3.1415926535               
         self.targetLimb:AttachEmitter(self.inflictedWound,self.hspos-self.targetLimb.Pos,self.criticalCanGib)


But they displayed horizontally all the time.

And Arcalane, my implementation was somewhat OP because I'm really bad at making ini wounds. I designed it thinking about the whole issue of "how can a .50 cal sniper shot deal the same wound as single shotgun pellet". In that way, "small caliber" guns wouldn't deal wounds but they would deal low ammount of damage to the actor, and if they scored a critical hit, they would deal a wound that wouldn't gib limbs, while heavy caliber things would normally deal wounds and on critical hits they would do critical wounds that would deal buttloads of damage. Again, my wounds were pretty crappy so it did work funny (wounds dealt damage very slowly overtime, lasting almost 3 times longer than the vanilla wounds while dealing the exact same damage, with criticals operating the same but with beefed up numbers).

Of course this negates all and any armor that actors may have because the wound depends on the weapon, not the actor. Indeed, it's very complicated to change this wound mechanics without doing a complete overhaul of the game, so this isn't meant as that, mostly just as a proof of concept for fun stuff.

It's pretty fun, and I was doing it with the idea of making a proper healer that would detach the wounds or something, though I didn't get to it because I got too busy with school. It was fun on a scene I made that made the AI spawn with those weapons.

I'm going to test if it works in the current build, and if it does I could upload it so you guys can fiddle with it and have fun.


EDIT:

Here it is. It works just as I remember, except for couple of details (forgot to make it work for other teams other than team 1, easy fix but not much time now).

It's mostly a proof of concept, so some things behave wierdly (helmets getting flesh wounds for example) but that's pretty much it. With properly made wounds and a couple of details fixed this could turn out to be much better as a finished product.


Attachments:
HSWeapons.rte.7z [305.36 KiB]
Downloaded 388 times
Mon Oct 20, 2014 1:08 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 7 posts ] 

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.105s | 14 Queries | GZIP : Off ]