Guns, guns, and AI.

Mapping & modding Fallout Tactics and reviewing maps thereof.
Post Reply
User avatar
Shadowvalor
Regular
Regular
Posts: 63
Joined: Mon May 20, 2002 9:50 am
Contact:

Guns, guns, and AI.

Post by Shadowvalor »

Here's the basic idea of what I'm doing.
Since my mod makes each squad member as important as the main character(they're not allowed to die), and one of the more important one of these NPCs has his own unique weapon. It's a cut-down .50 BMG rifle, down into a handgun. Now, by itself thats great. I got it with only him being able to use it because he has it requirements set to some o fhis perks, includeing one only owned by two people.
So, I was thinking about it, and I realised that this may not be all that good. If the player does take the handgun off of the NPC, then we see him with it in a cut-scene, or worse yet if he leaves the group then joins again sometime later, there will be a second one of these unique weapons.

Now, here's where how the AI works comes in. Seeing as there are a few races that I don't use in a mod, I figure I can make a race specificly for him useing the (hopefully) new sprite I'll be rendering. Once it's a new race, couldn't I set it up so as the handgun entitiy replaces that of his kick, so it can't be moved?

Only now brings the problem of the AI having him use the weapon. If he expells all of his basic ammo in the punch slot, will he move over to the kick slot, or just unequip his weapon?
Help end poverty, eat the poor.
endocore
Regular
Regular
Posts: 57
Joined: Sun Apr 21, 2002 11:29 am

Post by endocore »

There are quite a few ways to go with this, depending on what you're doing (is it a single mission or an ongoing campaign, which will influence whether or not you can give each possible PC a tag name) and what sort of results you're willing to be satisfied with.

Assuming you can tag name each possible player character, as simple solution to this problem would be to tag name the weapon and then implement a series of item swap triggers with the "Preserve" modifier checked. You could say that the NPC is fiercely protective of his weapon, and won't let anyone else handle it. To enforce this, you could then have a bunch of triggers along the lines of:

1. That's My Gun, Fool

CONDITION:

WrongPC has more than 0 items tagged CoolGun

ACTION:

Give item tagged Coolgun to unit ProperOwner

Admittedly that's sort of drastic, but it's something to think about.


Endocore
User avatar
Shadowvalor
Regular
Regular
Posts: 63
Joined: Mon May 20, 2002 9:50 am
Contact:

Post by Shadowvalor »

Well, it's a campgin. There are a good 10 or so NPCs thoughout the campgin that are at some point in your squad. Just, being a campgin I don't think I can put a tag name on the main player character.
Help end poverty, eat the poor.
endocore
Regular
Regular
Posts: 57
Joined: Sun Apr 21, 2002 11:29 am

Post by endocore »

I've never played around with the race definitions, but in theory your idea sounds plausible.

I'm not sure I quite understand what you mean when you said:

If he expells all of his basic ammo in the punch slot, will he move over to the kick slot, or just unequip his weapon?

If you meant what could happen if the weapon ran out of ammo, perhaps you could just assume that this fellow carries enough ammo for his weapon to keep himself going for a whole scenario, and set the ammo usage of the weapon to 0.

You could also play around with making the weapon non-lootable and the character unable to barter, which might make anyone unable to take it away from him (hmm, it's been a while since I looked at those characteristics, so if I'm wrong someone please just smack me or something for giving out incorrect info).

I'm also not quite clear on the role of the weapon wielder. When you frequently refer to him/her/it as an "NPC", do you mean the wielder is in fact always an NPC, or do you mean that sometimes they may be an NPC but that at other times they will join the player's squad, and at those times be a PC (under the control of the player)?


Endocore
User avatar
Shadowvalor
Regular
Regular
Posts: 63
Joined: Mon May 20, 2002 9:50 am
Contact:

Post by Shadowvalor »

I prefer to him as NPC just because I don't want to give much away from my campaign. Kinda hard, and all. Anyway, yes- When I said 10 NPCs I mean 10 people who at some point join your squad.

His basic setup is he begins with a P90 in hand1, when he uses all of his ammo for it, will he go to hand2 where the handgun will perminately be, or just unequip hand1? I'm not sure how the AI works with that.

Also, with the unlootable thing, I was very disapointed to see that once the weapon is equiped/has ammo loaded by an NPC, it once again becomes lootable. This great distrubs the balance of weapons in my campaign, so I'm working on another way to do this.
Don't suppose anyone might have a fix for this either, that doesn't involve me makeing a special eneity for each of the weapons NPCs use that have nonlootable marked like the General's weapon at the end of the core campaign?

I'm not sure about the ammo thing. It might work, since then the player couldn't take it.
Help end poverty, eat the poor.
endocore
Regular
Regular
Posts: 57
Joined: Sun Apr 21, 2002 11:29 am

Post by endocore »

Shadowvalor wrote:
His basic setup is he begins with a P90 in hand1, when he uses all of his ammo for it, will he go to hand2 where the handgun will perminately be, or just unequip hand1? I'm not sure how the AI works with that.
Of course if he's under the player's control at the time, then what happens will be at the player's discretion. If he's an NPC (under computer control) at the time, my impression is that if he runs out of ammo for the P90, he'll switch to a firearm in the other hand if his relevant guns skill level is higher than his unarmed skill, but that if his unarmed skill level is higher than his guns skill level he'll unequip the P90 and exclusively use a punch attack instead.

I'll try to think about these matters further, and will post if I come up with anything I think might be useful to you.


Endocore
User avatar
Shadowvalor
Regular
Regular
Posts: 63
Joined: Mon May 20, 2002 9:50 am
Contact:

Post by Shadowvalor »

endocore wrote:Of course if he's under the player's control at the time, then what happens will be at the player's discretion. If he's an NPC (under computer control) at the time, my impression is that if he runs out of ammo for the P90, he'll switch to a firearm in the other hand if his relevant guns skill level is higher than his unarmed skill, but that if his unarmed skill level is higher than his guns skill level he'll unequip the P90 and exclusively use a punch attack instead.
Alright. Cool. Well his small guns is much, much higher than his unarmed. A strength of 3 may be the cause of that.

I just need to find a race to replace.
Currently, tribal is the standard human, as it can equip raider and reaver armor, while bos can't. Tribal-Huge is unique specificly to the final boss, as well.
Help end poverty, eat the poor.
User avatar
Max-Violence
Wandering Hero
Wandering Hero
Posts: 1221
Joined: Thu Apr 18, 2002 4:15 am
Location: In my own personal vault
Contact:

Post by Max-Violence »

I know for a fact that if an actor runs out of ammo for one weapon, he/she/it will go to another.

In Rebellion2, I have some Grenadiers who have 1 Flash grenade in Hand1 and 1 Frag Grenade in Hand2 with 3 extra Frag grenades in the actor's inventory. When the actor attacks the PCs, he throws the Flash grenade then starts chuckin' Frag grenades. Very nice indeed :twisted:

Also, as Endocore found out in Rebellion 1, there is an enemy with a Rocket Launcher in Hand1 and a Laser pistol in Hand2. The enemy has ~3 extra rockets, so when she runs out of rockets, she switches to the laser pistol an' starts a-shootin' :mrgreen:
Closing our eyes forces us to look
At the darkness inside.
Our emotions always find us
Regardless of where we hide.

maxviolence@hotmail.com
http://mvmaphub.duckandcover.cx <--- Updated July 10th, 2006
Our Host!
Post Reply