View unanswered posts | View active topics It is currently Sun Dec 29, 2024 6:09 am



Reply to topic  [ 11 posts ] 
 Multiple sprites for one actor 
Author Message
User avatar

Joined: Wed Jul 06, 2011 5:11 pm
Posts: 226
Reply with quote
Post 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?


Fri Jul 15, 2011 4:15 pm
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Fri Jan 07, 2011 8:01 am
Posts: 6211
Location: In your office, earning your salary.
Reply with quote
Post Re: Multiple sprites for one actor
I guess you can do that with lua, not sure if you can with ini.


Fri Jul 15, 2011 6:51 pm
Profile
User avatar

Joined: Wed Jul 06, 2011 5:11 pm
Posts: 226
Reply with quote
Post Re: Multiple sprites for one actor
Hmm, too bad I have absolutely no idea how to use lua :P


Fri Jul 15, 2011 11:23 pm
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Fri Jan 07, 2011 8:01 am
Posts: 6211
Location: In your office, earning your salary.
Reply with quote
Post 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?


Sat Jul 16, 2011 12:51 am
Profile

Joined: Fri Dec 18, 2009 11:00 pm
Posts: 167
Reply with quote
Post 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.


Sat Jul 16, 2011 8:07 am
Profile
User avatar

Joined: Mon Oct 25, 2010 5:51 am
Posts: 1198
Location: Sydney
Reply with quote
Post 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?


Sat Jul 16, 2011 8:32 am
Profile

Joined: Fri Dec 18, 2009 11:00 pm
Posts: 167
Reply with quote
Post 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.


Last edited by none on Mon Jul 18, 2011 11:43 am, edited 1 time in total.



Sat Jul 16, 2011 3:49 pm
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Tue May 25, 2010 8:27 pm
Posts: 4521
Location: Constant motion
Reply with quote
Post 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.


Sun Jul 17, 2011 4:59 pm
Profile
User avatar

Joined: Sun Jul 13, 2008 9:57 am
Posts: 4886
Location: some compy
Reply with quote
Post 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.


Mon Jul 18, 2011 10:12 am
Profile WWW
User avatar

Joined: Thu Jan 07, 2010 1:54 am
Posts: 99
Location: St. Elsewhere
Reply with quote
Post 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.


Thu Jul 21, 2011 7:36 am
Profile
User avatar

Joined: Sat Jun 19, 2010 5:02 pm
Posts: 331
Location: Mekkan
Reply with quote
Post 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


Thu Aug 04, 2011 3:37 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.062s | 13 Queries | GZIP : Off ]