zapat 55 Posted January 11, 2013 (edited) I have a non-simulated object (Tower). I would like to animate its tumbling down (falling). For this I need to rotate it and move it along a curve at the same time on each frame. I use: 1. setPos variation 2.[] call BIS_fnc_setPitchBank to achieve this PROBLEM: I need ASL move for this: falling disregards terrain, right? When I setPosASL the object, setPitchBank will rotate it NOT around the center of the object, but the center will be waay underground, I guess at the center of the distance of the sea level !!?! I mean WTF?! Why? Edit: It is doing the same with setPosATL too. WTF ^ 2. If I setPosASL2 the object, setPitchBank will rotate it around its center, but I cannot move the object along its X,Y by setPosASL2. I mean WTF again ?! Why doesn't it move?! If I simply setPos the object it both moves, and rotates, but it lags and twitches a lot, even if I desregard terrain by taking getTerrainHeight into consideration. WTF again! I know it is hard to imagine this without seeing, but maybe someone has an idea. I use an FSM for this so I cannot paste code here. I've had this idea, maths and stuff is kinda working, but this ARMA-habit of something-not-working-again is driving me nuts tonight. Thx for listening. :) ---------- Post added at 11:47 PM ---------- Previous post was at 11:24 PM ---------- Lol, after 5 hours of sweating, I needed to post this to discover that I needed a _tower setDir 0; before setPitchBank. Well, it is still interesting, since I didn't touch its direction... At least it works now, making this topic useless. Sorry. Edited January 11, 2013 by zapat Share this post Link to post Share on other sites
Mattar_Tharkari 10 Posted January 11, 2013 It's always very important to read the notes on the command wiki, anything that involves vectors like setPitchBank has an odd relationship with setDir. I know your pain well lol. Share this post Link to post Share on other sites
Tankbuster 1733 Posted January 12, 2013 (edited) I wouldn't use setPosASL for this. You say that you need ASL because the object is falling and it disregards terrain, but the object you are using has no physics. Perhaps I'm not quite understanding what you want to do. I assume you want this tower to topple, like it's being demolished? By the way, setPitchBank doesn't use vectors, it uses degrees. Also, I've always found you need to do the setDir after the setpitchbank, not before. Edited January 12, 2013 by Tankbuster Share this post Link to post Share on other sites
zapat 55 Posted January 12, 2013 It works now Tankbuster, thanks. And "topple" is the word. :) I need ASL, because it is falling AND moving sideways at the same time along a curve AND rotating. I need to setPos it, since it doesn't have physics (no setVelocity). I cannot attach it to another object, since the top part of the TV tower is strange: it has a 100m gap in the visual, so that you can easily put it on top of the others, but this 100m gap exists in the obejct's dimensions. I have it nailed now, and it looks fun. :) Will be a big part of my mission. Share this post Link to post Share on other sites
Tankbuster 1733 Posted January 12, 2013 It works now Tankbuster, thanks.And "topple" is the word. :) I need ASL, because it is falling AND moving sideways at the same time along a curve AND rotating. I need to setPos it, since it doesn't have physics (no setVelocity). I cannot attach it to another object, since the top part of the TV tower is strange: it has a 100m gap in the visual, so that you can easily put it on top of the others, but this 100m gap exists in the obejct's dimensions. I have it nailed now, and it looks fun. :) Will be a big part of my mission. Show us a vid then. :) Share this post Link to post Share on other sites
Mattar_Tharkari 10 Posted January 13, 2013 (edited) Show us a demo mission! Edited January 13, 2013 by Mattar_Tharkari Share this post Link to post Share on other sites
zapat 55 Posted January 13, 2013 Soon. Top part falling down is okay, but I just can't get the physics of the bottom part toppling: it is not accelerating realistic. :( Share this post Link to post Share on other sites
zapat 55 Posted January 14, 2013 Here is what I got now: Sorted out the bottom part too, but this is a lot more fun now. Share this post Link to post Share on other sites
iceman77 18 Posted January 14, 2013 :459: That's outstanding! Could you share the demo? Share this post Link to post Share on other sites
zapat 55 Posted January 14, 2013 (edited) http://www.4shared.com/file/y1VFCjtM/towerDownChernarus.html Thx for the wow. :) Note: most of the variables are hard coded, so this works only with these two tower-parts and towers fall only to east as of now. I have my reasons for these. Edited January 14, 2013 by zapat Share this post Link to post Share on other sites
Tankbuster 1733 Posted January 14, 2013 That's really good, zapat. Nice one. Share this post Link to post Share on other sites
f2k sel 164 Posted January 14, 2013 Looks really good, nice to see a little physics applied to objects. Out of interest is there anyway velocity x,y,z could be added, I was thinking of things tumbling out of aircraft. This looks really good dropped from higher altitudes but there's no forward velocity. Share this post Link to post Share on other sites
zapat 55 Posted January 14, 2013 (edited) F2k Sel: First thing I tried was attachto to a small object (so I can add velocity to a non-simulated object via a simulated one), but these tower-parts have very unique dimensions and it didn't work. It would work with any other object though: so yes, things tumbling out of aircraft is a good idea, and I guess easily achieveable. Many objects are simulated so manipulating velocities (instead of calculating positions on every frame) make the whole thing simplier and much more universal. Still, I am afraid smooth rotation needs to be calculated on every frame... It just needs someone better in physics. :) Edited January 14, 2013 by zapat Share this post Link to post Share on other sites