Author |
Message |
grave accent
Joined: Wed Apr 16, 2014 8:53 am Posts: 64 Location: Bunker busting.
|
![Post Post](./styles/images/imageset/icon_topic_latest.gif) 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 |
|
![](./styles/acidtech_tiger/theme/images/spacer.gif) |
CaveCricket48
Joined: Tue Jun 12, 2007 11:52 pm Posts: 13143 Location: Here
|
![Post Post](./styles/images/imageset/icon_topic_latest.gif) 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 |
|
![](./styles/acidtech_tiger/theme/images/spacer.gif) |
grave accent
Joined: Wed Apr 16, 2014 8:53 am Posts: 64 Location: Bunker busting.
|
![Post Post](./styles/images/imageset/icon_topic_latest.gif) 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 |
|
![](./styles/acidtech_tiger/theme/images/spacer.gif) |
CaveCricket48
Joined: Tue Jun 12, 2007 11:52 pm Posts: 13143 Location: Here
|
![Post Post](./styles/images/imageset/icon_topic_latest.gif) Re: MOSParticle problems
Did you try a script or something
|
Thu Dec 14, 2017 3:41 am |
|
![](./styles/acidtech_tiger/theme/images/spacer.gif) |
grave accent
Joined: Wed Apr 16, 2014 8:53 am Posts: 64 Location: Bunker busting.
|
![Post Post](./styles/images/imageset/icon_topic_latest.gif) 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 |
|
![](./styles/acidtech_tiger/theme/images/spacer.gif) |
CaveCricket48
Joined: Tue Jun 12, 2007 11:52 pm Posts: 13143 Location: Here
|
![Post Post](./styles/images/imageset/icon_topic_latest.gif) 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 |
|
![](./styles/acidtech_tiger/theme/images/spacer.gif) |
grave accent
Joined: Wed Apr 16, 2014 8:53 am Posts: 64 Location: Bunker busting.
|
![Post Post](./styles/images/imageset/icon_topic_latest.gif) 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 |
|
![](./styles/acidtech_tiger/theme/images/spacer.gif) |
CaveCricket48
Joined: Tue Jun 12, 2007 11:52 pm Posts: 13143 Location: Here
|
![Post Post](./styles/images/imageset/icon_topic_latest.gif) Re: MOSParticle problems
Try setting the Framerate to 0
|
Thu Dec 14, 2017 3:57 am |
|
![](./styles/acidtech_tiger/theme/images/spacer.gif) |
grave accent
Joined: Wed Apr 16, 2014 8:53 am Posts: 64 Location: Bunker busting.
|
![Post Post](./styles/images/imageset/icon_topic_latest.gif) 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 |
|
![](./styles/acidtech_tiger/theme/images/spacer.gif) |
CaveCricket48
Joined: Tue Jun 12, 2007 11:52 pm Posts: 13143 Location: Here
|
![Post Post](./styles/images/imageset/icon_topic_latest.gif) 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 |
|
![](./styles/acidtech_tiger/theme/images/spacer.gif) |
grave accent
Joined: Wed Apr 16, 2014 8:53 am Posts: 64 Location: Bunker busting.
|
![Post Post](./styles/images/imageset/icon_topic_latest.gif) Re: MOSParticle problems
WOO, that did it. Cave, you're a modsaver
|
Thu Dec 14, 2017 4:24 am |
|
![](./styles/acidtech_tiger/theme/images/spacer.gif) |
|