Jump to content

Home

NPC behavior


MeleeMaster

Recommended Posts

Razorace said how the SP AI code works as seen above but there's one problem. Whenever I try and make a friendly npc that uses melee, they all suck. And no matter what class I give them they act exactly the same. No matter what stats I give them. They all act EXACTLY the same, and the AI I'm stuck with for them sucks.

 

EDIT:Why are NPCs so freaking complicated? Also after looking around in the MP SDK some I saw a lot of files talking about NPCs (not bots, NPCs).

Link to comment
Share on other sites

  • Replies 50
  • Created
  • Last Reply

It's because each NPC class is basically implimented seperately to give them different behavior. Plus, some of the boss behavior is hardcoded into the NPC code, like the evil healer twins for the Rosh battle, or Tavion's Spector attacks.

Link to comment
Share on other sites

Remember how you said friendly team=whatever class you chose? Well it doesn't seem to make a difference. I'm not talking about boss behavoir either. You see I'm trying to make an npc called rebel_commander that uses melee and acts like a gran except is tougher and smarter ect. and the problem is no matter what I do he can't seem to act right. Here's my problem, the scenario is him and a gran in a fist fight, rather than constantly punching after doing one punch he'll whip around and face the opposite direction as if he was trying to dodge the attack (but of course he doesn't dodge it) and then after a second or two he'll decide to punch again then face another direction, basically he goes *punch, 1...2...3 punch, 1...2..3 punch. No matter what class he is are what stats he has he'll do this.

Link to comment
Share on other sites

Okay, I just downloaded a huge single player mod called Escape from Yavin IV and in the second level there's a few grans with their fists up, I get hit once and it does 40 damage, normally they do around 25 damage, then he hits me again and it does 60 damage and sends me flying through the air, what the hell?

Link to comment
Share on other sites

  • 2 weeks later...

Hey guess what, I learned the you can add multiple classes to a .npc file to get different behaviors, I had never though of trying this before because I normally use the NPC Tool for creating NPCs which onlys allows one class. But I did this with my rebel commander NPC that uses melee and now he kicks Gran a** but still has a few problems (after that I modified his .npc file (I had all the extra classes typed as lowercase letters but I changed them to capital letters and know he doesn't seem to kick as much a**).

Link to comment
Share on other sites

Well you see I saw a topic where Tinny was asking how to make his own dual pistol NPC and he had its class set at commando and it wasn't working. Then someone told him to put in the commando class and the reborn class so then he had both classes in his NPC file and he said that it worked (and behaved better Im assuming) that it worked better (it still didn't have dual pistols though). The point is that he gave it 2 classes and it behaved differently. I may be wrong because theres a good chance the game just picks one of the classes to use by random but I didn't get any error messages ingame talking about my NPC having more then one class.

Link to comment
Share on other sites

mmm, well, a NPC can only be one class, that's simply the way the NPC class is set. I'm not even sure how it would parse that NPC file. Are we referring to the same actual NPC or just the same NPC file? Could you give an actual example of the NPC file?

Link to comment
Share on other sites

Well, I mean giving multiple classes to one entry in an NPC file, results are varied, to me it seems like the game just randomly picks one of the classes but somtimes it seems different. Here's an example:

 

rebel_melee

{

playerModel kyle

customSkin blue

weapon WP_MELEE

FP_LEVITATION 1

rank captain

aggression 5

aim 5

evasion 1

intelligence 5

move 1

reactions 1

playerTeam TEAM_PLAYER

enemyTeam TEAM_ENEMY

class CLASS_GRAN

class CLASS_REBORN

class CLASS_SHADOWTROOPER

class CLASS_KYLE

health 200

earshot 4024

visrange 4024

yawSpeed 890

walkSpeed 220

runSpeed 450

snd kyle

sndcombat kyle

sndextra kyle

sndjedi kyle

}

Link to comment
Share on other sites

  • 3 years later...

I'm not sure but I think that Desann's behaviour at Artus Prime (JKO) isn't part of the programming nor the npc file. If I'm right so the attacking with the force like this is coded in the compiled icarus scripts (*.ibi)

 

But if you want to have a pure force user with a saber defense so you need either to edit the icarus scripts (sp) or make a new mod and add a new npc class which also need a npc ;) (just mp)

Link to comment
Share on other sites

  • 8 months later...

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...