Jump to content

Adding combat behavior to AI


GaKnomboe

Recommended Posts

Hello, I've been going through the scripting tutorials. Up to the fifth one at the moment.

I was wondering if anyone had luck adding combat behavior to a new NPC brain, the tutorials have been excellent so far but it seems this is not covered.

 

Having a look at the combat behavior of existing NPC's within the game, there is sub brain for the NPC's which is a combat behavior tree called "npc_daycycle_combat" (status passive, type combat, priority 8

with a whole lot of variables to go with it.

 

I've set up an NPC to use the sub brain npc_daylight_cycle, this seems to load the behavior tree npc_daylight_combat, and when placed within a smart area and an AI navigation area that is navmeshed I can get the NPC to engage in combat.

If I use an existing soul that uses this same sub brain (npc_daylight_cycle), ie ratay guard 10, then they will not engage in combat.

 

Furthermore, I can't seem to get a new NPC to use its inventory, well, I can give it a weapon preset, but I can't seem to save the armor / clothing.

 

I also can't seem to get the player to equip weapons dropped by enemies, they appear in the inventory but cannot be used, probably applies to all weapons I have yet to figure out weapon spawning.

Has anyone had luck with the following -

 

1. Are there more efficient combat behavior than loading the npc_daylight_cycle - this seems to have a lot of extra scripting that wouldn't be necessary for a simple bandit.

2. Has anyone been able to set up clothing for a custom NPC and have it save - seems the armor test under the npc editor just resets every time the game is loaded.

3. Has anyone been able to get the player to use weapons in the editor - I'm sure this can be done but can't figure out whats missing - possibly a player script?

 

 

Edit bit of info I have worked out:

 

1. Set factions in the NPC editor, in the rollup bar all npcs should be in civilian faction. In the NPC editor set social class to bandits, or cumans and another faction as soldiers to get them to engage in combat.

2. A more efficient AI is npc_battle. If using npc_daylight_cycle it will take some time for all the AI to run through their scripts and engage in battle. However I am still figuring out how to get a brain using npc_battle to engage in combat, right now they just stand around.

3. NPC's only seem to engage with eachother when you get a certain distance away, this seems to be set by the sightdistance in the rollup bar, and denoted by the circle when you select the npc.

4. A lot of the bandits and soldiers in battles are AnimChar (animated characters) as opposed to NPC's, still figuring out how to get these to play a combat animation and synch it with another animated character.

 

Edit a bit more info:

 

It seems combat AI is also set through other tools such as "Swift" and "Storm". Still figuring these out.

Edited by GaKnomboe
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...