Larian Banner: Baldur's Gate Patch 9
Previous Thread
Next Thread
Print Thread
#637961 28/11/17 10:42 PM
Joined: Sep 2017
F
Fraktal Offline OP
stranger
OP Offline
stranger
F
Joined: Sep 2017
Hi all
I would to have some npcs attacking targets, like soldier training, for atmosphere purpose. Could not find any tutorials about that. Does someone have a good idea?
Thanks!

Joined: Nov 2017
I
apprentice
Offline
apprentice
I
Joined: Nov 2017
You'll want to change their animation, I think. (I'm a fiddler, not an expert.)

1. Open your NPCs visual resources (where you change their clothes and hair and stuff) and look through the animations listed in the drop-down above the preview window.
2. Available animations vary a bit depending on the root template you're using, but you should have at least one or two options that start with "training." Make sure the word "loop" is in the name somewhere, and copy the name. Close the window.
3. Open up the Scripts option in the sidebar for your NPCs and search for "anim." Pick one like GLO_LoopAnimDuringPeace (feel free to play around until you find one that behaves how you want) and paste in the animation name you copied earlier into the correct field.
4. Save and reload.

5. You might need to get your characters to draw their weapons first. I don't know if they're drawn automatically when you use an animation with the correct weapon type, but I doubt it. There's probably a script for that too.

Joined: Nov 2017
I
apprentice
Offline
apprentice
I
Joined: Nov 2017
You can also load up a game map if you know of an area in-game where NPCs are training and see what sort of scripting is assigned to those NPCs.

Joined: Nov 2017
L
member
Offline
member
L
Joined: Nov 2017
The simplest implementation for this, if it doesn't conflict with other scripting, is to create a character script that has a reaction, which executes a simple CharacterAttack and a Sleep between each of the attacks.
Something along the lines of

Code
INIT
EXTERN ITEM:%Target=null
[...]
REACTION Training, 100
USAGE PEACE
ACTIONS
	CharacterAttack(%Target, 1)
        Sleep(1)


Then, you can create a few indestructible objects (dummies, targets, etc.) and set them as targets for your training NPCs.

Joined: Sep 2017
F
Fraktal Offline OP
stranger
OP Offline
stranger
F
Joined: Sep 2017
Thank you both
I ll try ir


Moderated by  Larian_KVN 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.5