View unanswered posts | View active topics It is currently Fri Dec 27, 2024 10:02 am



Reply to topic  [ 14 posts ] 
 Actor healing factor 
Author Message
User avatar

Joined: Tue Jan 12, 2010 8:25 pm
Posts: 400
Location: mukilteo, wa
Reply with quote
Post Actor healing factor
Forgive me if there's already a page on this I did a search for heal, heals, and regen

how can I make a emitter that heals my character back to 100 ever time I get hit?
I know this wont keep me from dieing due to the gib wound limit.


Tue Feb 09, 2010 5:56 am
Profile
User avatar

Joined: Wed Jan 07, 2009 10:26 am
Posts: 4074
Location: That quaint little British colony down south
Reply with quote
Post Re: Actor healing factor
You just remove the bits about the emission damage on the wound emitter.


Tue Feb 09, 2010 7:08 am
Profile WWW
DRL Developer
DRL Developer

Joined: Fri May 15, 2009 10:29 am
Posts: 4107
Location: Russia
Reply with quote
Post Re: Actor healing factor
OR:

Have some wounds that give positive damage and some that gives negative damage.


Tue Feb 09, 2010 8:02 am
Profile
User avatar

Joined: Thu Mar 06, 2008 10:54 pm
Posts: 1360
Location: USA
Reply with quote
Post Re: Actor healing factor
Ok well, there are many ways to do it, but I would just say do a simple healing script. Something like

Code:
function Create(self)
 local curdist = 200;
   for actor in MovableMan.Actors do
   local avgx = actor.Pos.X - self.Pos.X;
   local avgy = actor.Pos.Y - self.Pos.Y;
   local dist = math.sqrt(avgx ^ 2 + avgy ^ 2);
   if dist < curdist then
       curdist = dist;
       self.parent = actor;
   end
   end
end

function Update(self)
if self.parent.Health < 100 then
self.parent.Health = 100;
end
end

That's if the person fires the aemitter. It searches for the nearest actor, and keeps his health at 100 without the "regen effect".

I would need a bit more clarification on where the aemitter is to actually write a script I know will work. :3 But that's me. Also, is the aemitter attached to the guy?


Tue Feb 09, 2010 7:16 pm
Profile
User avatar

Joined: Tue Jan 12, 2010 8:25 pm
Posts: 400
Location: mukilteo, wa
Reply with quote
Post Re: Actor healing factor
Mind wrote:
That's if the person fires the aemitter. It searches for the nearest actor, and keeps his health at 100 without the "regen effect".

I would need a bit more clarification on where the aemitter is to actually write a script I know will work. :3 But that's me. Also, is the aemitter attached to the guy?


I did the emission damage trick and that worked.
As for your lua script I think it would work better due to the emission damage can raise your health beyond 100 and I think it shouldn't go past it.

The aemitter would be on the actor and always going much like the coalition medic unit, but only affecting its self.


- Thank you guys for helping :D


Tue Feb 09, 2010 8:29 pm
Profile
REAL AMERICAN HERO
User avatar

Joined: Sat Jan 27, 2007 10:25 pm
Posts: 5655
Reply with quote
Post Re: Actor healing factor
if you correctly balance burstdamage and the actual emissiondamage (and take advantage of emissioncountlimit) there's no need to use lua; .ini code will do it just fine


Wed Feb 10, 2010 1:24 am
Profile
User avatar

Joined: Sat Nov 03, 2007 9:44 pm
Posts: 1916
Location: Flint Hills
Reply with quote
Post Re: Actor healing factor
Yeah but then you can't heal at a constant rate if you set emission damage to heal the burst damage.

If you had ten simultaneously inflicted wounds, they would all heal back up just as quickly as one wound.

Also you can't heal impulse damage that way.


Wed Feb 10, 2010 5:57 am
Profile
User avatar

Joined: Tue Jan 12, 2010 8:25 pm
Posts: 400
Location: mukilteo, wa
Reply with quote
Post Re: Actor healing factor
Azukki wrote:
Yeah but then you can't heal at a constant rate if you set emission damage to heal the burst damage.

If you had ten simultaneously inflicted wounds, they would all heal back up just as quickly as one wound.

Also you can't heal impulse damage that way.


Hence the need for a lua script instead :)
Right now the negative damage wounds work but just not exactly like I want them to.
Btw is there a solution for making a sprite animation only cycle once? its for the same project.


Wed Feb 10, 2010 6:14 am
Profile
REAL AMERICAN HERO
User avatar

Joined: Sat Jan 27, 2007 10:25 pm
Posts: 5655
Reply with quote
Post Re: Actor healing factor
look at the definitions of spriteanimmode

it's mentioned in (paradoxically) the lua docs on the wiki, but it's an .ini setting (that can be changed with lua)

also, mind's script is just as useless (more so, likely) than doing this with .ini code

I really don't see exactly why your undoubtedly shitty and terribly sprited mod needs even the slightest amount of lua

Be nice to the newbie, we all started somewhere. Lua is all the rage after all. -Duh


Wed Feb 10, 2010 6:28 am
Profile
User avatar

Joined: Tue Jan 12, 2010 8:25 pm
Posts: 400
Location: mukilteo, wa
Reply with quote
Post Re: Actor healing factor
Quote:
SpriteAnimMode

* 0 = NOANIM
* 1 = ALWAYSLOOP
* 2 = ALWAYSRANDOM
* 3 = ALWAYSPINGPONG
* 4 = LOOPWHENMOVING
* 5 = LOOPWHENOPENCLOSE
* 6 = PINGPONGOPENCLOSE

SetNextFrame

Hard-sets the frame this sprite is supposed to show, to the consecutive one after the current one. If currently the last fame is this will set it to the be the first, looping the animation.

This seems to be what I need here, the setnextframe, the modes I already figured out.
This way I can pick the frame I want it to be on.


Wed Feb 10, 2010 7:06 am
Profile
User avatar

Joined: Thu Mar 06, 2008 10:54 pm
Posts: 1360
Location: USA
Reply with quote
Post Re: Actor healing factor
Aw man Grif nice one.
[Mod edit] That wasn't really necessary.
Neither is have the stuff people say on these forums. :3


Last edited by Mind on Sun Feb 21, 2010 7:41 pm, edited 2 times in total.



Wed Feb 10, 2010 11:10 pm
Profile

Joined: Thu Mar 26, 2009 6:20 pm
Posts: 10
Reply with quote
Post Re: Actor healing factor
Sorry guyz, but how to attach the script to weapon? Everytime a try scriptpath = blah blah blah blah it show error


Sun Feb 21, 2010 6:50 pm
Profile
DRL Developer
DRL Developer

Joined: Fri May 15, 2009 10:29 am
Posts: 4107
Location: Russia
Reply with quote
Post Re: Actor healing factor
Maybe make a topic with the apropriate title yourself?


Sun Feb 21, 2010 7:37 pm
Profile
User avatar

Joined: Wed Jan 07, 2009 10:26 am
Posts: 4074
Location: That quaint little British colony down south
Reply with quote
Post Re: Actor healing factor
You put it on the bullet. Not the gun. Way to follow instructions.


Mon Feb 22, 2010 6:51 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 14 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.173s | 13 Queries | GZIP : Off ]