banner



How To Fix Pistol Npc Animation Gmod

Download attachment

Getting Started

The use of scripted_sequences in maps is i of the things that make single histrion mapping that much more than versatile. Scripted_sequences are used to command npc characters and give them animations; it can used to exhale life into an otherwise still scene.

For this case, we'll be making two npc_citizens carry out their everyday beingness. The showtime 1 will walk to the couch and sit on it while the other i will try to become a Television working.

Firstly, create a room. Go far a reasonable size; mine was 256x448 (on top view).
Identify an info_player_start and a few light entities in the room. Now (for the do good of my case), place a burrow in the room, and a TV on a table reverse it.

A nice little scene A squeamish piddling scene

Choosing the Animations

Now we're going to set our scripted sequences. Firstly, allow's encounter what animations nosotros desire the NPC's to have. Place an npc_citizen somewhere in the room, where is not important at the moment. Become into the backdrop and click the Model tab. Now go through the sequences, click a few to see what they await like. This is the animations library, nosotros need the names of the animations we like to put in the scripted_sequence.

Okay, so for this case I want to use the Idle_to_Sit_Chair, you can go and find this to see a demonstration.

Look, he's alive! Look, he's alive!

Now name the npc. For my case set the name to npc_bob, and cut and paste him into a corner (moving them normally after setting up an animation in the model tab can crash hammer, setting it back to Sequence: ragdoll tin can foreclose this).

Now we desire to place the scripted_sequence entity. Select it from the entity list and place information technology on the flooring right in front end of the couch (it's important not to place it in the couch. Scripts don't piece of work inside props or other entities). The small xanthous line in the top view shows which fashion the scripted_sequence is facing: you want information technology facing toward the Telly. To change this line, become to the scripted_sequence properties and change the angle.

Yellow line is in top left view Yellowish line is in top left view

Setting upwards the scripted_sequence

The fun part: go to the scripted_sequence backdrop and make the Target Npc npc_bob. We'll set up the entry animation to Idle_to_Sit_Chair. Fix the action animation to Sit_Chair and set up the postal service activity blitheness to Sit_Chair. Move to Position should be fix to Walk. Y'all can also brand him run or get to the sequence instantly. Go to the flags tab and tick Override AI, Loop in Post idle and Priority Script. This basically means the NPC will do this despite distractions and will continue sitting, fifty-fifty after the script is finished.

Testing the sequence

Proper noun the scripted_sequence script_bobsit. Now, create a func_button on the wall somewhere and set the Output to: Onpressed, Target entity: script_bobsit, Via this output: Begin Sequence. Now would be a proficient time to test, so compile and load it up. Press the push and see if the npc does the sequence.

Woo, button Woo, button

Role ii: Fixing the Tv

Now we're going to set up the other npc, the one that'll try to get the TV working.

Identify another npc_citizen in some other corner of the room. Name this 1 npc_paul. Now place a scripted_sequence in forepart of the Tv you placed earlier, and set the angle to face the TV. Prepare the Target NPC to npc_paul. Set the Entry Blitheness to standtocrouchhide, set up the activeness animation to crouchidlehide and the Postal service activity idle Animation to crouchhidetostand. This time however, the npc will not be looping the animation, in which case the only flags yous need to tick are override AI and Priority Script. Tick the Repeatable flag as well.

Proper name the scripted_sequence script_paulfix and place another push button. This push button will be: OnPressed, Target Entity: script_paulfix, Via input: BeginSequence.

Determination

If you've followed this correctly, you lot should exist able to become both npc'south going by pressing their private buttons. If yous ticked the Repeatable flag, you can press the TV guy'south button more than than once. Compile and test.

Of class, this is just a starting point for what you lot can do with scripted_sequences. I hope this gives you lot many ideas and has taught yous how to use them effectively.

Full room layout Total room layout

In action In action

Source: https://twhl.info/wiki/page/Tutorial:_NPC_Scripting_Basics

Posted by: hollandwoorkepark.blogspot.com

0 Response to "How To Fix Pistol Npc Animation Gmod"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel