The ability of NPC's to pick up weapons?
Like, if an NPC walks through a weapon, it will switch to the weapon it walked into? Or if an enemy walks into an ammo clip/health pack, their ammo/health is restored?
I mean, if there's a way to do this, I'd LOVE to know, but if there isn't, how difficult do you think it would be to add this feature?
One of my ideas is to have every weapon you can obtain also scripted into a seperate npc. When an NPC walks over A weapon, it replaces that npc with a similar npc that can use that weapon.
Idunno, any thoughts?
Would this be possible, or even worth it?
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Re: Would this be possible, or even worth it?
Hum... It could be done, but the weapons and other items would have to be changed so he NPCs can "note" them. I'd try making weapons that, in its pickup state, constantly call an A_Explode with a custom damage that every actors in the game/mod are immune (damagefactor 0). Every kind of item would need to have its own custom damage, and players, monsters and even the NPCs should be make 'immune' to all of them. But, this kind of damages should be able to make NPCs enter its 'Pain.CUSTOMDAMAGENAME' state, and there you would make they change as you want.
It's not neede to make the NPC spawn a new actor when it gets a weapon, it would be easier (IMO) if all the other states checks if the NPC have the items and then show a different skin for each situation. I've done a zombie for Mindfuck wad that is able to steal players weapons, and then changes its skin depending on the weapon it did get. It was just needed to check in all the states what weapon it has, and then show the right 'skin'. If it has none, it shows the unarmed/fist skin.
But if you want to do "bots" or any hard-coded actor, then I know nothing about it
It's not neede to make the NPC spawn a new actor when it gets a weapon, it would be easier (IMO) if all the other states checks if the NPC have the items and then show a different skin for each situation. I've done a zombie for Mindfuck wad that is able to steal players weapons, and then changes its skin depending on the weapon it did get. It was just needed to check in all the states what weapon it has, and then show the right 'skin'. If it has none, it shows the unarmed/fist skin.
But if you want to do "bots" or any hard-coded actor, then I know nothing about it

- XutaWoo
- Posts: 4005
- Joined: Sat Dec 30, 2006 4:25 pm
- Location: beautiful hills of those who are friends
- Contact:
Re: Would this be possible, or even worth it?
Okay, two things.Ravick wrote:I'd try making weapons that, in its pickup state
1. Weapons don't have pickup states.
2. Even if this did, this would only let enemies and such check when the player first picked it up.
Re: Would this be possible, or even worth it?
Oops! My bad.
*Spawn state
*Spawn state
