Michael Betke Posted December 12, 2009 Share Posted December 12, 2009 I need a guy who is willing to help me out with some basic sripting stuff for my non-game releated projects. Maybe it's not that difficult but I can do content only. :-7 Here's what I need: I have an animated animal. It has two animations: idle / walk It is supposed to wander around in a level. Just along an AI spline. No interaction with the player needed. My goal is to have several animals walking in a group along these splines. So this is what I need: Firstly a .lua script that makes my animal walking around. Secondly a dialog in the properties menu for the animal which lets me check "Use walk anim" or "Use idle anim". Two checkboxes would be logically in my opinion. That's it. I will rename this script for using with other animals. They have the same setup. I tried to adopt a crawler script but my animal walks through the terrain and does other strange stuff...I'm really untalented on such coding/scripting stuff. Quote Pure3d Visualizations Germany - digital essences AAA 3D Model Shop specialized on nature and environments Link to comment Share on other sites More sharing options...
TylerH Posted December 12, 2009 Share Posted December 12, 2009 You can add me on MSN messenger, jamesbond92393 [at] aol.com I can help you out. Quote nVidia 530M Intel Core i7 - 2.3Ghz 8GB DDR3 RAM Windows 7 Ultimate (64x)----- Visual Studio 2010 Ultimate Google Chrome Creative Suite 5 FL Studio 10 Office 15 ----- Expert Professional Expert BMX Programmer ----- Link to comment Share on other sites More sharing options...
Michael Betke Posted December 13, 2009 Author Share Posted December 13, 2009 Thanks I will tomorrow. A bit busy at the moment. Quote Pure3d Visualizations Germany - digital essences AAA 3D Model Shop specialized on nature and environments Link to comment Share on other sites More sharing options...
Michael Betke Posted December 13, 2009 Author Share Posted December 13, 2009 Tyler unfortunatly can't do it because of the animation or whatever. But I still need this one done. So I still appreciate help. Quote Pure3d Visualizations Germany - digital essences AAA 3D Model Shop specialized on nature and environments Link to comment Share on other sites More sharing options...
TylerH Posted December 13, 2009 Share Posted December 13, 2009 My point was, that you can't create a script to have that cow follow waypoints, because the animation, over its 2500 frames, leads to cow to move around a 5 - 10 meter space. So no matter what, your cow will never be aligned to the movement of its character controller. You obviously don't understand that I was saying that your animation cycle is way too complex. You need a simple animation for the cow that has its legs or whatever move, but doesn't lead the cow to actually move 2-5 meters AWAY from its origin after 15 seconds. Quote nVidia 530M Intel Core i7 - 2.3Ghz 8GB DDR3 RAM Windows 7 Ultimate (64x)----- Visual Studio 2010 Ultimate Google Chrome Creative Suite 5 FL Studio 10 Office 15 ----- Expert Professional Expert BMX Programmer ----- Link to comment Share on other sites More sharing options...
Niosop Posted December 13, 2009 Share Posted December 13, 2009 Unless the animation movement is the actual movement you want in the scene. Quote Windows 7 x64 - Q6700 @ 2.66GHz - 4GB RAM - 8800 GTX ZBrush - Blender Link to comment Share on other sites More sharing options...
TylerH Posted December 13, 2009 Share Posted December 13, 2009 In which case you wouldn't need any Lua setup other than looping the animation. Following AI Nodes and a Spline path is different from running an animation to give the illusion of the animal wondering around. Quote nVidia 530M Intel Core i7 - 2.3Ghz 8GB DDR3 RAM Windows 7 Ultimate (64x)----- Visual Studio 2010 Ultimate Google Chrome Creative Suite 5 FL Studio 10 Office 15 ----- Expert Professional Expert BMX Programmer ----- Link to comment Share on other sites More sharing options...
Niosop Posted December 13, 2009 Share Posted December 13, 2009 Well if you derive the movement from the animation then it ceases to be an illusion But it's a lot less flexible than making the motion in game. Were there no decent points in the animation that could have been used as a walk cycle? Quote Windows 7 x64 - Q6700 @ 2.66GHz - 4GB RAM - 8800 GTX ZBrush - Blender Link to comment Share on other sites More sharing options...
TylerH Posted December 13, 2009 Share Posted December 13, 2009 No, every single frame containing leg motion involved movement from the model's origin. Quote nVidia 530M Intel Core i7 - 2.3Ghz 8GB DDR3 RAM Windows 7 Ultimate (64x)----- Visual Studio 2010 Ultimate Google Chrome Creative Suite 5 FL Studio 10 Office 15 ----- Expert Professional Expert BMX Programmer ----- Link to comment Share on other sites More sharing options...
Niosop Posted December 13, 2009 Share Posted December 13, 2009 That's fine, I'm using non-normalized animations now and driving the movement based on the movement off the origin of the animation. As long as the there is a frame sequence that matches up the relative positions of the legs/body/tail/etc then I can fix up my animation code and pass it to him. Most raw motion capture data is not normalized so I figured it would be easier to do it in code than to manually normalize the whole thing. Although w/ blender's IPO curves it would be pretty easy to zero out the root bone motion I suppose. Quote Windows 7 x64 - Q6700 @ 2.66GHz - 4GB RAM - 8800 GTX ZBrush - Blender Link to comment Share on other sites More sharing options...
Michael Betke Posted December 17, 2009 Author Share Posted December 17, 2009 You obviously don't understand that I was saying that your animation cycle is way too complex. You need a simple animation for the cow that has its legs or whatever move, but doesn't lead the cow to actually move 2-5 meters AWAY from its origin after 15 seconds. Sorry missed the thread for some reasons... I totally understand what you mean and it was a misunderstanding with the freelancer I hired. However it's not a big problem because I can still use the models without walking along the spline. Most of them will idle and stand still. A few can walk slowly in their cycle. I aggree it's not that nice as I intended in the first time but it won#t change the fact that I need a .lua containing the following stuff. - ability to choose (1,2,3 or a checkbox, slider, whatever) the animation for the specific selected model in properties menu. - choosing at which frame the animation start (or setting up a random start frame automatic). Otherwise all animals will start at frame "1" makeing them looking odd. This is really important for me and has nothing to do with the splines. This woukd be needed for the next animals eventually. Quote Pure3d Visualizations Germany - digital essences AAA 3D Model Shop specialized on nature and environments Link to comment Share on other sites More sharing options...
TylerH Posted December 17, 2009 Share Posted December 17, 2009 I can definitely do that for you then Just chat with me on MSN again, and I can set up your script to have the properties grid and proper settings for the animation. Quote nVidia 530M Intel Core i7 - 2.3Ghz 8GB DDR3 RAM Windows 7 Ultimate (64x)----- Visual Studio 2010 Ultimate Google Chrome Creative Suite 5 FL Studio 10 Office 15 ----- Expert Professional Expert BMX Programmer ----- Link to comment Share on other sites More sharing options...
Canardia Posted December 17, 2009 Share Posted December 17, 2009 It doesn't really matter if the mesh translates during the animation, as you can translate it back to the mesh, and move the body instead. This can be done with a very simple function which calculates the bone movement and converts it into mesh counter-movement. Actually an animation which translates the mesh is even more useful, as not all movements are linear in speed, so you have more information in them as with a animation which keeps the mesh in the same spot. Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
Michael Betke Posted December 17, 2009 Author Share Posted December 17, 2009 I tried myself and rewrote a script I found using the famous try and error method. I can rotate my animals now and set frames I want to play. Now I could use the rest of the stuff. --Include the base script for all classes dofile("Scripts/base.lua") function Spawn(model) local entity=base_Spawn(model) function entity:Update() local frame=AppTime()*0.02 frame=math.mod(frame,0-500) if EntityCulled(model,fw.main.camera)==0 then self.model:Animate(frame,1,0,1) end end end --Update function, called during every UpdateWorld() function Update(world) if world==world_main then local model,entity for model,entity in pairs(entitytable) do if model.world==world then entity:Update() end end end end Quote Pure3d Visualizations Germany - digital essences AAA 3D Model Shop specialized on nature and environments Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.