View unanswered posts | View active topics It is currently Tue Mar 19, 2024 4:56 am



Reply to topic  [ 3 posts ] 
 Custom wound that does not add to gibwoundlimit? 
Author Message

Joined: Thu Feb 16, 2012 4:05 am
Posts: 37
Reply with quote
Post Custom wound that does not add to gibwoundlimit?
I've been experimenting with new ways of implementing flamethrowers, and I saw someone suggest an AEmitter that uses Lua to attach a custom "on fire" wound to a target. So far, it's working excellently, except that the target will quickly hit its gibwoundlimit and explode. Which, while sort of fun, is far from expected flamethrower behavior.

Is there a way to exempt a wound from the adding to the wound count?


Sun Sep 03, 2017 9:43 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: Custom wound that does not add to gibwoundlimit?
It's been a while since I did CC lua scripting, but you could "attach" it with lua. And just let it move around with its parent instead of actually putting a wound on the character

edit: I used this for my flame effect in the brolands mod

edit edit: Would probably refactor this a lot nowadays after I've gotten better at programming.

Code:
function Create(self)
   self.target = MovableMan:GetMOFromID(self.Sharpness);
   self.timer = Timer();
   self.timer2 = Timer();
   self.interval = 100;
   self.damage = 0.25;
   self.particles = 5;
   self.particle = {}
end

function Update(self)
   if self.target.ID ~= 255 then
      self.Pos = self.target.Pos;
      self.Vel = self.target.Vel;
   
      if IsActor(self.target) then
         if self.timer:IsPastSimMS(self.interval) then
            ToActor(self.target).Health = ToActor(self.target).Health - self.damage
            self.timer:Reset();
         end
      end

      for i=0,self.particles,1 do
         if self.target.ID ~= 255 then
            if not self.particle[i] then
               self.particle[i] = CreateMOSParticle("Flame 1","Brolands.rte");
               self.particle[i].relpos = Vector(math.random(-6,6),math.random(-10,15));
               self.particle[i].Pos = self.Pos + Vector(self.particle[i].relpos.X, self.particle[i].relpos.Y):RadRotate(self.target.RotAngle);
               MovableMan:AddParticle(self.particle[i]);
            end
            self.particle[i].Pos = self.Pos + Vector(self.particle[i].relpos.X, self.particle[i].relpos.Y):RadRotate(self.target.RotAngle);
         end
      end

   else
      self.ToDelete = true;
   end
end


Mon Sep 04, 2017 7:43 pm
Profile

Joined: Fri Sep 10, 2010 1:48 am
Posts: 666
Location: Halifax, Canada
Reply with quote
Post Re: Custom wound that does not add to gibwoundlimit?
At some point we got an AttachEmitter method which lets you add wounds directly through lua, so that may be better than position following. Also, since we can store object references on actors I'd suggest you try a system that works along the following lines:

1. When a flamethrower 'bullet' hits an actor it checks if the actor's MyFlamethrowerWound (or whatever you want to call it) object value exists
2. If it doesn't exist, it attaches a new FlamethrowerWound emitter to the actor, and sets the actor's MyFlamethrowerWound object value to that emitter. The wound emitter would have a separate script on it that does whatever damage over time or other effects you want.
3. If it does exist, it tells the attached wound that another piece of fire has hit, and the wound does whatever it needs to (damages the actor, increases DOT, etc.)

As a bonus, this sort of setup could be used for any weapon of this sort, with the only difference being what the wound does over time and what it does when it gets told that another bullet has hit its actor.


Tue Sep 05, 2017 8:56 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 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:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.554s | 15 Queries | GZIP : Off ]