Data Realms Fan Forums
http://45.55.195.193/

Multiple sprites for one actor
http://45.55.195.193/viewtopic.php?f=1&t=24581
Page 1 of 1

Author:  Pantera1993 [ Fri Jul 15, 2011 4:15 pm ]
Post subject:  Multiple sprites for one actor

My situation is that I have an actor who's torso has say 30-ish sprites, designed to make the actor look like it's body pieces are turning and such, but I only want the sprites to cycle while the actor is firing. Is there a way to make this happen?

Author:  Asklar [ Fri Jul 15, 2011 6:51 pm ]
Post subject:  Re: Multiple sprites for one actor

I guess you can do that with lua, not sure if you can with ini.

Author:  Pantera1993 [ Fri Jul 15, 2011 11:23 pm ]
Post subject:  Re: Multiple sprites for one actor

Hmm, too bad I have absolutely no idea how to use lua :P

Author:  Asklar [ Sat Jul 16, 2011 12:51 am ]
Post subject:  Re: Multiple sprites for one actor

But it shouldn't be too hard.

Something on the update function to set it's frame to frame 000, and make it change if you click.

Something like:

Code:
function Update(self)
if self:IsPlayerControlled and self:GetController():IsState(0,true) then
 self.Frame = self.Frame + 1
   if self.Frame = self.FrameCount then
       self.Frame = 0
   end
else
self.Frame = 0
end
end
 


This is just a script that I think that could work, but I've never worked with sprites on lua, so probably it won't work.

Someone who know more lua could make this code work?

Author:  none [ Sat Jul 16, 2011 8:07 am ]
Post subject:  Re: Multiple sprites for one actor

Code:
function Create(self)
   self.setframe = 0;
end

function Update(self)
   self.Frame = self.setframe;
   
   if self:IsPlayerControlled() and self:GetController():IsState(0,true) then
      if (self.Frame + 1) > (self.FrameCount - 1) then
         self.setframe = 0;
      else
         self.setframe = self.setframe + 1;
      end
   end
end


Make sure to set SpriteAnimMode = 0 in .ini file.

Author:  Kettenkrad [ Sat Jul 16, 2011 8:32 am ]
Post subject:  Re: Multiple sprites for one actor

Is it possible to apply this to say, an actor, including limbs? The problem that I foresee is that leg / arm sprites already have ~5 frames. Can you just completely override the .ini script and replace a sprite set using .lua?

Author:  none [ Sat Jul 16, 2011 3:49 pm ]
Post subject:  Re: Multiple sprites for one actor

N to the O , you would have to do it with attachables on the limbs.

Yes it seems you can.

Author:  Roast Veg [ Sun Jul 17, 2011 4:59 pm ]
Post subject:  Re: Multiple sprites for one actor

It is totally possible, through MO fiddling to change the frame of every part of an actor, excluding the hands and feet, and has been done before, such as in some of the older versions of UniTec.

Author:  Geti [ Mon Jul 18, 2011 10:12 am ]
Post subject:  Re: Multiple sprites for one actor

Plus Attachables on arms rotate to match the head (See: Dan is lazy and this is how guns aim at where you're pointing afaik) -> no real control, Attachables on legs function acceptably fairly often but can also lead to.. interesting impulse transmission unless you know what you're doing. Limb attachables are just generally a dodgy area.

Author:  CCS [ Thu Jul 21, 2011 7:36 am ]
Post subject:  Re: Multiple sprites for one actor

Hey Pantera, maybe LFOWit can give a point in the right direction. His/her Armored Dummy Units have animated ribcages.

Author:  Awesomeness [ Thu Aug 04, 2011 3:37 am ]
Post subject:  Re: Multiple sprites for one actor

I'm pretty sure I could do this with Lua, I've done plenty of animations before with Lua. But I do believe if you want it to just consistently swap frames, there's a way to do that with ini. I've seen it done with flames. Just look at the ini for Molotov Flame, in the Ronin explosives. It swaps frames via ini.
Code:
AddEffect = AEmitter
   PresetName = Molotov Fire
   Mass = 0.1
   HitsMOs = 0
   GetsHitByMOs = 0
   SpriteFile = ContentFile
      FilePath = Ronin.rte/Devices/Explosives/MolFlame00.bmp
   FrameCount = 5
   SpriteAnimMode = 1
   SpriteAnimDuration = 250
   SpriteOffset = Vector
      X = -5
      Y = -6
   AtomGroup = AtomGroup
      AutoGenerate = 1
      Material = Material
         CopyOf = Air
      Resolution = 0
      Depth = 5
   ScreenEffect = ContentFile
      FilePath = Base.rte/Effects/Glows/YellowSmall.bmp
   EffectStartTime = 0
   EffectStartStrength = 1.0
   EffectAlwaysShows = 1
   BurstTriggered = 0
   EmissionEnabled = 1
   EmissionsIgnoreThis = 0
   ParticlesPerMinute = 0
   BurstSize = 0
   BurstScale = 0
   BurstSpacing = 0
   EmissionDamage = 0
   FlashOnlyOnBurst = 0

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/