View unanswered posts | View active topics It is currently Wed Dec 25, 2024 5:48 pm



Reply to topic  [ 11 posts ] 
 MOSParticle problems 
Author Message
User avatar

Joined: Wed Apr 16, 2014 8:53 am
Posts: 64
Location: Bunker busting.
Reply with quote
Post MOSParticle problems
So, I have this MOSParticle i'm trying to get to work, but I have two issues.

1. it's not animating.

2. -1 LifeTime isn't preventing it from disappearing.

code:
Code:
AddEffect = MOSParticle
   PresetName = Water Surface
   AddToGroup = Water
   Buyable = 1
   GoldValue = 0
   Mass = 0
   GlobalAccScalar = 0
   RestThreshold = -1
   LifeTime = -1
   AirResistance = 0
   Sharpness = 0
   HitsMOs = 0
   GetsHitByMOs = 0
   SpriteFile = ContentFile
      FilePath = GraveWaters.rte/Shared/Wripple.bmp
   FrameCount = 8
   Framerate = 9999
   SpriteOffset = Vector
      X = 0
      Y = 0
   AngularVel = 0
   Atom = Atom
      Material = Material
         CopyOf = Water
      TrailLength = 0


(it's buyable so that I can test it.)


Thu Dec 14, 2017 3:12 am
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post Re: MOSParticle problems
I might be misremembering, but I think MOSParticles specifically animate based on how long they last - first frame when they spawn, and they animate through their lifetime, last frame appearing when they die. Your MOSParticle might not be animating because it has an endless LifeTime.

Try putting a script on your particle that's just

Code:
function Update(self)
  self.ToDelete = false;
end


Or have a single script handle multiple particles. Which can also handle animating by manually spawning particles with specific frames at the right time.


Thu Dec 14, 2017 3:28 am
Profile
User avatar

Joined: Wed Apr 16, 2014 8:53 am
Posts: 64
Location: Bunker busting.
Reply with quote
Post Re: MOSParticle problems
CaveCricket48 wrote:
I might be misremembering, but I think MOSParticles specifically animate based on how long they last - first frame when they spawn, and they animate through their lifetime, last frame appearing when they die. Your MOSParticle might not be animating because it has an endless LifeTime.

Try putting a script on your particle that's just

Code:
function Update(self)
  self.ToDelete = false;
end


Or have a single script handle multiple particles. Which can also handle animating by manually spawning particles with specific frames at the right time.


Well, that's my second problem, -1 lifetime isn't preventing it from death.

Edit: and now i've tried giving it a lifetime, but it still didn't animate.


Last edited by grave accent on Thu Dec 14, 2017 3:43 am, edited 1 time in total.



Thu Dec 14, 2017 3:39 am
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post Re: MOSParticle problems
Did you try a script or something


Thu Dec 14, 2017 3:41 am
Profile
User avatar

Joined: Wed Apr 16, 2014 8:53 am
Posts: 64
Location: Bunker busting.
Reply with quote
Post Re: MOSParticle problems
Well, the script worked, it doesn't delete anymore.

Still can't get it to animate, though.


Thu Dec 14, 2017 3:48 am
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post Re: MOSParticle problems
Give the particles a lifetime that's the length you want the animation to be. Give the script a Destroy() block that spawns a particle in its place. That way when it dies, it creates a new particle, and accomplishes animation.


Thu Dec 14, 2017 3:53 am
Profile
User avatar

Joined: Wed Apr 16, 2014 8:53 am
Posts: 64
Location: Bunker busting.
Reply with quote
Post Re: MOSParticle problems
Well, I gave it a lifetime of 4000 before you gave me the script, and it still didn't animate.


Thu Dec 14, 2017 3:55 am
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post Re: MOSParticle problems
Try setting the Framerate to 0


Thu Dec 14, 2017 3:57 am
Profile
User avatar

Joined: Wed Apr 16, 2014 8:53 am
Posts: 64
Location: Bunker busting.
Reply with quote
Post Re: MOSParticle problems
Well, that appears to have done it. Thanks cave.

Now I just gotta make it respawn, as it currently hangs on the final frame cause of the deletion prevention.


Thu Dec 14, 2017 4:01 am
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post Re: MOSParticle problems
Code:
function Create(self)
  self.animTimer = Timer();
end

function Update(self)
  self.ToDelete = false;
  if self.animTimer:IsPastSimMS(4000) then
    self.ToDelete = true;
  end
end

function Destroy(self)
  local water = CreateMOSParticle("Water Surface");
  water.Pos = self.Pos;
  MovableMan:AddParticle(water);
end


or something


Thu Dec 14, 2017 4:13 am
Profile
User avatar

Joined: Wed Apr 16, 2014 8:53 am
Posts: 64
Location: Bunker busting.
Reply with quote
Post Re: MOSParticle problems
WOO, that did it. Cave, you're a modsaver


Thu Dec 14, 2017 4:24 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 11 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.053s | 14 Queries | GZIP : Off ]