View unanswered posts | View active topics It is currently Sun Sep 29, 2024 1:00 pm



Reply to topic  [ 9 posts ] 
 Eternal Gibs - How do I stop this? 
Author Message

Joined: Sat Aug 22, 2009 11:56 am
Posts: 25
Reply with quote
Post Eternal Gibs - How do I stop this?
Hi there.
I'm sorry if this is posted in the wrong place, after half an hour of fruitless searching, I still haven't found the IRC channel details. I'd rather not use the built-in Java IRC client, but searches on the forums didn't turn up the details. Anyway!

I've recently gotten started on my modding, and I've been picking apart other peoples creations, and messing with the variables to see what does what. I grabbed Witty's Cancer Bomb, and changed it into an erratically moving 'bee' missile. The problem is the fact that it persists forever.
I was intending for large amounts of these to be launched from a flamethrower-type gun, yet since they never disappear, this is probably a silly idea.
I'll attach the script I'm using, If anyone has a few minute of spare time, I'd love for them to tell me what I'm doing wrong, and how I could go about making these lazer bees explode or disappear after a set amount of time, rather than buzzing around eternally.

http://pastebin.com/m7d4a3c9b

There's the link to the code I'm using.
I could attach all necessary files if you'd like, if anyone wants to see the lazer bees ingame, or if the code is not sufficient to fix the problem.
Thanks a lot :)

-Ameefmu


Fri Nov 20, 2009 3:25 pm
Profile
User avatar

Joined: Fri Jul 24, 2009 9:03 am
Posts: 159
Reply with quote
Post Re: Eternal Gibs - How do I stop this?
So they simply don't dissapear? If you havn't already make a prokimity check for the nearest actor and self:GibThis if within a certian range, I'm not sure if I have the right code but I think this is how it's done.


Fri Nov 20, 2009 4:53 pm
Profile
DRL Developer
DRL Developer

Joined: Tue Aug 11, 2009 5:09 am
Posts: 395
Reply with quote
Post Re: Eternal Gibs - How do I stop this?
If you place the code below in a .lua file and attach it to an object (AEmitter, MOSRotating but not MOPixel), it will gib after its Sharpness number of milliseconds.

Code:
function Create(self)
    self.Life = Timer()
   self.lifeTime = self.Sharpness
   self.Sharpness = 1
end

function Update(self)
   if self.Life:IsPastSimMS(self.lifeTime) then
      self:GibThis()
   end
end


Fri Nov 20, 2009 6:20 pm
Profile
User avatar

Joined: Mon Jul 16, 2007 9:50 am
Posts: 1512
Location: Tallahassee, FL
Reply with quote
Post Re: Eternal Gibs - How do I stop this?
instead of setting up a life timer, you can just use self.Age.


Fri Nov 20, 2009 7:16 pm
Profile YIM
DRL Developer
DRL Developer

Joined: Tue Aug 11, 2009 5:09 am
Posts: 395
Reply with quote
Post Re: Eternal Gibs - How do I stop this?
Darlos9D wrote:
instead of setting up a life timer, you can just use self.Age.


I thought so as well, but according to the API description Age is ms in real time not sim time. So if you use age the object will be gibbed sooner if the game laggs (assuming that the description is correct, witch I think it is but have not verified).


Fri Nov 20, 2009 7:43 pm
Profile
REAL AMERICAN HERO
User avatar

Joined: Sat Jan 27, 2007 10:25 pm
Posts: 5655
Reply with quote
Post Re: Eternal Gibs - How do I stop this?
Guys, if I'm reading it right, his problem isn't that it isn't gibbing, it's that it's recursively gibbing.

Whitty's cancer bomb (probably) does that, and the code will do that.


Fri Nov 20, 2009 10:40 pm
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13143
Location: Here
Reply with quote
Post Re: Eternal Gibs - How do I stop this?
"SmokeThing22" is what's causing the recursive gibbing. Delete the emission in it that spawns "SmokeThing2".


Fri Nov 20, 2009 11:30 pm
Profile

Joined: Sat Aug 22, 2009 11:56 am
Posts: 25
Reply with quote
Post Re: Eternal Gibs - How do I stop this?
Thanks very much all!

For the sake of personal growth and learning, I'm going to attempt all of these. I should have recorded a GIF of the time I set the spawn count of Smoke Thing 22 to 5, which would (as far as I know) split the gib into 6 when it came into contact with ground. Of course, the same thing would happen to the other 5 that were just spawned...

Sorry if I didn't explain the problem perfectly. Pretty much what happens is that the bomb object would come down inside the craft, which would then open up and release 1-2 gibs for each object purchased. These would weave erratically around the map, and when colliding with scenery would sometimes split. Each one would last forever unless they exited the top or the bottom of the map. I was just looking for a way to cause them to die/explode/disappear on impact, rather than buzz around eternally.

Anyway! Thanks very much. Have lots of faith in this community now.


Sat Nov 21, 2009 1:39 am
Profile
User avatar

Joined: Sun Jul 13, 2008 9:57 am
Posts: 4886
Location: some compy
Reply with quote
Post Re: Eternal Gibs - How do I stop this?
Darlos9D wrote:
instead of setting up a life timer, you can just use self.Age.
Never ever use self.Age = 0 on an object that gibs. it means infinite recursive gibbing, in my experience.


Sat Nov 21, 2009 5:11 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 9 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.035s | 15 Queries | GZIP : Off ]