Jump to content
Sign in to follow this  
chris330

Independant Object Animations

Recommended Posts

Just posted this at OFPEC so I'll put it here too biggrin_o.gif

Dear All,

I am presently working on the design of a large entertainment venue which will have complex and intricate light displays which I will be programming when I have completed the addons required.

As I'm sure many of you will be completely unaware I have released some addons before. Namely the CHRSA80 (released under my own name) and the LAW-80 which was released as part of the P:UKF pack, so I am not a newcomer when it comes to addon making and I am convinced this can really be done.

Ideally I am looking for someone/anyone with animation experience who could answer the following questions if you would be so kind:

1. The most difficult addon to make will be a circular frame with theatre lights mounted on it. What I wish to know is that if I create the theatre lights and the circular frame as one addon/object can I still animate the theatre lights independantly of each other.

2. Can I interrupt animations part way through their completion.

3. Does a rotation animation have to be entirely completed each time it is initiated or can I choose the angle at which I wish to stop the animation. For example if when building the addon I have allowed for 90 degrees of rotation, can I instruct the rotating object to rotate through say only 45 degrees.

The next questions I have are concerning light sources.

1. If I am able to create the circular frame and theatre lights as one entire addon can I attach a light source to each theatre light or am I limited to only one per addon (I would imagine not given that cars and trucks all have two headlights).

2. Can I change the colour of a light source, as I have seen only white lights used in the game.

3. Is the surface area of a light source editable.

I appreciate that's alot of questions but I need to get all my answers sorted out before I start building this. For example if it turns out I cannot create the theatre lights and the frame as one addon then I will need to make plans for a script which will hard code the positions of theatre lights with respect to the frame when operating at high speeds. I've done stuff like this before for my pitching camera script.

I'll build an AutoCAD drawing of my proposed design and post it up later tonight or this week for you to have a look at. Should make things a bit clearer.

Once over the initial hurdles this should go quite quickly once it has started.

Thanks in advance for the help biggrin_o.gifthumbs-up.gif

Share this post


Link to post
Share on other sites
Quote[/b] ]1. The most difficult addon to make will be a circular frame with theatre lights mounted on it. What I wish to know is that if I create the theatre lights and the circular frame as one addon/object can I still animate the theatre lights independantly of each other.

You can animate the parts of an object independantly, to either rotate left and right, or up and down, but not both. That is, using the standard config animations. Perhaps you can do something more elaborate with *.rtm anims?

Quote[/b] ]2. Can I interrupt animations part way through their completion.

You might be able to get and set the animation phase halfway through:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_Object Animate ["Anim",1]

~1

_Phase=_Object AnimationPhase "Anim"

_Object Animate ["Anim",_Phase]

Not sure if that will work, never tried it.

If it doesn't you will have to take complete control of the animation. By calling animate in a loop, and incrementing with some sort of counter. So then you can stop and start the animation within your script. I have used that method before and it does work.

For your 90 degree example:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_Phase=0

#Loop

_Object Animate ["Anim",_Phase]

_Phase=_Phase+0.01

~0.001

If (_Phase<0.5) Then {goto "Loop"}

You will have to play around with the values, and define you animation to react instantly.

Quote[/b] ]3. Does a rotation animation have to be entirely completed each time it is initiated or can I choose the angle at which I wish to stop the animation. For example if when building the addon I have allowed for 90 degrees of rotation, can I instruct the rotating object to rotate through say only 45 degrees.

You just tell it to perform half (0.5) the defined animation.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_Object Animate ["Anim",0.5]

Quote[/b] ]1. If I am able to create the circular frame and theatre lights as one entire addon can I attach a light source to each theatre light or am I limited to only one per addon (I would imagine not given that cars and trucks all have two headlights).

Probably better to define your frame as a static object, and each light as an individual object. I say object, last time I tried to create a light similar to the street lights in OFP, it CTD. You can create a stable light source with camp fires, but somehow I don't think you want the gas lamp effect?

BTW there is a search light addon kicking about somewhere, you could use something like that for each light object. Using that method, you could probably use the dowatch command to script quite complex motions.

Quote[/b] ]2. Can I change the colour of a light source, as I have seen only white lights used in the game.

I would have thought so, you can for other types of light.

Quote[/b] ]3. Is the surface area of a light source editable.

I don't think so.

Share this post


Link to post
Share on other sites

.rtm animations can only be used on soldiers/cargo posistions, there is no way (I know of, if you do, then hell tell me! wink_o.gif )

that .rtm's cna work on a building as such.

Unless you usedspecial selections in OFPAnim which is what I use to do my animated hands (WIP) smile_o.gif

Wildo

Share this post


Link to post
Share on other sites

*.rtm's can be applied to class soldier, class soldiers can be moved into cargo positions, cargo positions can be attached to vehicles, a vehicle can be setposed on a static object. OFPAnim will allow you to declare the selections you want to animate. But if that means you can animate a light, I don't know, thats why I posted it as a question smile_o.gif

Also check out class Scud, thats the only vehicle that allows *.rtm anims to be played on vehicles themselves. But I'm sure there are lots of hard coded restrictions.

Looks like rtm's on buildings will be applied in Armed Assault. But again that will probabaly be with hardcoded restrictions sad_o.gif

Using the search light addon and setpos, sounds like the way to go for Chris?

Share this post


Link to post
Share on other sites

Thanks very much for the replies smile_o.gif Of all the people I have ever met on here you are certainly one of the most resourceful UNN thumbs-up.gif

The object build will start shortly, once I have produced a CAD drawing of the lights and frame. Plus I also need to get a new license for Milkshape so I can shift stuff made in G-Max into Oxygen LT. I have a bit of time free tonight (for a bloody change) so I'll post up what I've done later.

I intend to get all animation issues fixed and thoroughly tested before commencing the desing and build of the first trial venue for the display.

I had a little play around last night with a 5T Truck with its lights on at night and managed to get a very nice strobe effect using an interrupt time of 40ms. I was also impressed with the way the lights 'looked' in the dark, it was very encouraging anyway wink_o.gif

Share this post


Link to post
Share on other sites
Quote[/b] ]Thanks very much for the replies

No worries, it sounds like an interesting project. Sorry I can't offer more help. You have to love OFP, it's like all your favourite childhood toys, rolled into one inlove.gif

Is this part of something else outside of OFP, or just a personal project?

Quote[/b] ]I had a little play around last night with a 5T Truck with its lights on at night and managed to get a very nice strobe effect using an interrupt time of 40ms. I was also impressed with the way the lights 'looked' in the dark, it was very encouraging anyway

I must admit, I'm curious to see how the searchlight addon was made now. I will have to dig it out. I'm sure the idea would work well for what you want to do.

Share this post


Link to post
Share on other sites

Thanks again for the reply. Got a little bit side-tracked when I discovered I could use a free program to do my own track mixing, so had a little play with that. Had all sorts of fantastic ideas about things I can do with this project. I'm having an operation on my nose soon so I am planning to use the time off to absolutely blast this one.

UNN..

This isn't intended for any use outside OFP, however...

I am sure it could be used to model a real life-size venue and test new light displays and set-ups before they were ever built, but I would imagine something like that was already in place anyway.

I would greatly appreciate that searchlight addon as CTD issues are something I would definitely like to avoid biggrin_o.gif

As for animations and stuff I can spin objects using the setpos and heading command which I used for my camera script (I think you might remember that one, you had quite a bit to do with the thread). It worked fine.

So I could input pitch changes using a animation and rotational changes using the commands described above. This should give me all I need to do this.

My recent forays into all things musical related hooked me up with a helpful chap at Armin van Buuren's forum who pointed me in the way of the following excellent sound/digital music theory tutorial. For anyone who is interested in this type of thing this is a real gem of a read and contains some excellent information wink_o.gifxmas_o.gif

Sound Theory Tutorial

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×