[highlight][B]IF YOU HAVE NEVER USED NPC ANIMATIONS BEFORE, YOU PROBABLY DON'T NEED THIS.[/B][/highlight]
It allows you to use an NPC model as your player model, and have it properly animated. Probably pretty useful for those who want to do RP gamemodes and thus need better animations for unarmed players and the like, or machinima makers who want an easier way of filming NPCs moving about or something.
It also replaces the old version on Cakescript and Tacoscript. You're most likely visiting this thread to look for a working version of those scripts. If so, follow these instructions.
[quote][list][*]Replace your existing animations.lua with this version
[*]Open shared.lua with notepad or whatever.
[*]Put this on the first line:
[lua]include( "animations.lua" )[/lua]
[*]Open cl_init.lua
[*]Put in this next to the other lines that say "AddCSLuaFile", if there's none, just put it on the first line:
[lua]AddCSLuaFile( "animations.lua" )[/lua][/list][/quote]
For those planning to use this standalone, just extract to [U]lua/autorun[/U]. Make sure your clients get the file too.
Credits to Entoros for helping me figure out how to fetch a weapon's holdtype.
[url=http://www.garrysmod.org/downloads/?a=view&id=98249][img]http://www.garrysmod.org/img/?t=dll&id=98249[/img][/url]
TACOSCRIPT 1 VERSION
[url=http://www.garrysmod.org/downloads/?a=view&id=100345][img]http://www.garrysmod.org/img/?t=dll&id=100345[/img][/url]
Oh, and before I forget, use rp_toggleholster to keep aiming without your viewmodel going off every 4 seconds.
[B]THIS FILE IS SHARED. YOUR CLIENTS AS WELL AS THE SERVER MUST HAVE IT REQUIRED AND DOWNLOADED, ELSE IT WILL NOT WORK.[/B]
[U]Additional Notes:[/U]
I added support for Lua animations ( using Jetboom's API ). Simply replace the sequence name with "&lua:sequence;".
You can also use the same trick to change the model after applying a sequence, "&switch:model;sequence"
Can we have a little video?
Glad I could help. Looks pretty nice. What exactly does it do though? It's a little unclear.
To fix the shared problem thingy, add this at the top of the file:
[code]AddCSLuaFile("animations.lua")[/code]
Also, animations.lua is rather ambiguous. I would give it a more defined name.
[QUOTE=BurningPride;21843979]Can we have a little video?[/QUOTE]
Uh, sure, once I'm home.
Apparently it doesn't work for some people. Make sure you're following the instructions. To those who don't get what they have to do, it's as simple as this
[list][*]Replace your existing animations.lua with this version
[*]Open shared.lua with notepad or whatever.
[*]Put this on the first line:
[lua]include( "animations.lua" )[/lua]
[*]Open cl_init.lua
[*]Put in this next to the other lines that say "AddCSLuaFile", if there's none, just put it on the first line:
[lua]AddCSLuaFile( "animations.lua" )[/lua][/list]
That's it, you're set.
So... What does this do.
[QUOTE=SchumacherAlt;21845482]So... What does this do.[/QUOTE]
He's ganna make a video.
[QUOTE=BurningPride;21845496]He's ganna make a video.[/QUOTE]
Mk
Uh, I can make a video. But this is simply a new version of the animations.lua included with Tacoscript and Cakescript.
It's more like a developer's resource than anything.
Where do you extract it?
Excellent work.
Yeah this is a little confusing. Which cl_init file? Where does this animations.lua file go? And can you explain what this does if it's going to take a while to make the video?
[QUOTE=AzuiSleet;21847768]Excellent work.[/QUOTE]
Wow, thanks. Didn't really expect that you would come to congratulate me. After all, I'm just working around with the stuff you made.
Anyway, bug fix.
[url=http://www.garrysmod.org/downloads/?a=view&id=98249][img]http://www.garrysmod.org/img/?t=dll&id=98249[/img][/url]
[QUOTE=RayFanMan;21848973]Yeah this is a little confusing. Which cl_init file? Where does this animations.lua file go? And can you explain what this does if it's going to take a while to make the video?[/QUOTE]
The OP says it pretty well. It changes the animation hooks so you can use them with NPC models ( ie., setting your model to "models/barney.mdl" instead of it's player model equivalent ). It however provides no real mean to do so. It's more like a developer utility than something end users should use.
In fact, it's almost completely useless to any anyone who's not doing an RP gamemode or making a machinima film and wants the gracefulness of NPC's motion but doesn't want to do a very long process to make that tangible. Unless you really like NPC animations.
Really nice, Thank you very much good sir. :3
This is great, because I love animations, but I'm still lost on how to actually install this. Refer to my earlier post.
Could this be modified to include custom (that is, self made) animations? I don't mean lua animations, I mean... actual animations.
[QUOTE=Cheese123;21847722]Where do you extract it?[/QUOTE]
Ahem.
[QUOTE=RayFanMan;21850123]This is great, because I love animations, but I'm still lost on how to actually install this. Refer to my earlier post.[/QUOTE]
What it does:
If you ever looked in CakeScript or TacoScript you will see that their animations.lua is deprecated, so you have to simply replace it with this version, that seems to be updated!
Tell me if I'm wrong!
[QUOTE=JgcxCub;21854588]Could this be modified to include custom (that is, self made) animations? I don't mean lua animations, I mean... actual animations.[/QUOTE]
If your model includes said animations, then yes, you pretty much can. I don't really know if you can even call them through the enumeration's list but still. I'll look into it. For now, you can just use custom animations through Jetbooms API.
[QUOTE=RayFanMan;21850123]This is great, because I love animations, but I'm still lost on how to actually install this. Refer to my earlier post.[/QUOTE]
Again, if you wanna just install it, just extract to lua/autorun. However, you must set your model ( As well as your client's ) to an NPC model for it to work. How you do that, is up to you. This is a developer resource at most.
Oh that's what that meant. :P Lol.
[QUOTE=Cheese123;21855622]Ahem.[/QUOTE]
Read the OP.
[QUOTE=Big Bang;21860647]For now, you can just use custom animations through Jetbooms API.
[/QUOTE]
I never really got Jetboom's API. Is this something where you key in the different rotations at different times and it moves them using Lua?
[QUOTE=JgcxCub;21873642]I never really got Jetboom's API. Is this something where you key in the different rotations at different times and it moves them using Lua?[/QUOTE]
No, it's using hard-coded citizen animations that are already in the engine.
Will this work for all NPC models, or just a few? If the latter, which ones?
[QUOTE=thomasfn;21881547]Will this work for all NPC models, or just a few? If the latter, which ones?[/QUOTE]
It will work for citizens, both male and female, metrocops and combine. Citizens also include "special" citizens like Alyx, Barney, Eli...Of course, some of them do not have all animations, like for example, those where they're holding guns.
If you're a developer, though, you can add your own "genders", and make a list for particular NPCs, just copy the template.
[QUOTE=JIAC;21881530]No, it's using hard-coded citizen animations that are already in the engine.[/QUOTE]
Mine is, but you can use Jetboom's API to use Lua based animations, and my script will support it.
[QUOTE=JgcxCub;21873642]I never really got Jetboom's API. Is this something where you key in the different rotations at different times and it moves them using Lua?[/QUOTE]
Essentially yes, check the editor. It simply uses the new BuildBonePositions bone to do the animations.
So how hard would it be to implement NPC animations for players for say, all of the zombie models?
[QUOTE=thomasfn;21895433]So how hard would it be to implement NPC animations for players for say, all of the zombie models?[/QUOTE]
Zombies don't have pistol animations. If you just want them to walk around, you don't have to add anything at all, it will use the default animations.
If you do want a little bit more interactivity, do a template, the layout is basically this.
[lua]
Anims.Zombie = {}
Anims.Zombie[ "models" ] = {
}
Anims.Zombie[ "default" ] = {
[ "idle" ] = "ACT_IDLE",
[ "walk" ] = "ACT_WALK",
[ "run" ] = "ACT_RUN",
[ "jump" ] = "ACT_JUMP",
[ "land" ] = "ACT_LAND",
[ "fly" ] = "ACT_GLIDE",
[ "sit" ] = "ACT_COVER_PISTOL_LOW",
[ "sitground" ] = "",
[ "flinch" ] = {
["explosion"] = "ACT_GESTURE_FLINCH_BLAST"
},
[ "crouch" ] = {
[ "idle" ] = "ACT_COVER_PISTOL_LOW",
[ "walk" ] = "ACT_WALK_CROUCH",
[ "aimidle" ] = "ACT_RANGE_AIM_SMG1_LOW",
[ "aimwalk" ] = "ACT_WALK_CROUCH"
},
[ "aim" ] = {
[ "idle" ] = "ACT_IDLE",
[ "walk" ] = "ACT_WALK_AIM_RIFLE",
[ "run" ] = "ACT_SPRINT"
}
}[/lua]
Would this work for rebel models?
Yes.
[QUOTE=Big Bang;21904951]Zombies don't have pistol animations. If you just want them to walk around, you don't have to add anything at all, it will use the default animations.
If you do want a little bit more interactivity, do a template, the layout is basically this.
[lua]
Anims.Zombie = {}
Anims.Zombie[ "models" ] = {
}
Anims.Zombie[ "default" ] = {
[ "idle" ] = "ACT_IDLE",
[ "walk" ] = "ACT_WALK",
[ "run" ] = "ACT_RUN",
[ "jump" ] = "ACT_JUMP",
[ "land" ] = "ACT_LAND",
[ "fly" ] = "ACT_GLIDE",
[ "sit" ] = "ACT_COVER_PISTOL_LOW",
[ "sitground" ] = "",
[ "flinch" ] = {
["explosion"] = "ACT_GESTURE_FLINCH_BLAST"
},
[ "crouch" ] = {
[ "idle" ] = "ACT_COVER_PISTOL_LOW",
[ "walk" ] = "ACT_WALK_CROUCH",
[ "aimidle" ] = "ACT_RANGE_AIM_SMG1_LOW",
[ "aimwalk" ] = "ACT_WALK_CROUCH"
},
[ "aim" ] = {
[ "idle" ] = "ACT_IDLE",
[ "walk" ] = "ACT_WALK_AIM_RIFLE",
[ "run" ] = "ACT_SPRINT"
}
}[/lua][/QUOTE]
These are all included within the files, correct? The zombie anims and whatnot. Where did you include the filename? (So I can change it for my own custom anims).
[QUOTE=JgcxCub;21917562]These are all included within the files, correct? The zombie anims and whatnot. Where did you include the filename? (So I can change it for my own custom anims).[/QUOTE]
Well, my system uses sequences on the enumeration list, using the ACT_ enumerations. If your new engine animations do not use these sequences, you're pretty much unable to use them.
I don't know if it's possible to set the custom animations to "garbage" ones, like the DoD ones that aren't really used at all.
Sorry, you need to Log In to post a reply to this thread.