• Animating an SNPC
    4 replies, posted
So... I want to do a simple thing, and is to simulate a player sleeping. To do that, I've thought about using an animated NPC (using the citizens models only) that plays an animation of a person that it's lying on the ground. I know that there are animations of citizens lying on the floor and I wanted to use those. However, as much as I've researched about SNPCs, I haven't been able to animate one. Any help, please?
Now, are you trying to animate a player, or an NPC? Well, I assume you know what you are doing, so I'd suggest to check out the already available methods, [IMG]https://steamcommunity.com/favicon.ico[/IMG] [URL="https://steamcommunity.com/sharedfiles/filedetails/?l=english&id=104604709"]Easy Animation Tool[/URL] from Robut. Download and reverse engineer that script, I think it does have everything you need. Reverse engineering is the best way to learn new stuff, most of us started out this way :3 Additionally, you want to use [IMG]https://wiki.garrysmod.com/favicon.ico[/IMG] [URL="https://wiki.garrysmod.com/page/Entity/PlayScene"]Entity:PlayScene[/URL] for animations or [IMG]https://wiki.garrysmod.com/favicon.ico[/IMG] [URL="https://wiki.garrysmod.com/page/NPC/SetExpression"]NPC:SetExpression[/URL] for looped ones. Here is a list of default animations (excluding the garry's mod ones) [IMG]https://developer.valvesoftware.com/favicon.ico[/IMG] [URL="https://developer.valvesoftware.com/wiki/Half-Life_2_Scenes_List"]https://developer.valvesoftware.com/wiki/Half-Life_2_Scenes_List[/URL]
[QUOTE=Kiro The Pro;50741851]Now, are you trying to animate a player, or an NPC? Well, I assume you know what you are doing, so I'd suggest to check out the already available methods, [IMG]https://steamcommunity.com/favicon.ico[/IMG] [URL="https://steamcommunity.com/sharedfiles/filedetails/?l=english&id=104604709"]Easy Animation Tool[/URL] from Robut. Download and reverse engineer that script, I think it does have everything you need. Reverse engineering is the best way to learn new stuff, most of us started out this way :3 Additionally, you want to use [IMG]https://wiki.garrysmod.com/favicon.ico[/IMG] [URL="https://wiki.garrysmod.com/page/Entity/PlayScene"]Entity:PlayScene[/URL] for animations or [IMG]https://wiki.garrysmod.com/favicon.ico[/IMG] [URL="https://wiki.garrysmod.com/page/NPC/SetExpression"]NPC:SetExpression[/URL] for looped ones. Here is a list of default animations (excluding the garry's mod ones) [IMG]https://developer.valvesoftware.com/favicon.ico[/IMG] [URL="https://developer.valvesoftware.com/wiki/Half-Life_2_Scenes_List"]https://developer.valvesoftware.com/wiki/Half-Life_2_Scenes_List[/URL][/QUOTE] Those are for scenes, it has nothing to do with NPC animation.
All the Easy Animation Tool does to animate NPCs is this: [CODE] npc:ResetSequence(npc:LookupSequence('reference')) -- reference for example npc:ResetSequenceInfo() npc:SetCycle(0) npc:SetPlaybackRate(1) [/CODE] Tested that and it works, but you need to set ai_disabled to 1 as the tool tells you to do
[QUOTE=Kiro The Pro;50741851]Now, are you trying to animate a player, or an NPC? Well, I assume you know what you are doing, so I'd suggest to check out the already available methods, [IMG]https://steamcommunity.com/favicon.ico[/IMG] [URL="https://steamcommunity.com/sharedfiles/filedetails/?l=english&id=104604709"]Easy Animation Tool[/URL] from Robut. Download and reverse engineer that script, I think it does have everything you need. Reverse engineering is the best way to learn new stuff, most of us started out this way :3 Additionally, you want to use [IMG]https://wiki.garrysmod.com/favicon.ico[/IMG] [URL="https://wiki.garrysmod.com/page/Entity/PlayScene"]Entity:PlayScene[/URL] for animations or [IMG]https://wiki.garrysmod.com/favicon.ico[/IMG] [URL="https://wiki.garrysmod.com/page/NPC/SetExpression"]NPC:SetExpression[/URL] for looped ones. Here is a list of default animations (excluding the garry's mod ones) [IMG]https://developer.valvesoftware.com/favicon.ico[/IMG] [URL="https://developer.valvesoftware.com/wiki/Half-Life_2_Scenes_List"]https://developer.valvesoftware.com/wiki/Half-Life_2_Scenes_List[/URL][/QUOTE] Animating the player should finish the job quickly, but the thing is that I think that I have to use CalcMainActivity and reprogram all the animations. [editline]20th July 2016[/editline] [QUOTE=MPan1;50742962]All the Easy Animation Tool does to animate NPCs is this: [CODE] npc:ResetSequence(npc:LookupSequence('reference')) -- reference for example npc:ResetSequenceInfo() npc:SetCycle(0) npc:SetPlaybackRate(1) [/CODE] Tested that and it works, but you need to set ai_disabled to 1 as the tool tells you to do[/QUOTE] Is there any way to disable just an NPC in particular?
Sorry, you need to Log In to post a reply to this thread.