• Using sequences, but they do not work.
    9 replies, posted
I have created scripts both client and server or both, with lights sounds and all that. I had also made vehicles with $animations using a premade QC and those worked well, of course after trial and error. But i decided to touch Sequences., and it messed everything up. So i created a separate model and script so i can debug for myself and make sequences, but alas it was to no avail. this is a large bundle of information here, but to TL;DR it, I made a spinning sequence, but it will not work in game. The model is fine and everything. NOTE: the idle sequence is my animation sequence i use, it makes the top cube spin. It works in blender but not ingame. QC file: [QUOTE]$modelname "CubeT.mdl" $body mybody "CubeT.smd" $staticprop $surfaceprop metal $cdmaterials "models" $sequence idle "Spin.smd" $collisionmodel "CubeT_Phy.smd" { $concave $mass 2000 } [/QUOTE] My script to play the idle sequence. [LUA] hook.Add("PlayerSpawnedProp","TestProp", Test); function Test(ply, model, ent) // //ENT.AutomaticFrameAdvance = true local seq = ent:LookupSequence("idle"); ent:SetSequence(seq); ent:SetPlaybackRate(1); print("ok"); end [/LUA] My compile log [QUOTE] Compiling with Crowbar 0.33.0.0: "C:\Users\crazyboxhead\Desktop\Saved\Mods\Test-AnimTest\TestingAnimation\qc.qc" ... Compiling ".\qc.qc" ... WARNING: Failed to load keyvalues file cfg/mount.cfg! qdir: "c:\users\crazyboxhead\desktop\saved\mods\test-animtest\testinganimation\" gamedir: "C:\Users\crazyboxhead\Desktop\Saved\ModTools\" g_path: "qc.qc" Building binary model files... Working on "qc.qc" SMD MODEL CubeT.smd SMD MODEL Spin.smd SMD MODEL CubeT_Phy.smd Model has 1 convex sub-parts Collision model completed. --------------------- writing C:\Users\crazyboxhead\Desktop\Saved\ModTools\models/CubeT.mdl: bones 964 bytes (1) animation x y ips angle @idle 0.00 0.00 : 1.#J ( 90.00) 0.0 animations 112 bytes (1 anims) (1 frames) [0:00] sequences 220 bytes (1 seq) ik/pose 164 bytes eyeballs 0 bytes (0 eyeballs) flexes 0 bytes (0 flexes) textures 72 bytes keyvalues 0 bytes bone transforms 0 bytes Collision model volume 160000.02 in^3 collision 0 bytes total 1720 --------------------- writing C:\Users\crazyboxhead\Desktop\Saved\ModTools\models/CubeT.vvd: vertices 2304 bytes (48 vertices) tangents 768 bytes (48 vertices) total 3136 bytes --------------------- Generating optimized mesh "C:\Users\crazyboxhead\Desktop\Saved\ModTools\models/CubeT.sw.vtx": body parts: 8 bytes models: 20 bytes model LODs: 12 bytes meshes: 9 bytes strip groups: 25 bytes strips: 27 bytes verts: 432 bytes indices: 144 bytes bone changes: 16 bytes everything: 717 bytes --------------------- Generating optimized mesh "C:\Users\crazyboxhead\Desktop\Saved\ModTools\models/CubeT.dx80.vtx": body parts: 8 bytes models: 20 bytes model LODs: 12 bytes meshes: 9 bytes strip groups: 25 bytes strips: 27 bytes verts: 432 bytes indices: 144 bytes bone changes: 16 bytes everything: 717 bytes --------------------- Generating optimized mesh "C:\Users\crazyboxhead\Desktop\Saved\ModTools\models/CubeT.dx90.vtx": body parts: 8 bytes models: 20 bytes model LODs: 12 bytes meshes: 9 bytes strip groups: 25 bytes strips: 27 bytes verts: 432 bytes indices: 144 bytes bone changes: 16 bytes everything: 717 bytes Completed "qc.qc" ... Compiling ".\qc.qc" finished. Check above for any errors. ... Compiling with Crowbar 0.33.0.0: "C:\Users\crazyboxhead\Desktop\Saved\Mods\Test-AnimTest\TestingAnimation\qc.qc" finished. [/QUOTE] MODEL INGAME: [IMG]http://i.imgur.com/trUKNLh.jpg[/IMG] Like I said the top cube is supposed to spin 360 around Z axis. [URL="https://www.dropbox.com/sh/643ed9jan7anr7l/AAAJHuRInRPDGWtveCgh2xf4a?dl=0"]THIS[/URL] is a link to the dropbox for all the source files, including the .blend file. It works perfectly in blender. Thanks for taking your time to read and consider my problem.
Use my Easy Animation Tool > Right click on the prop and press "Make Animatable", and then use the tool to play test the animation. If I remember correctly, prop_physics does not support animations. (The animation is being reset every frame or something like that)
didn't know that staticprops can do animations. maybe you should remove it?
Okay i will do that, thanks for the speedy reply. Also does this mean I should somehow change it to prop_dynamic? [editline]7th February 2016[/editline] using the easy animation tool, it shows that there is no animations on the entity. [editline]7th February 2016[/editline] [QUOTE]"prop_physics Can have tens to hundreds of them in a level, depending on complexity. Can be placed inside the Hammer editor. Must have collision associated with them. Will not affect lightmaps in the world, but they do cast dynamic shadows. Will be vertex lit like standard studio models. Will use LOD system. Fade distances can be set in Hammer editor. Are faded earlier on low-end hardware unless settings changed. May use models that are not compiled with $staticprop. May have animations. Have low (but non-zero) network overhead + higher memory usage (as much as any entity). Is a real entity with inputs and outputs. Can not be directly hierarchically attached to other entities. Can be constrained to other entities by various physics constraints entities. Optimal from a visibility standpoint, it uses the convex hull of the object. From a visibility standpoint, they are assumed to be boxes. Additional characteristics?"[/QUOTE] So i assume that prop_physics can have anims. using prop_dynamic and override i can not pick it up or have any physics box.
Try again. The tool had a problem not detecting the correct amount of animation a model has ( so it was assuming there was 0 animations whereas there was only one ). And no, prop_physics [b]cannot[/b] be animated properly with Lua.
Okay i did it with prop physics and it did find the animation, so switched it over to prop dynamic as it wont lay on physics like you said, but I cant select it(the prop) at all.
You don't "switch" it to prop_dynamic, do what the tool suggests you to do: Right click on the prop while holding C > Make Animatable. Then the animation should work if you did it correctly.
okay i did that and it didnt play. was it supposed to be a prop_physics when i made it animatable?
It's not a prop physics when you make it animatable. Either you did it wrong, or if you did it correctly, your model is wrong, in which case you should go to the Modelling subforum instead. Keep in mind that Source uses [url=https://en.wikipedia.org/wiki/Skeletal_animation]skeletal animation[/url].
okay, ill try to repost this in modelling forum.
Sorry, you need to Log In to post a reply to this thread.