Author Topic: FSO Animation Questions  (Read 1850 times)

0 Members and 1 Guest are viewing this topic.

FSO Animation Questions
Simply put, watch my video: http://www.youtube.com/watch?v=RS70idNEqTw

From what I saw of some FSO videos, rotations are quite possible. From some others I saw that limited rotations for like afterburner nozzles, gattlings, ect scripted or set animations that have a limited degrees of rotation are possible. But the BIG question is.... Parenting. My ship has a VITAL ability, to deploy those massive fans and provide heavy energy shielding for a fleet of ships. Now the big concern is that those fans use multiple objects to perform the deployment properly without looking horrible... but can FSO maintain transform hierarchy when animating? Now I know some things in FSO cannot be parented like thruster glows, so the engines can either have no thruster graphic (rely on bloom instead...) or not move at all. But in any case this whole thing hinges on being able to use parenting to move multiple objects.

So is this possible? Or must I wait for this ability to be done someday... somehow?
I have created a masterpiece.

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: FSO Animation Questions
Bear in mind that translation is impossible in FSO; only rotation. People may tell you that translation can be faked using rotation, but the results bork the model something terrible and generally need to be removed.

Looking at that it looks...quite complex. I'm not optimistic.  :(

 
 
Re: FSO Animation Questions
Bear in mind that translation is impossible in FSO; only rotation. People may tell you that translation can be faked using rotation, but the results bork the model something terrible and generally need to be removed.

Looking at that it looks...quite complex. I'm not optimistic.  :(

The model only has rotations, not translations. I recall that subobjects have to be parented, do they not? Though I am unsure if they carry inherited transforms.
I have created a masterpiece.

 
Re: FSO Animation Questions
Sorry about the double posting but I did a test. It appear that subobjects DO maintain their transform when attached to another. I had a cylinder with an X axis spinning block with two Z axis spinning blocks attached. The X spun and the Zs spun on the tips and moved together. This bodes very well for my animation desires. Aside from the engines which glows do not translate, the fans should be workable. Until I reach that point where I put my ship ingame I don't really know how to code the animation however.
I have created a masterpiece.

 

Offline The E

  • He's Ebeneezer Goode
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: FSO Animation Questions
Yeah, that's going to get tricky. I think you're looking at a custom lua script to trigger all the animations in proper order.
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 
Re: FSO Animation Questions
Certainly this musn't require such a step? What about some work with SEXPs? A sort of SEXP template where each animation is delayed? That is really all I care about and the ship's ability to deploy will be strictly a SEXP operation... unless there are alternatives? I am most definitely no good at working with LUA, that is for certain. Farthest I got in anything near that level is ActionScript 3.0, and even then I was scrappy at best.
I have created a masterpiece.

 

Offline The E

  • He's Ebeneezer Goode
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: FSO Animation Questions
Well, that's where the community part comes in :P

The problem is, if you're doing this as a sexp, you'd be looking at having to design and test a sexp sequence that you'd then have to copy into every mission where this ship is featured. It's much, much simpler to just write a script that you can then trigger by using a single sexp.

(Not to mention that I think there's no "trigger-animation" sexp, so someone would have to code that in as well)

All in all, a lua script is the easiest, most user-friendly option.
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: FSO Animation Questions
Yeah, I think a script that would then be fired by a single SEXP would be great.

 
Re: FSO Animation Questions
(Not to mention that I think there's no "trigger-animation" sexp, so someone would have to code that in as well)

Really? I had thought that'd be possible somehow. I suppose I'll have to ask the scripting forum sometime in the future, I get he feeling this will become a rather tricky issue.
I have created a masterpiece.

 

Offline The E

  • He's Ebeneezer Goode
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: FSO Animation Questions
No, it won't. Writing the script is a half-hour job, at most. Setting up the animations in the tables, that's the trickier job.
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 
Re: FSO Animation Questions
I've done some reading on the wiki and talking to a friend who understands scripting a lot better than I do, so let me clarify:

One of the animation parameters is set to Scripted which will run when initiated by a script function which can be called via SEXp. Therefore much of the effort will be writing the code for the animation, setting up the rotations and delays. Overall the anim coding shouldn't be too hard since I have my 3DS reference which I can calculate speeds (sort of) and degrees. So is this roughly how it would go about?
I have created a masterpiece.

  

Offline The E

  • He's Ebeneezer Goode
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: FSO Animation Questions
Yeah. You set up the specifics of the rotations in the table file. The trigger type would have to be set to scripted. To get proper sequencing, you need to play with the various "+delay" values.

The script, in essence, would then boil down to this:

Code: [Select]
#Conditional Hooks

$State: GS_STATE_GAME_PLAY

$On State Start:
[
hurricane = {}
--Get a pointer to the ship we're after
for i = 1, #mn.Ships do
if mn.Ships[i].Class.Name == "Hurricane VI" then
hurricane.ship = mn.Ships[i]
end
end
]

$On Frame:
[
if hurricane.ship ~= nil then --We only need to do anything if our ship is in mission
if hurricane.ship:isValid() then --Final piece of checking, we should only proceed if we have a valid ship handle
if hurricane.triggerforward then --This is the variable we'll be setting via sexp to make the animation play forward
hurricane.ship:triggerAnimation("scripted")
hurricane.triggerforward = false
end

if hurricane.triggerbackward then
hurricane.ship:triggerAnimation("scripted", 0, false)
hurricane.triggerbackward = false
end
end
end
]

$On State End:
[
hurricane = nil --Get rid of everything.
]
#End

In a mission, you would then use the "eval-script" sexp to trigger the animation, like so:
Code: [Select]
( when
<Condition>
( eval-script "hurricane.triggerforward = true")
)

To trigger the animation in the reverse direction, use "triggerbackward" instead of "triggerforward".
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns