HunterKiller 0 Posted November 13, 2003 How can i animate a lift for my addon? Share this post Link to post Share on other sites
cbfasi 4 Posted November 13, 2003 I have tried to explain this before, so here goes again. If anyone else can re-word this in a way that is easy for many to understand than thanks.. To create the visual appearance of a workign lift/elevator such as those used on carrier you use a trick of mulitple animations... My method although appearing complex at first does actaully work, including in multiplayer (its been tested successfully!!!) I will try to explain it all in words, picc to friggin awkrad to obtain with all the requried information. We will be rotating each side of the lift with different animations. This best works if you are lifting a square, although you can lift other shapes but it can cause odd visual affects. The lift from above (each number = vertice, v=line and face between) 1v2 vvv 3v4 First select 1 and 3, name them say liftleft then 2 and 4, say liftright This is where it gets interesting.. find out exactly how far the lift will go vertical and put insert a vertice exactly halfway between the top of the lift movement and bottom of the lift movement, this is quite important for a good visual affect. Now move this vertice as far away as possible WITHOUT going more than 30m from center (ensures no breach of OFP limits), this means say if you lift is on one side of the ship go the other way, might get say 40m from the vertices. Â This will make one pivot point fo the side of the lift CLOSEST to this pivot point, name it say rightpivot (assuming pivot is placing to right of lift in this case) Now get the exact horizontal distance between the pivot and its nearest vertices it will be moving, this figure is required shortly. Now place a point as before, this the leftpivot, this time putting it the same distance from its vertices as the rightpivot is from liftright. This is the visual side of the O2 work, to get vehcles able to use it etc you will need to do selections in the roadway lod also. Thats the hard bit (explanation not great, hope its understandable) The cpp is quite easy in comparison. This is what is in Hermes (new unreleased version) Quote[/b] ]class Animations { class Elev1a { type="rotation"; animPeriod=60; selection="Elev1Inner"; axis="Elev1PInner"; angle0=0; angle1=0.187327; }; class Elev1b { type="rotation"; animPeriod=60; selection="Elev1Outer"; axis="Elev1POuter"; angle0=0; angle1=0.187327; }; class HDoor { type="rotation"; animPeriod=30; selection="HangDorBot"; axis="Elev1PInner"; angle0=0; angle1=-0.183259; }; }; class UserActions { class RaiseLift1 { displayName="Raise Lift A"; position="Elev1"; radius=20; condition="this animationPhase ""Elev1a"" >= 0.9"; statement="this animate [""Elev1a"", 0],this animate [""Elev1b"", 0],this animate [""HDoor"", 0]"; }; class LowerLift1 { displayName="Lower Lift A"; position="Elev1"; radius=20; condition="this animationPhase ""Elev1a"" < 0.1"; statement="this animate [""Elev1a"", 1],this animate [""Elev1b"", 1],this animate [""HDoor"", 1]"; }; }; When this lift operates, its quite slow, raises about 8m, and the hanger door opens and closes (this the lift at the fore end of Hermes) The reason this appears to work is that as the vertices on each side of the face rotate at exactly the same rate and angle the connecting faces (v) are forced to stay level, note the lift does not got straight up and down, but follows a curve which starts and finish's in the same horizontal postion, this can be used is wanted to swing a lift out and down if the rotation point is adjusted to say above the start postion. Hope this helps Share this post Link to post Share on other sites
DaSquade 0 Posted November 14, 2003 Hehe, thanks CBFASI.   Had hoped you could help us! Because i will also will need to setup a lift rotation(for my Nimitz) , this would help me to. 1/2h ago i didn't know how to make rotation ani. (exactly), so i took brsseb tutorials....1/2h later i had my deflectors working in game!!!   Ok, now i understand some more about it, i had some questions (i think you could expect that  ). 1. About the axis. I think i understand you "method". Working with 2 axis (on some height coords). Bought (in top view) on the same distance (from there selections) but mirrored. (Hard to explain...) Top view: 1  v-v  3   I  I  2  v-v  4     with 1-2 the "left_axis"               3-4 the "right_axis" Side view:   v-v 1(2)I  I  3(4)   v-v Don't know this above it right, but i think thats what you meant (?). But when reading you post above i don't understand the fact the axis 3-4 is laying 30-40m away and you say to put the other axis on the same distance (30-40m other side). Total distance between axis= +60m, IF lift is in center of addon(?) Must be me (not getting your method) otherwise that means i will have to split my part with lifts once again (so everything is within limite field). 2. About the 0.00LOD selections: i don't realy understand your selection setup (but maybee the key to this). So you make a selection of only half the lift. Doesn't that make the object deform (so only possible with box, not with side-nets, lines,..ext?) 3.   Srry but what was the MP lift bug? I "heared" about it, but don't know what (method?) or bugs it has? The only lift i know of was that building lift (lost guys name and project) and don't know his "method". Otherwise i had an other idea (not tested). It contains min. 3 rot. ani. ( all depends on the "working distance" between the lift and axis. One long rotation (knowing the lift is laying on the other end of the working field) and axis laying in 1/2 of lift height path. And 2 axis (laying on the other side, and "on" the end of the working field..+- 2m of lift. 2 last axis to correct level angle of the long rotation. So an overall S curve movement in side view. Maybee this method will need 5 axis, 2 long and 3 corection axis (1 between the 2 long). So sarting to get complex and still not perfect. This method wont keep the object "level", but won't deform (IF it deforms with your method) and won't raise perfectly vertical. As you can see, no "better" method, but i guess it is me not understanding your setup!!   Hopefull you could help me out  Share this post Link to post Share on other sites
cbfasi 4 Posted November 14, 2003 1. It doesnt really matter which side the axis points are, as long as its distance matches the distance involved with the other axis. eg.. side view v1 v2 Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â a1 a2 a1 -v1 distance is same as a2-v2 distance 2. The deformation will not take place as long as both selections are animated, in my cpp thats Elev1Inner & Elev1Outer. The simpler the selection the better. This is the Elev1Inner and Elev1Outer selections from Hermes82 lod 0.00 3. Erm... the MP problem was non-existant, just many said that it wouldn't work in MP, but as this is not script based it does work. Share this post Link to post Share on other sites
DaSquade 0 Posted November 14, 2003  Ok, that side view explains it all. Thanks  Indeed, that method of axis pos. should work perfectly!!! You will have indeed a "level" platform. I still don't see how those sides will move (rotate), but gonna try it! Anyway, thanks for the extra pic's CBFASI!! But you 2 posts explains it all. Share this post Link to post Share on other sites