Solved Enemy weapon question.

Question that is answered or resolved.
Solution
thank you I was curious as to whether the AI would try to use weapons empty-handed. So, can I just make it the same way I made the player's weapon?

Yes. Set up AI models same as players. If there's a weapon the AI can use nearby (and it doesn't already have a weapon), it will go and get it.

Note the weapon has to actually be spawned. Meaning the AI won't break open crates and things to find weapons, unless you make it hostile toward those types.

DC
I know some setting makes opponents can picking up items like food.
I think I saw that in FF Gold mod.
But About weapons, I don't know, but @DCurrent would tell you "it's possible, the question is just how"
 
I know some setting makes opponents can picking up items like food.
I think I saw that in FF Gold mod.
But About weapons, I don't know, but @DCurrent would tell you "it's possible, the question is just how"
If the enemy can move like the player, I'm thinking of making the enemy have weapon animations as well.
 
  • Like
Reactions: NED
If an enemy has a nearby weapon, like the player character, can they pick it up and use it?

Technically they can, but they won't. The AI will pick up a weapon if it doesn't have one already, and it can use the weapon. Otherwise it ignores them.

Getting it to pick up a weapon when it already has one could get a bit complex. Not only will you need to overcome the default AI behavior, you'll also need to ensure they don't just sit there swapping weapons in an endless loop.

Can you outline exactly how you want them to behave?

DC
 
Technically they can, but they won't. The AI will pick up a weapon if it doesn't have one already, and it can use the weapon. Otherwise it ignores them.

Getting it to pick up a weapon when it already has one could get a bit complex. Not only will you need to overcome the default AI behavior, you'll also need to ensure they don't just sit there swapping weapons in an endless loop.

Can you outline exactly how you want them to behave?

DC
thank you I was curious as to whether the AI would try to use weapons empty-handed. So, can I just make it the same way I made the player's weapon?
 
Last edited:
thank you I was curious as to whether the AI would try to use weapons empty-handed. So, can I just make it the same way I made the player's weapon?

Yes. Set up AI models same as players. If there's a weapon the AI can use nearby (and it doesn't already have a weapon), it will go and get it.

Note the weapon has to actually be spawned. Meaning the AI won't break open crates and things to find weapons, unless you make it hostile toward those types.

DC
 
Solution
Enemies will pick up weapons if they have the model available. In my game they even pick health items if they aren't full health.
check at around 2:00 to see enemies picking knife and knuckle:
thank you Confirmed enemy picking up a weapon. This game features free terrain and a variety of weapons.
 
Last edited:
OK what are methods to prevent ememies from picking weapons? in my game enemies do have weapons but i think the shared weapon index is making them picking up weapons for players and vice versa .... players have 3 weapons and enemies have 3 weapons...

so... in order for enemies to not pick players weapons i should set in enemy header - weapons NONE NONE NONE enweap1 enweap2 enweap3 ?

--
Yes it looks like that solves it, i just reserved slots from 1 to 9 for players and from 10 to 20 for enemies

so enemies have weapons NONE NONE NONE NONE NONE NONE NONE NONE NONE weap1 weap2 noweap

and players have normally weapl1 weapl2 weapl3 weapl4 weapl5 weapl6 weapl7 weapl8 noweapl

So now players wont pickup enemies weapons and vice versa
 
Last edited:
so... in order for enemies to not pick players weapons i should set in enemy header - weapons NONE NONE NONE enweap1 enweap2 enweap3 ?
Yes

Axel can pick up all weapons.
C:
weapons                Axel_Knife Axel_Kunai Axel_Pipe Axel_Sword Axel_Bat Axel_Bottle Axel_Grenade Axel_Pepper Axel

Donovan can only pick up pipe.
C:
weapons                none none Donovan_PipeP_ none none none none none Donovan_

As an alternative you can change the stealth factor in both enemies and item entities, works through header or with scripts.

1716430326745.png
 
Back
Top Bottom