Data Realms Fan Forums
http://forums.datarealms.com/

Damage-over-Time Effects?
http://forums.datarealms.com/viewtopic.php?f=73&t=45832
Page 1 of 1

Author:  Arcalane [ Fri Oct 17, 2014 9:49 pm ]
Post subject:  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.

Author:  clunatic [ Fri Oct 17, 2014 10:28 pm ]
Post subject:  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.

Author:  p3lb0x [ Sat Oct 18, 2014 2:38 pm ]
Post subject:  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

Author:  Asklar [ Sat Oct 18, 2014 7:05 pm ]
Post subject:  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.

Author:  CaveCricket48 [ Sat Oct 18, 2014 7:46 pm ]
Post subject:  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);

Author:  Arcalane [ Sat Oct 18, 2014 8:56 pm ]
Post subject:  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.

Author:  Asklar [ Mon Oct 20, 2014 1:08 am ]
Post subject:  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 342 times

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/